Releases: robinmetral/brut
v0.0.36
What's Changed
- Add support for custom unified plugins by @robinmetral in #39
Full Changelog: v0.0.35...v0.0.36
v0.0.35
What's Changed
- Add permalinks and allow creating custom web feeds by @robinmetral in #38
Full Changelog: v0.0.34...v0.0.35
v0.0.34
What's Changed
- Pass collection context to mustache by @robinmetral in #34
Full Changelog: v0.0.33...v0.0.34
v0.0.33
Allow missing or empty partials and templates directories
This release is a minor fix to v0.0.32 that allows a partials or a templates directory to missing or left empty, without failing the build.
Full Changelog: v0.0.32...v0.0.33
v0.0.32
Partials
This release exposes mustache partials, making it easier to compose templates without repeating sections such as site navigation or footer.
To start using partials, add a file to the /partials
directory at your project root. The files will be picked up by brut and handed over to mustache at build time. This directory can be configured by setting a partialsDir
in brut.config.js
.
To reference a partial on a page, use its filename without the extension:
/partials/nav.html
👉{{ > nav }}
/partials/footer.whatever
👉{{ > footer }}
/partials/whatever/navitem.html
👉{{ > navitem }}
Templates breaking change
Previously, template files could be located anywhere in a project, and simply had to be defined in frontmatter using their path from the project root:
/templates/base.html
👉template: /templates/base.html
/whatever/article.html
👉template: /whatever/article.html
Version 0.0.32 introduces a new templates folder. Add your templates to /templates
, and they will be picked up by brut at build time. The directory can be configured by setting a partialsDir
in brut.config.js
.
To define a template path in frontmatter, use its filename without the extension:
/templates/base.html
👉template: base
/templates/whatever/article.html
👉template: article
A major benefit of having templates in a predefined directory is that all templates can be loaded at once at the beginning of the build process, instead of loading them on the fly when a template path was encountered in frontmatter. This reduces the number of filesystem operations and has significant build performance benefits.
Changelog
- Expose mustache partials by @robinmetral in #33
Full Changelog: v0.0.31...v0.0.32
v0.0.31
What's Changed
- Remove TypeScript by @robinmetral in #29. See #22 for rationale. This should not have changed anything.
- Fix 404 by @robinmetral in #30. This fixes the Cloudflare Pages-specific issue. See #20 for more context and a vendor-agnostic follow-up.
Full Changelog: v0.0.30...v0.0.31
v0.0.30
What changed
-
Custom build scripts for pages now receive the page's relative path as a third parameter:
export async function buildPage( html: string, frontmatter: { [key: string]: string }, + path: string, ): Promise<string> { /* do something with the html */ return html; }
-
Bumped
minimist
to v1.2.6 to address CVE-2021-44906