Theme supported features
Since Publii v.0.37.0 it is possible to define which features are supported by your themes.
It requires a new section in the theme.config.json
file - supportedFeatures
, below you can see all possible options:
"supportedFeatures": {
"authorImages": true,
"authorPages": true,
"blockEditor": true,
"customComments": true,
"customSearch": true,
"errorPage": true,
"embedConsents": true,
"searchPage": true,
"tagImages": true,
"tagPages": true,
"tagsList": true,
"customThemeOptionsCss": true,
"pages": true,
"postsPage": true
}
These options are used to inform a user about features which can be used (or not) in the used theme. It can be really useful if you need to create a very simple theme which is used for example to create one-page layout - then you can disable most of these features:
- authorImages - theme supports cover images for the authors
- authorPages - theme has support for the author.hbs file
- blockEditor - theme has support for the blocks used in the block editor
- customComments - theme has support for
{{{@customCommentsCode}}}
- customSearch - theme has support for
{{{@customSearchInput}}}
or/and{{{@customSearchContent}}}
- errorPage - theme has support for the error page
- searchPage - theme has support for the search page
- embedConsents - theme supports user consent handling for 3rd party iframes (theme must handle CSS styling of new elements)
- tagImages - theme has support for the featured images of tags
- tagPages - theme has support for the tag.hbs file
- tagsList - theme has support for the tags.hbs file
- customThemeOptionsCss - this option lets you add a theme-options.css file with extra custom CSS options that affect the theme settings interface in Publii, not the theme’s appearance itself. This gives theme developers a way to offer users more ways to customize the look and feel of the theme settings interface in Publii, making it easier and more enjoyable to set up theme options.
- pages - theme has support for the page.hbs file
Please do not confuse these options with renderer settings in the theme. Renderer options can be used to disable some features of the theme, but supported features suggests what can be used at all. For example - if theme has tagsList support, you can still disable generating this page under renderer settings in the theme.config.json
.
The same situation applies e.g. for the authorPages and tagPages - if you disable createTagPages or createAuthorPages under renderer settings - these pages won't be created.