packages
A package is a collection of files that you can import into your project. Packages contain things like site layouts, macros and themes. From blog templates to RSS, packages can give you a head start on your project.
using packages
Calling nanosite import [name]
will import or upgrade a package. You can import a package locally or from a package repository:
- Locally: nanosite looks for a
[name].zip
file in the root of your project. - From a repository: nanosite will download the package from the online package repository. To point to an alternate repository, use
nanosite --set-package-url [repository-url]
.
Use nanosite import [name] --force
to force reinstall.
The package is now imported into your project!
making packages
Packages are simply .zip
files with an extra file, rules.json
, that describes how the files will be installed during import.
rules.json
{
"files": {
"[filename1.ext]": {"dest": [destination-path], "action": "[a or w]"},
...
},
"dependencies": [
"[dependency-name-1]", ...
],
"version": "[version-number]"
}
rules.json
is a dictionary with these entries:
files
: dictionary- Entries are filenames
- Values are dictionaries with these attributes:
dest
: destination path of file, relative to site top. This is a templated string:{{ MetaDir }}
is replaced with the site'smeta
directory.action
: "w" to write the file to this path. "a" to append the file to the file at this path.
dependencies
: list, names of packages this package requires.version
: a version number, recommendedx.x.x
format