From: Christian Heller Date: Thu, 26 Jan 2017 00:27:04 +0000 (+0100) Subject: Add page URL title template field. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Btodo.comment%7D%7D?a=commitdiff_plain;h=b75f33f8facf41eaae0699811ebe7595ed582c14;p=redo-blog Add page URL title template field. --- diff --git a/processor/default.html.do b/processor/default.html.do index 8e88dbb..f0d43a3 100644 --- a/processor/default.html.do +++ b/processor/default.html.do @@ -33,6 +33,7 @@ title_html=$(cat "$intermediate_file" | head -1) title_plaintext=`echo "$title_html" | html2text` title_html=$(printf "%s" "$title_html" | prep_sed) title_plaintext=$(escape_html "$title_plaintext" | prep_sed) +title_url=$(escape_html "${1%.html}" | prep_sed) body=$(cat "$intermediate_file" | sed 1d | prep_sed) datetime_created_unix=$(get_creation_date_from_meta_file_seconds "$meta_file") date_created=$(date -u "+%Y-%m-%d" -d "@${datetime_created_unix}") @@ -52,4 +53,5 @@ sed 's/%DATE_UPDATED%/'"$date_updated"'/g' | \ sed 's/%BODY%/'"$body"'/g' | \ sed 's/%LINKBACKS%/'"$replies"'/g' | \ sed 's/%CAPTCHA%/'"$captcha"'/g' | \ +sed 's/%TITLE_URL%/'"$title_url"'/g' | \ tr '\a' '%' diff --git a/processor/metadata/article.tmpl.do b/processor/metadata/article.tmpl.do index 406878c..ea81ede 100644 --- a/processor/metadata/article.tmpl.do +++ b/processor/metadata/article.tmpl.do @@ -27,6 +27,7 @@ Links back: Captcha: %CAPTCHA% +Title in URL: %TITLE_URL% EOF diff --git a/test/test_files/bar baz.html.ignoring b/test/test_files/bar baz.html.ignoring index 76598b5..bf4a6c9 100644 --- a/test/test_files/bar baz.html.ignoring +++ b/test/test_files/bar baz.html.ignoring @@ -26,5 +26,6 @@ Links back: Captcha: apple +Title in URL: bar baz \ No newline at end of file diff --git a/test/test_files/foo.html.ignoring b/test/test_files/foo.html.ignoring index bc19030..cfbd635 100644 --- a/test/test_files/foo.html.ignoring +++ b/test/test_files/foo.html.ignoring @@ -29,5 +29,6 @@ Links back:
  • http://example.com/some$()wh%20at'da"ngerusURL
  • Captcha: apple +Title in URL: foo \ 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 55cc1de..0392137 100644 --- a/test/test_files/te"st.html.ignoring +++ b/test/test_files/te"st.html.ignoring @@ -25,5 +25,6 @@ Links back: Captcha: apple +Title in URL: te"st \ No newline at end of file