Building NuGet Package

BlogEngine.NET uses NuGet (.nupkg) format to distribute extensions, themes or widgets. It is easiest to use NuGet package explorer to create a package. Here are some rules to verify before uploading package to online gallery.

Package ID

Package ID = extension class name. With theme or widget, it is a name of the theme/widget folder.

Version Number

In the version number, first 2 digits are current BlogEngine version, last 2 digits are plugin (extension etc) version..

For example, AddThis. is extension built for BlogEngine 3.0, extension version 0.2.

Package content folder

Packakge "content" = application root folder. For example, files added to the package as "content/custom/extensions/AddThis" will be distributed to the site under "/custom/extensions/AddThis", folder will be created if not exists.

Package lib folder

Package "lib" = application "/bin" folder. Files added under "lib" will be distributed in the site /bin folder.

Custom admin page

When extension has custom admin page, common location is "custom/extensions/your-extension-name" folder or "/custom/controls/your-extension-name" folder.

Custom styles and scripts

It is better to keep styles and scripts alongside extension or theme files.

For example if "AddThis" extension requires JavaScript files, put them under "/custom/extensions/AddThis" instead of "/Scripts", because "/Scripts" is "application" folder and will be wiped out during upgrade. 

So general rule is to keep supporting files under "/Custom" folder and not mix with common application files. 

Shared components

When plugin relies on common component, like jQuery or Bootstrap, it should be specified in the "readme" file of package description. Including multiple jQuery can create conflicts and script errors, so it might be better to include instructions on how to add jQuery if it is not already used by the blog.

Comments are closed