diff --git a/.gitea/workflows/publish.yaml b/.gitea/workflows/publish.yaml index 2a37b5f..176842e 100644 --- a/.gitea/workflows/publish.yaml +++ b/.gitea/workflows/publish.yaml @@ -23,6 +23,14 @@ jobs: submodules: true # Fetch Hugo themes (true OR recursive) 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 uses: peaceiris/actions-hugo@v3 with: