diff options
Diffstat (limited to 'v2/dynamic.mk')
-rw-r--r-- | v2/dynamic.mk | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/v2/dynamic.mk b/v2/dynamic.mk index b8fbba3..06d9bbf 100644 --- a/v2/dynamic.mk +++ b/v2/dynamic.mk @@ -44,13 +44,19 @@ clean: src/content/*/*/*.sortdata src/content/**/feeds/ \ -public: $(derived-assets) copy-content.sentinel copy-code-snippets.sentinel +public: $(derived-assets) symlink-mappings.sentinel copy-content.sentinel copy-code-snippets.sentinel content = \ $(all-generated.html) \ $(all-generated.xml) \ $(static-content) \ +symlink-mappings.sentinel: src/redirect.mappings content-mkdir.sentinel + < src/redirect.mappings \ + awk '{ printf "ln -rfs public/%s public/%s\n", $$2, $$1 }' | \ + sh + touch $@ + copy-content.sentinel: $(content) content-mkdir.sentinel echo $? | tr ' ' '\n' | grep '^src/content/' | sed 's|^src/content/||' | \ xargs -P`nproc` -I% ln -f src/content/% public/% @@ -62,8 +68,9 @@ copy-code-snippets.sentinel: $(all-generated.snippets) content-mkdir.sentinel xargs -P`nproc` -I% ln -f src/content/% public/% touch $@ -content-mkdir.sentinel: $(content) $(all-generated.snippets) +content-mkdir.sentinel: $(content) $(all-generated.snippets) src/redirect.mappings echo $? | tr ' ' '\n' | grep '^src/content/' | sed 's|^src/content/||' | \ + printf '%s\n%s\n' "`cat -`" "`awk '{print $$2}' src/redirect.mappings`" | \ xargs dirname | \ sort | \ uniq | \ |