Download

How to create custom templates?

Publii offers possibility to create custom templates for posts, pages, tags, and authors. To create a custom post template, follow these steps:

  1. Create a post-TEMPLATE_SLUG.hbs file,
  2. In the theme's config.json file, please add the following entry:

"postTemplates": {
   "TEMPLATE_SLUG": "Human readable template name"
}

WARNING! Please use lowercase slugs without any special and non-latin chars. Also, avoid using the DEFAULT slug as it is used exclusively for posts which are using the default post template from the post.hbs file.

If custom post templates are available, then a dropdown option will appear under the Advanced settings in the post editor.

Custom page templates

To create a custom page template, follow these steps:

  1. Create a page-TEMPLATE_SLUG.hbs file,
  2. Add the following entry to the theme's config.json file:

"pageTemplates": {
   "TEMPLATE_SLUG": "Human readable template name"
}

If custom page templates are available then the dropdown option will be activated in the page editor.

Custom author templates

To create a custom author template, follow these steps:

  1. Create a author-TEMPLATE_SLUG.hbs file,
  2. Add the following entry to the theme's config.json file:

"authorTemplates": {
   "TEMPLATE_SLUG": "Human readable template name"
}

If custom author templates are available then the dropdown option will be activated in the author add/edit form.

Custom tag templates

To create a custom post template, follow these steps:

  1. Create a tag-TEMPLATE_SLUG.hbs file,
  2. Add the following entry to the theme's config.json file:

"tagTemplates": {
   "TEMPLATE_SLUG": "Human readable template name"
}

If custom tag templates are available a dropdown option will be activated in the tag add/edit form.

What are you waiting for?

Start building your site today.

  1. 1 Download Publii
  2. 2 Write your content
  3. 3 Publish your site
Create website