You can then enter the directory and run redo there. This will generate article
.html files from all .md and .rst files, plus a ./index.html, and a ./feed.xml.
These files will be linked to symbolically in a directory ./public/. If you
-provide a file suffixed .links to basename of an article file, these links will
-be added as article-specific linkbacks to the .html file and the feed entry.
+provide or edit a file suffixed .links to basename of an article file, these
+links will be added as article-specific linkbacks to the .html file and the feed
+entry.
Some metadata files will also be generated below ./metadata/: For each article,
there will be generated a .automatic_metadata (to contain an article's UUID,
linkback_tmpl_file="${metadata_dir}"/linkback.tmpl
redo-ifchange "$linkback_tmpl_file"
replies_file="${1%.html}.links"
+redo-ifchange "$replies_file"
# Build entry data.
blog_title=$(read_and_escape_file "$title_file" | head -1 | prep_sed)
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")
--- /dev/null
+#!/bin/sh
+
+if [ ! -f "$1" ]; then
+ touch "$1"
+fi
intermediate_file="${1%.feed_snippet}.intermediate"
redo-ifchange "$intermediate_file"
replies_file="${src_file%.*}.links"
+redo-ifchange "$replies_file"
# Get variables, write entry.
html_file=$(escape_url "${1%.feed_snippet}.html")
published_unix=$(get_creation_date_from_meta_file_seconds "$meta_file")
published_rfc3339=$(date -u "+%Y-%m-%dT%TZ" -d "@${published_unix}")
body=$(read_and_escape_file "$intermediate_file" | sed 1d)
-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")
printf "<entry>\n"
printf "<title type=\"html\">%s</title>\n" "$title"
printf "<id>urn:uuid:%s</id>\n" "$uuid"