X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=processor%2Fall.do;h=3d09097c48be7a4f2b511c404797dc9ccc1c4614;hb=HEAD;hp=73d01249d653473fcc5eb760364aec696fff6b46;hpb=6ee5e0e20b722b1d4e72dfa52a19ec684cb30410;p=redo-blog
diff --git a/processor/all.do b/processor/all.do
index 73d0124..3d09097 100644
--- a/processor/all.do
+++ b/processor/all.do
@@ -1,6 +1,10 @@
#!/bin/sh
-metadata_dir=.meta
+# Set up directories.
+metadata_dir=metadata
+public_dir=public
+cur_dir=$(pwd)
+mkdir -p "$public_dir"
# Remove target files for which no sources files can be found.
for file in "$metadata_dir"/*.intermediate; do
@@ -11,11 +15,11 @@ for file in "$metadata_dir"/*.intermediate; do
rm "$file"
fi
done
-for file in "$metadata_dir"/*.uuid; do
+for file in "$metadata_dir"/*.automatic_metadata; do
basename=$(basename "$file")
if test -f "$file" &&
- ! test -f "${basename%.uuid}.md" &&
- ! test -f "${basename%.uuid}.rst"; then
+ ! test -f "${basename%.automatic_metadata}.md" &&
+ ! test -f "${basename%.automatic_metadata}.rst"; then
rm "$file"
fi
done
@@ -32,15 +36,14 @@ done
for file in *.rst *.md; do
if test -f "$file"; then
redo-ifchange "${metadata_dir}/${file%.*}.intermediate"
- fi
-done
-for file in "$metadata_dir"/*.intermediate; do
- if test -f "$file"; then
- basename=$(basename "$file")
- redo-ifchange "${basename%.intermediate}.html"
+ html_file=${file%.*}.html
+ redo-ifchange "$html_file"
+ ln -sf "$cur_dir/$html_file" "${public_dir}/"
fi
done
# Regenerate feed and index pages. Always.
-redo "feed.xml"
-redo "index.html"
+redo feed.xml
+ln -sf "$cur_dir"/feed.xml "${public_dir}/"
+redo index.html
+ln -sf "$cur_dir"/index.html "${public_dir}/"