Skip to content

Theme Development

shaoshuai0102 edited this page Oct 1, 2012 · 4 revisions
  • A theme.json is required for a theme of wanna blog system.

    An example theme.json file 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.

  • layouts directory is required.

    You should put all the layouts or the so called templates in the layouts directory.

  • assets directory is required.

    This is the place to store your static files such as images, js andd css files.

  • components directory is required.

    Common template file such as foot, header, sidebar file should be put here.

Clone this wiki locally