Changing content

By Craig Buckler

509 words, 3-minute read

document
Image courtesy of Scott Graham

The following sub-directories define site content:

Examine these files to see how content is coded.

Content files #

The theme provides content files you can add, remove, or edit:

The menu navigation follows the directory name order, so 01_blog comes before 02_about. If you rename 02_about to 00_about, it would appear before the blog.

The NN_ value is removed from the path when creating a slug, so pages are rendered to blog and about directories in build.

Note:

Blog filenames #

Blog filenames define the date of the post in the format YYYY-MM-DD_post-title.md. The last file shown in the src/content/01_blog/ directory is therefore the most recent post.

The YYYY-MM-DD_ part of the filename is removed and used to set the blog date, so src/content/01_blog/2025-05-01_my-latest-post.md is rendered to build/blog/my-latest-post/index.html with a date of May 1, 2025.

Note that any post dated later than today is rendered in development mode but will not appear on the production site.

Front matter #

Front matter is contained between --- delimiters at the top of content files. These are name: value pairs which define meta data about the content that can be used in in templates.

---
title: Publican basic theme
menu: Home
description: This is a basic Publican theme you can adapt or use as-is.
template: home.html
priority: 1.0
index: weekly
tags: Publican, SSG, theme, jsTACS
---

The main content...

You can link to any page on the site using it’s absolute path, such as /about/.

However, the BUILD_ROOT directory can be set in the configuration so something other than / when your Publican site is hosted on a path of another site, such as /mysite/. The link to the About page is therefore /mysite/about/.

The root path can be inserted into any path using −−ROOT−− (defined as a string replacement in publican.config.js). You can therefore define links in markdown:

[About page](−−ROOT−−about/)

or HTML:

<a href="−−ROOT−−about/">About page</a>

and −−ROOT−− is replaced with the real root value when the site is built. Changing BUILD_ROOT will update all links in the site without manual editing.