X-Git-Url: https://plomlompom.com/repos/condition_titles?a=blobdiff_plain;f=processor%2Fdefault.html.do;h=c9bfbdb9eb160e59d383127c87f5a941b4afe14d;hb=a54417011b4a49810333c990da2b123d3be20c26;hp=fcef3efe6b778e72d24f434afc6b51ca7c6d6325;hpb=b86576c5f61cff36c80c9e0efd9d77f50dac745b;p=redo-blog diff --git a/processor/default.html.do b/processor/default.html.do index fcef3ef..c9bfbdb 100644 --- a/processor/default.html.do +++ b/processor/default.html.do @@ -3,26 +3,33 @@ # Pull in global dependencies. . ./helpers.sh metadata_dir=metadata +uuid_file="${metadata_dir}/${1%.html}.uuid" +redo-ifchange "$uuid_file" 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) +datetime_created_unix=$(stat -c%y "${uuid_file}") +datetime_created_rfc3339=$(date -u "+%Y-%m-%dT%TZ" -d "${datetime_created_unix}") +datetime_created_friendly=$(date -u "+%Y-%m-%d %T (UTC)" -d "${datetime_created_unix}") -# Write remaining entry head and body. -printf "