diff options
author | Jonas Smedegaard <dr@jones.dk> | 2019-11-02 21:07:14 +0100 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2019-11-02 21:07:14 +0100 |
commit | 82db9d928f13073932d7f035a19da933fcc5d9fa (patch) | |
tree | 41fc384d52c9b381bfd3173e27b259138e71dcc2 /Makefile | |
parent | 0d6f39f58f912add8448541cff118d750cc3beb8 (diff) |
Process mustache templating.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 28 |
1 files changed, 22 insertions, 6 deletions
@@ -1,4 +1,20 @@ -# Depends: myrepos git mkdocs linkchecker +# Depends: myrepos git mkdocs linkchecker libtext-hogan-perl + +domain ?= example.org +shellhost ?= shell.$(domain) +githost ?= source.$(domain) +gitshellhost ?= $(shellhost) +matrixhost ?= matrix.$(domain) +organisation ?= Example orga +contact_sysadmins ?= contact sysadmins + +MUSTACHE = cat source/source/USE.md | perl -MText::Hogan::Compiler -0777 -nE '\ + my $$compiler = Text::Hogan::Compiler->new;\ + my $$template = $$compiler->compile($$_);\ + say $$template->render({ \ + domain => "$(domain)", shellhost => "$(shellhost)", githost => "$(githost)", gitshellhost => "$(gitshellhost)", \ + matrixhost => "$(matrixhost)", \ + organisation => "$(organisation)", contact_sysadmins => "$(contact_sysadmins)" })' all: doc @@ -14,15 +30,15 @@ docs: docs/%: source mkdir -p docs/$* - ln -sf $(shell realpath --relative-to=$@ source/$(subst /,-,$*)/README.md) docs/$*/index.md + $(MUSTACHE) < source/$(subst /,-,$*)/README.md > docs/$*/index.md $(if $(wildcard source/$(subst /,-,$*)/USE.md),\ - ln -sf $(shell realpath --relative-to=$@ source/$(subst /,-,$*)/USE.md) docs/$*/use.md) + $(MUSTACHE) < source/$(subst /,-,$*)/USE.md > docs/$*/use.md) $(if $(wildcard source/$(subst /,-,$*)/ADMIN.md),\ - ln -sf $(shell realpath --relative-to=$@ source/$(subst /,-,$*)/ADMIN.md) docs/$*/admin.md) + $(MUSTACHE) < source/$(subst /,-,$*)/ADMIN.md > docs/$*/admin.md) $(if $(wildcard source/$(subst /,-,$*)/SETUP.md),\ - ln -sf $(shell realpath --relative-to=$@ source/$(subst /,-,$*)/SETUP.md) docs/$*/setup.md) + $(MUSTACHE) < source/$(subst /,-,$*)/SETUP.md > docs/$*/setup.md) $(if $(wildcard source/$(subst /,-,$*)/DEVELOP.md),\ - ln -sf $(shell realpath --relative-to=$@ source/$(subst /,-,$*)/DEVELOP.md) docs/$*/devel.md) + $(MUSTACHE) < source/$(subst /,-,$*)/DEVELOP.md > docs/$*/devel.md) init: mr update |