@eclecticpassions/indiekit-preset-hugo
v1.0.8
Published
Custom Hugo publication preset for Indiekit
Maintainers
Readme
Indiekit Plugin: preset-hugo
Forked from @indiekit/preset-hugo.
Features
Output unquoted date front matter (i.e.
date,publishDate,lastmod), instead of quoted string values.For example:
date = 2026-07-13T15:29:23+08:00Instead of:
date = "2026-07-13T15:29:51+08:00"Ensure date value is a native JavaScript Date object before being stringified
Modify the properties object mapping within getFrontMatter
Rename Indiekit property name
categorytotagsand ensure single tags are also use arrays for consistency.For example:
tags = [ "tag1", "tag2" ] tags = [ "tag3" ]Instead of:
category = [ "tag1", "tag2" ] category = "tag3"
Install Custom Plugin
I personally wasn't able to use NPM's override feature to replace the existing Indiekit preset-hugo plugin, therefore:
- Remove existing:
npm remove @indiekit/preset-hugo - Install custom preset-hugo:
npm install github:eclecticpassions/indiekit-preset-hugoornpm install @eclecticpassions/indiekit-preset-hugo - Replace all existing configuration (e.g. in
indiekit.config.js) andpackage.json, from@indiekit/preset-hugoto@eclecticpassions/indiekit-preset-hugo
Pending
- Currently,
lib/post-template.jsis set up to convert dates to Asia/Hong_Kong time zone / UTC+8. I will add a config option in the future for others to set it in their Indiekit config file under the plugin settings.
Resources
Disclaimer
LLMs were used to help generate the JavaScript code. All non-code parts (i.e. README) is written by me. Please review code before using in your Indiekit setup.
See below for the README of the original Indiekit preset-hugo plugin.
Indiekit Publication Preset for Hugo
A Hugo publication preset for Indiekit.
Installation
npm install @indiekit/preset-hugo
Usage
Add @indiekit/preset-hugo to your list of plug-ins, specifying options as required:
{
"plugins": ["@indiekit/preset-hugo"],
"@indiekit/preset-hugo": {
"frontMatterFormat": "json"
}
}Options
| Option | Type | Description |
| :------------------ | :------- | :------------------------------------------------------------------------------------- |
| frontMatterFormat | string | Front matter format to use (json, toml or yaml). Optional, defaults to yaml. |
