-
Notifications
You must be signed in to change notification settings - Fork 1
Theme Development
-
A
theme.jsonis required for a theme of wanna blog system.An example
theme.jsonfile should look like this:{ "name": "theme-name", "version": "0.1", "viewEngine": "[email protected]", "dateFormat": "YYYY-MM-DD hh:mm" }These fields can be specified in this file:
-
name - required
It specifies the name of the theme which serves as the unique id when searching in the wanna registry.
-
version - required
It specifies the version of the theme. It would be a good choice to use version to manage themes if you want to offer good and stable service to users.
-
viewEngine - required. Choose which view engine to use. It should be a name which can be found with npm. Specifying a version of the view engine will be better to make your theme stable.
Example:
"viewEngine": { "name": "mustache", "version": "0.7.0" }or
"viewEngine": "[email protected]" -
dateFormat - optional. Default to
YYYY-MM-DD hh:mm.User can override this in the blog config.json too.
Wanna uses moment.js to deal with date, you can visit here to see how to write dateFormat.
-
-
layoutsdirectory is required.You should put all the layouts or the so called templates in the
layoutsdirectory. -
assetsdirectory is required.This is the place to store your static files such as images, js andd css files.
-
componentsdirectory is required.Common template file such as foot, header, sidebar file should be put here.