This commit is contained in:
jonnybravo
2026-09-08 11:02:29 +02:00
commit 3ad8c9b5a6
66 changed files with 6169 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
#!/bin/sh
# Auto-Frontmatter für Hugo 0.165+
# Fügt fehlenden --- Titel-Block in .md-Dateien ein.
CONTENT_DIR="/src/content"
for md in "$CONTENT_DIR"/*.md; do
[ -f "$md" ] || continue
first_line=$(head -1 "$md")
if [ "$first_line" != "---" ]; then
title=$(grep -m1 '^# ' "$md" | sed 's/^# //')
[ -z "$title" ] && title=$(basename "$md" .md)
date=$(date -r "$md" +%Y-%m-%d 2>/dev/null || date +%Y-%m-%d)
tmp="${md}.tmp"
{
echo "---"
echo "title: \"$title\""
echo "date: \"$date\""
echo "---"
echo
cat "$md"
} > "$tmp" && mv "$tmp" "$md"
echo "[frontmatter] $title"
fi
done
exec hugo server \
--watch \
--bind=0.0.0.0 \
--port=1313 \
--disableFastRender \
--baseURL=https://localhost:5443/ \
--renderStaticToDisk