fix: add workflow step to escape nested quotes in post titles
All checks were successful
Hugo Publish CI / build-and-deploy (push) Successful in 17s

This commit is contained in:
2026-01-02 22:47:58 -08:00
parent 11c9ca021c
commit 89dc118ecd

View File

@@ -23,6 +23,14 @@ jobs:
submodules: true # Fetch Hugo themes (true OR recursive) submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Fix nested quotes in post titles
run: |
# Find markdown files with titles containing at least 3 double quotes (indicating nesting)
# and replace internal double quotes with single quotes.
find content -type f -name "*.md" -print0 | \
xargs -0 grep -lZ '^title: .*".*".*"' | \
xargs -0 -r sed -i "/^title: \"/{s/\"/\\\\\"/g;s/^\(title: *\)\\\\\"/\1\"/;s/\\\\\" *$/\"/;}"
- name: Build site with Hugo - name: Build site with Hugo
uses: peaceiris/actions-hugo@v3 uses: peaceiris/actions-hugo@v3
with: with: