Tools for working with Frontmatter
- Front Matter | Hugo
- Front Matter Manipulator - A utility for parsing and manipulating documents with Front Matter. Get the fields, values for any collection of documents. Bulk update, delete, or rename fields.
- Python Frontmatter - see also: How to parse frontmatter with python
- karlredman/EditFrontMatter
- Batch edit front matter with Jinja2 templates for
python3
. - khalednassar/obyde - A minimal tool to convert a “standardly” configured Obsidian vault to a Jekyll-based blog.
- Batch markdown edits anyone? - HUGO
- dworthen/js-yaml-front-matter - Parses yaml or json from the beginning of a string or file
- Script to add a page level variable to content front matter in Hugo
Scripts
- hugo preproc - file pre-processor for Hugo
- Script - Front Matter Add Aliases from Slug - add aliases variable to each file’s front matter from slug variable value
- Note normalization for Zettelkasten - Note normalization. Add YAML Front Matter/UIDs and rename files, replace Wikilinks with Markdown links, etc.
- Hexoer - python script to add front matter (hexo)
Convert Hugo directory from YAML <–> TOML
hugo convert toYAML --output content_as_yaml
Shell script to prepend frontmatter from template
This script finds markdown files, then prepends YAML front matter following the template from prepend.sh
.
## For each result of find call our script to run on the filename
$ find . -name "*.md" -print0 | xargs -0 -I file ./prepend.sh file
## Given a file path as an argument
## 1. get the file name
## 2. prepend template string to the top of the source file
## 3. resave original source file
filepath="$1"
file_name=$(basename $filepath)
## Getting the file name (title)
md='.md'
title=${file_name%$md}
## Prepend front-matter to files
TEMPLATE="---
layout: page
title: $title
category: gen
---
"
echo "$TEMPLATE" | cat - "$filepath" > temp && mv temp "$filepath"