Publican v0.12.0 update
377 words, 2-minute read

Publican v0.12.0 was released on .
There should be no breaking changes but it may change how you approach organizing content and templates.
Virtual content data objects #
Previous versions of Publican permitted virtual content files that could be programmatically added, e.g.
publican.config.js
const content = `
---
title: Virtual post
description: My first virtual post
author: Craig Buckler
date: 2026-01-02
---
This is a virtual post!
`;
publican.addContent(
'article/virtual-post.md',
content
`);
The main drawback was you had to convert values to a string and place them into the front matter … only for Publican to convert them back again! This was cumbersome when reading JSON data from a Content Management System.
The .addContent() method in Publican v0.12.0 supports an optional property/value dataObject as the third parameter:
publican.addContent( <filename>, <content> [, <dataObject> ] );
For example:
publican.config.js
publican.addContent(
'article/virtual-post.md',
null,
{
title: 'My title',
description: 'My description',
content: 'This is the page content.'
date: new Date(), // now
tags: ['automatic', 'content'],
groups: 'virtual, content'
}
);
Note:
Unless it’s falsy, the
<content>parameter takes precedence over the data object’scontentproperty.Front matter values defined in the
<content>parameter take precedence over the data object’s properties.
Refer to the .addContent() method documentation.
Markdown templates #
Publican reads and outputs text files so you can create templates for HTML, XML, TXT, SVG, JSON, or any other text type. To build static web pages, you typically define HTML templates that pull in content.
Publican v0.12.0 supports templates in markdown format (with an .md extension) which Publican converts to HTML.
Refer to the templates documentation. Markdown format is also supported when adding virtual templates.
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.