home · contact · privacy
Move snippet generation for index/feed into separate .do files.
[redo-blog] / processor / default.index_snippet.do
diff --git a/processor/default.index_snippet.do b/processor/default.index_snippet.do
new file mode 100644 (file)
index 0000000..759a510
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Pull in dependencies.
+. ./helpers.sh
+src_file=$(get_source_file "$1")
+intermediate_file="${src_file%.*}.intermediate"
+redo-ifchange "$intermediate_file"
+html_file="${src_file%.*}.html"
+redo-ifchange "$html_file"
+
+# Get variables, write entry.
+title_html=`cat "$intermediate_file" | head -1`
+html_file_escaped=`escape_url "${html_file#\./}"`
+printf "<li><a href=\"%s\" />%s</a></li>\n" "$html_file_escaped" "$title_html"