From 4ef490f3cb4bd875fa03bd63e46c9979b9a9e70b Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Mon, 14 Dec 2020 10:35:30 +0100 Subject: [PATCH] Avoid interpreting Liquid in doc pages They are auto-generated, so they wouldn't normally contain Liquid (The post-processor may insert some, but it has control over the `raw` tags) Some code introduced as examples contains `{{` due to nested brace expansions, which was interpreted as (invalid) Liquid. This fixes such problems. Additionally, Jekyll generates warnings about excerpts being part of a Liquid block (the `{% raw %}`). This is fine, since doc pages don't use excerpts. --- .github/actions/doc_postproc.awk | 8 ++++++++ .github/actions/get-pages.sh | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/actions/doc_postproc.awk b/.github/actions/doc_postproc.awk index c0244ce8..19f34bc3 100755 --- a/.github/actions/doc_postproc.awk +++ b/.github/actions/doc_postproc.awk @@ -7,6 +7,14 @@ sub(/b><\/td/, "th"); } +# The whole page is being generated, so it's not meant to contain any Liquid +BEGIN { + print "{% raw %}" +} +END { + print "{% endraw %}" +} + BEGIN { in_synopsis = 0 } diff --git a/.github/actions/get-pages.sh b/.github/actions/get-pages.sh index 209c1598..8e4ac714 100755 --- a/.github/actions/get-pages.sh +++ b/.github/actions/get-pages.sh @@ -64,7 +64,7 @@ stem="${page%.html}" manpage="${stem%.?}(${stem#*.})" descr="$(awk -v 'FS=.Nd ' '/.Nd/ { print $2; }' "${PAGES[$page]}")" - cat - >"$1/$2/$page" <"$1/$2/$page" <