X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=default.html.do;fp=default.html.do;h=3ff413230f8babfdd13d5ab3569f741327abd435;hb=58272f437f554daa14ac1dfdf9902d48c17841bf;hp=0000000000000000000000000000000000000000;hpb=41db49b35f4622e7caa7aecd9b814d8a760fc259;p=redo-blog diff --git a/default.html.do b/default.html.do new file mode 100644 index 0000000..3ff4132 --- /dev/null +++ b/default.html.do @@ -0,0 +1,27 @@ +#!/bin/sh + +# Pull in global dependencies. +. ./helpers.sh +intermediate_file="${1%.html}.intermediate" +redo-ifchange title +redo-ifchange "$intermediate_file" + +# Build entry data. +blog_title=`read_and_escape_file title | head -1` +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 + +# Write remaining entry head and body. +printf "%s – %s\n\n\n" "$blog_title" "$title_plaintext_escaped" +#printf "%s – %s\n\n\n" "$blog_title" "$entry_title" +printf "

%s

\n" "$title_html" +printf "
\n%s\n
\n\n" "$body"