Publican v0.9.0 update

By Craig Buckler

408 words, 3-minute read

root
Image courtesy of Brianna Lengacher

Publican v0.9.0 was released on .

There are no breaking changes, but the following features have been added.

Directory index pages #

In previous releases, directory index pages (the pages listing posts in a directory) had the data.index content property set false. Sitemaps would therefore omit pages such as: /docs/1/, /docs/2/, /docs/3/, etc.

A new publican.config.dirPages.index configuration property is now available which is set to monthly by default. Index pages will appear in sitemaps unless you explicitly set it to false.

Index page content properties #

Two new content properties are available:

  1. data.isDirIndex

    When a page is a directory index (listing pages in a directory), data.isDirIndex is set to the directory’s root page title. The directory name is used when that is not set.

  2. data.isTagIndex

    When a page is a tag index (listing pages with a specific tag), data.isDirIndex is set to the tag name.

The following example code uses data.isTagIndex to assign more descriptive titles and descriptions to tag index pages:

publican.config.js excerpt

// set tag index titles and descriptions
publican.config.processRenderStart.add(tacs => {

  tacs.all.forEach(p => {

    if (p.isTagIndex) {

      const posts = `post${ p.childPageTotal === 1 ? '' : 's' }`;

      p.title = `'${ p.isTagIndex }' ${ posts }`;
      p.description = `List of ${ p.childPageTotal } ${ posts } using the tag '${ p.isTagIndex }'.`;

    }
  });

});

New basic theme #

If you missed the v0.8.0 announcement, a new basic Publican theme is available at:

The theme is fast, standards based, and uses best practise techniques. It features pages, blog posts, tag indexes, a light/dark switcher, RSS feed, sitemaps, security, and a 100% Lighthouse score.

The theme uses Publican alone for rendering – there are no other dependencies. In development mode, it provides a livelocalhost server to automatically reload HTML and CSS when files change.

Please download and adapt the theme for your own purposes.