make: update home page from wiki sidebar properly

This commit is contained in:
Simon Michael 2018-04-28 13:46:44 -07:00
parent 371ac23843
commit 6fa5c4d570

View File

@ -970,17 +970,18 @@ site-build: site/hakyll-std/hakyll-std site/manual.md \
$(call def-help,site-build, generate the hledger.org website with hakyll-std )
-cd site; hakyll-std/hakyll-std build
site/docs.md: wiki/_Sidebar.md \
$(call def-help,site/docs.md, update docs page with wiki sidebar content which should be in ./wiki/_Sidebar )
(sed -ne '1,/<!-- WIKICONTENT -->/ p' site/docs.md ; \
site/index.md: wiki/_Sidebar.md \
$(call def-help,site/index.md, update home page with wiki sidebar content which should be in ./wiki/_Sidebar )
(sed -ne '1,/<!-- WIKICONTENT -->/ p' site/index.md ; \
sed -ne '/^#.*User/,$$ p' wiki/_Sidebar.md \
| perl -p \
-e 's/\[\[([^\|]*)\|([^\]]*)\]\]/[\1](https:\/\/github.com\/simonmichael\/hledger\/wiki\/\2)/g;' \
-e 's/\[\[([^\]]*)\]\]/[\1](https:\/\/github.com\/simonmichael\/hledger\/wiki\/\1)/g;' \
-e 's/^# >/##/;' \
; \
sed -ne '/<!-- ENDWIKICONTENT -->/,$$ p' site/docs.md ) \
> site/_docs.md.$$$$ && \
mv site/_docs.md.$$$$ site/docs.md
sed -ne '/<!-- ENDWIKICONTENT -->/,$$ p' site/index.md ) \
> site/_index.md.$$$$ && \
mv site/_index.md.$$$$ site/index.md
site-clean: site/hakyll-std/hakyll-std \
$(call def-help,site-clean, remove hakyll-generated files (& take down the website) ) #cleanolddocs