X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/calendar?a=blobdiff_plain;f=processor%2Fdefault.html.do;h=99d784df28884f9816f08305099b04cc3338211e;hb=cc2d161a6ef0700f6d08fd5c63314834a7264c28;hp=99be4638584ecc9b3cb6294c662b602c8ee02be0;hpb=c67421732e148c768cc83395c143480b2b9b6106;p=redo-blog diff --git a/processor/default.html.do b/processor/default.html.do index 99be463..99d784d 100644 --- a/processor/default.html.do +++ b/processor/default.html.do @@ -1,28 +1,28 @@ #!/bin/sh # Pull in global dependencies. -metadata_dir=.meta -. "$metadata_dir"/helpers.sh +. ./helpers.sh +metadata_dir=metadata intermediate_file="${metadata_dir}/${1%.html}.intermediate" +redo-ifchange "$intermediate_file" title_file="${metadata_dir}"/title redo-ifchange "$title_file" -redo-ifchange "$intermediate_file" +template_file="${metadata_dir}"/article.tmpl +redo-ifchange "$template_file" # Build entry data. -blog_title=`read_and_escape_file "$title_file" | head -1` -title_html=`cat "$intermediate_file" | head -1` +blog_title=$(read_and_escape_file "$title_file" | head -1 | prep_sed) +title_html=$(cat "$intermediate_file" | head -1) title_plaintext=`echo "$title_html" | html2text` -title_plaintext_escaped=`escape_html "$title_plaintext"` -body=`cat "$intermediate_file" | sed 1d` - -# Write first part of entry head. -cat << EOF - - -
-EOF +title_html=$(printf "%s" "$title_html" | prep_sed) +title_plaintext=$(escape_html "$title_plaintext" | prep_sed) +body=$(cat "$intermediate_file" | sed 1d | prep_sed) -# Write remaining entry head and body. -printf "