Publican v0.11.0 update
470 words, 3-minute read

Publican v0.11.0 was released on .
There should be no breaking changes unless you’ve used a custom groups: value in front matter. This is now a Publican value that controls post groups.
Post groups #
You can organise pages into arbitrary groups based on any factor, e.g. featured posts, years, authors, etc. You can add any post to a group by:
setting a
groups:front matter value, e.g.groups: featured, ordefining a
filterfunction in your Publican configuration file.
The following example creates a latest group with all posts dated within the past 28 days in reverse chronological order:
publican.config.js excerpt
publican.config.groupPages = {
sortBy: 'date',
sortOrder: -1,
list: {
'latest': {
filter: data => data.date >= new Date(Date.now() - 28 * 24 * 60 * 60 * 1000)
}
}
};
You can list grouped posts in any template:
${ tacs.group.get('latest').map(
p => `<p><a href="${ p.link }">${ p.title }</a></p>`
) }
You can also generate paged index pages by adding a root path and optional size, template, and index values:
publican.config.js excerpt
publican.config.groupPages = {
sortBy: 'date',
sortOrder: -1,
size: 12,
template: 'list.html',
index: 'monthly',
list: {
'latest': {
filter: data => data.date >= new Date(Date.now() - 28 * 24 * 60 * 60 * 1000),
root: 'latest'
}
}
};
If there were 30 latest posts, an index size of 12 creates:
latest/index.htmlshows posts 1 to 12latest/1/index.htmlshows posts 13 to 24latest/2/index.htmlshows posts 25 to 30
For more information, refer to Publican group indexes.
Minor fixes #
Version 0.11.0 fixes the following issues:
Watch mode works on Windows
Previous versions would not re-render in native Windows installations (not in WSL).
Set
publican.config.nav = falseif you’re not using thetacs.navobject. This should make rendering a little faster.No need for empty content or template directories
Previous versions required empty directories even when using virtual files alone.
Improved error reporting.
Get started #
The Publican documentation provides a quick start guide, a detailed set-up guide, API references, and common recipes you can use and adapt for your own projects.