From: Christian Heller Date: Thu, 22 Dec 2016 19:13:03 +0000 (+0100) Subject: Simplify HTML file link path determination. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%7B%7B%20web_path%20%7D%7D/static/%7Broute%7D?a=commitdiff_plain;h=2b95ae7640d3037ae89380f0a388ae27bfda200f;p=redo-blog Simplify HTML file link path determination. --- diff --git a/processor/metadata/default.feed_snippet.do b/processor/metadata/default.feed_snippet.do index b09eaa0..3321ac4 100644 --- a/processor/metadata/default.feed_snippet.do +++ b/processor/metadata/default.feed_snippet.do @@ -9,8 +9,7 @@ intermediate_file="${1%.feed_snippet}.intermediate" redo-ifchange "$intermediate_file" # Get variables, write entry. -html_file=`escape_url "${src_file%.*}.html"` -html_file=${html_file#*/} +html_file=$(escape_url "${1%.feed_snippet}.html") lastmod=`stat -c%y "$src_file"` lastmod_rfc3339=`date -u "+%Y-%m-%dT%TZ" -d "$lastmod"` published=`stat -c%y "$uuid_file"` diff --git a/processor/metadata/default.index_snippet.do b/processor/metadata/default.index_snippet.do index d95b27b..e332350 100644 --- a/processor/metadata/default.index_snippet.do +++ b/processor/metadata/default.index_snippet.do @@ -9,6 +9,6 @@ html_file="${src_file%.*}.html" redo-ifchange "$html_file" # Get variables, write entry. -title_html=`cat "$intermediate_file" | head -1` -html_file_escaped=`escape_url "${html_file#*/}"` +title_html=$(cat "$intermediate_file" | head -1) +html_file_escaped=$(escape_url "${1%.index_snippet}.html") printf "
  • %s
  • \n" "$html_file_escaped" "$title_html"