home
·
contact
·
privacy
projects
/
redo-blog
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add feed link to body of index template.
[redo-blog]
/
processor
/
default.html.do
diff --git
a/processor/default.html.do
b/processor/default.html.do
index 99d784df28884f9816f08305099b04cc3338211e..c9bfbdb9eb160e59d383127c87f5a941b4afe14d 100644
(file)
--- a/
processor/default.html.do
+++ b/
processor/default.html.do
@@
-3,6
+3,8
@@
# Pull in global dependencies.
. ./helpers.sh
metadata_dir=metadata
# 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
intermediate_file="${metadata_dir}/${1%.html}.intermediate"
redo-ifchange "$intermediate_file"
title_file="${metadata_dir}"/title
@@
-17,6
+19,9
@@
title_plaintext=`echo "$title_html" | html2text`
title_html=$(printf "%s" "$title_html" | prep_sed)
title_plaintext=$(escape_html "$title_plaintext" | prep_sed)
body=$(cat "$intermediate_file" | sed 1d | prep_sed)
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}")
# Put data into template.
template=$(cat "$template_file")
# Put data into template.
template=$(cat "$template_file")
@@
-24,5
+29,7
@@
printf "%s" "$template" | \
sed 's/%BLOG_TITLE%/'"$blog_title"'/g' | \
sed 's/%ARTICLE_TITLE_ESCAPED%/'"$title_plaintext"'/g' | \
sed 's/%ARTICLE_TITLE_HTML%/'"$title_html"'/g' | \
sed 's/%BLOG_TITLE%/'"$blog_title"'/g' | \
sed 's/%ARTICLE_TITLE_ESCAPED%/'"$title_plaintext"'/g' | \
sed 's/%ARTICLE_TITLE_HTML%/'"$title_html"'/g' | \
+sed 's/%DATETIME_CREATED_RFC3339%/'"$datetime_created_rfc3339"'/g' | \
+sed 's/%DATETIME_CREATED_FRIENDLY%/'"$datetime_created_friendly"'/g' | \
sed 's/%BODY%/'"$body"'/g' | \
tr '\a' '%'
sed 's/%BODY%/'"$body"'/g' | \
tr '\a' '%'