diff options
-rw-r--r-- | v2/dynamic.mk | 11 | ||||
-rw-r--r-- | v2/src/redirect.mappings | 1 |
2 files changed, 10 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 | \ diff --git a/v2/src/redirect.mappings b/v2/src/redirect.mappings new file mode 100644 index 0000000..6945e89 --- /dev/null +++ b/v2/src/redirect.mappings @@ -0,0 +1 @@ +index.html en/index.html |