From: Christian Heller Date: Wed, 25 Jan 2017 02:10:03 +0000 (+0100) Subject: Add captcha placeholder to templating. X-Git-Url: https://plomlompom.com/repos/processes?a=commitdiff_plain;h=db7d3a5afde411f072f7d8b3f809b1906f4910de;p=redo-blog Add captcha placeholder to templating. --- diff --git a/processor/default.html.do b/processor/default.html.do index ba163e2..196713c 100644 --- a/processor/default.html.do +++ b/processor/default.html.do @@ -38,6 +38,7 @@ date_created=$(date -u "+%Y-%m-%d" -d "@${datetime_created_unix}") datetime_lastmod_unix=$(get_lastmod_date_from_meta_file "$meta_file") date_updated=$(date -u "+%Y-%m-%d" -d "@${datetime_lastmod_unix}") replies=$(while read line; do prep_url "$line"; done < "$replies_file") +captcha=$(escape_html "$(cat "$captcha_file" | sed -n 2p)" | prep_sed) # Put data into template. template=$(cat "$article_tmpl_file") @@ -49,4 +50,5 @@ sed 's/%DATE_CREATED%/'"$date_created"'/g' | \ sed 's/%DATE_UPDATED%/'"$date_updated"'/g' | \ sed 's/%BODY%/'"$body"'/g' | \ sed 's/%LINKBACKS%/'"$replies"'/g' | \ +sed 's/%CAPTCHA%/'"$captcha"'/g' | \ tr '\a' '%' diff --git a/processor/metadata/article.tmpl.do b/processor/metadata/article.tmpl.do index f24106a..406878c 100644 --- a/processor/metadata/article.tmpl.do +++ b/processor/metadata/article.tmpl.do @@ -26,6 +26,7 @@ header p { margin: 0; } Links back: +Captcha: %CAPTCHA% EOF diff --git a/test/test_files/bar baz.html.ignoring b/test/test_files/bar baz.html.ignoring index 1c29f06..76598b5 100644 --- a/test/test_files/bar baz.html.ignoring +++ b/test/test_files/bar baz.html.ignoring @@ -25,5 +25,6 @@ header p { margin: 0; } Links back: +Captcha: apple \ No newline at end of file diff --git a/test/test_files/foo.html.ignoring b/test/test_files/foo.html.ignoring index 0af3900..bc19030 100644 --- a/test/test_files/foo.html.ignoring +++ b/test/test_files/foo.html.ignoring @@ -28,5 +28,6 @@ Links back:
  • http://example.org/
  • http://example.com/some$()wh%20at'da&quot;ngerusURL
  • +Captcha: apple \ No newline at end of file diff --git a/test/test_files/te"st.html.ignoring b/test/test_files/te"st.html.ignoring index d751b3b..55cc1de 100644 --- a/test/test_files/te"st.html.ignoring +++ b/test/test_files/te"st.html.ignoring @@ -24,5 +24,6 @@ header p { margin: 0; } Links back: +Captcha: apple \ No newline at end of file