Modules

In order to create a module, you will need to create a sub-directory under the ./site/modules directory. You may wish either to start from scratch or to use a template.

Using Module Template

You will need to copy the ./src/core/defaults/modules/blank directory to the ./site/modules directory. Then:

  • Rename the directory to match its contents (e.g. "test", ./site/modules/test)
  • Set module configuration in a ./site/modules/test/module.js (it's mandatory to set the unique page ID and route path)
  • Put the required contents to the ./site/modules/test/page/content/lang-xx-xx directories (matching your languages)
  • When necessary, add your page ID to the ./site/navigation.json file (see configuration files for more info)

Module Configuration

Each module is being configured using module.js file which located in module directory.

OptionDescription
idUnique ID of a module, used for routes and navigation
routes.userspaceObject of routes for userspace (e.g. { home: { path: "/home" } } )
routes.adminObject of routes for admin area (e.g. { home: { path: "/home" } } )

To change locale-specific options, you will need to edit the meta.src.json file located in every page's directory:

OptionDescription
titleObject containing page title for each language
descriptionObject containing page description for each language

Additionally, you may wish to tell Heretic build script to include a page into sitemap.xml file which is built automatically. To change sitemap options for each page, you will need to edit the sitemap.json file:

OptionDescription
includeInclude page into sitemap (true or false)
lastmodInclude last modified date into sitemap (true or false)
changefreqSet the change frequency (refer to sitemap format docs)
prioritySet the page priority (refer to sitemap format docs)