home · contact · privacy
Add captcha files support.
[redo-blog] / processor / default.html.do
index 8937ce8ed1bbd9077472efbb535877160a645846..ba163e2e29f32369cd2075f5d282cd6b46879326 100644 (file)
@@ -10,6 +10,7 @@ prep_url() {
 # Pull in global dependencies.
 . ./helpers.sh
 metadata_dir=metadata
+captchas_dir=captchas
 meta_file="${metadata_dir}/${1%.html}.automatic_metadata"
 redo-ifchange "$meta_file"
 intermediate_file="${metadata_dir}/${1%.html}.intermediate"
@@ -21,6 +22,9 @@ redo-ifchange "$article_tmpl_file"
 linkback_tmpl_file="${metadata_dir}"/linkback.tmpl
 redo-ifchange "$linkback_tmpl_file"
 replies_file="${1%.html}.links"
+redo-ifchange "$replies_file"
+captcha_file="$captchas_dir/${1%.html}"
+redo-ifchange "$captcha_file"
 
 # Build entry data.
 blog_title=$(read_and_escape_file "$title_file" | head -1 | prep_sed)
@@ -33,9 +37,7 @@ datetime_created_unix=$(get_creation_date_from_meta_file_seconds "$meta_file")
 date_created=$(date -u "+%Y-%m-%d" -d "@${datetime_created_unix}")
 datetime_lastmod_unix=$(get_lastmod_date_from_meta_file "$meta_file")
 date_updated=$(date -u "+%Y-%m-%d" -d "@${datetime_lastmod_unix}")
-if test -f "$replies_file"; then
-  replies=$(while read line; do prep_url "$line"; done < "$replies_file")
-fi
+replies=$(while read line; do prep_url "$line"; done < "$replies_file")
 
 # Put data into template.
 template=$(cat "$article_tmpl_file")