diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 18 |
1 files changed, 11 insertions, 7 deletions
| @@ -50,13 +50,13 @@ subpages = $(patsubst content/%.md,.cache/meta/%.json, \ | |||
| 50 | $(shell test -d $(patsubst .cache/meta%,content%,$(1)) && find $(patsubst .cache/meta%,content%,$(1)) -maxdepth 1 -type f -name "*.md" ! -name "index.md") \ | 50 | $(shell test -d $(patsubst .cache/meta%,content%,$(1)) && find $(patsubst .cache/meta%,content%,$(1)) -maxdepth 1 -type f -name "*.md" ! -name "index.md") \ |
| 51 | $(shell test -d $(patsubst .cache/meta%,content%,$(1)) && find $(patsubst .cache/meta%,content%,$(1)) -mindepth 2 -maxdepth 2 -type f -name "index.md")) | 51 | $(shell test -d $(patsubst .cache/meta%,content%,$(1)) && find $(patsubst .cache/meta%,content%,$(1)) -mindepth 2 -maxdepth 2 -type f -name "index.md")) |
| 52 | 52 | ||
| 53 | .cache/meta/%.json: content/%.md $$(call subpages,$$(call namespace,$$@,)) filters/*.lua scripts/subpages.lua scripts/subpages.jq scripts/metadata.json | .cache/meta | 53 | .cache/meta/%.json: content/%.md $$(call subpages,$$(call namespace,$$@,)) filters/*.lua scripts/pages_content.lua scripts/subpages.jq scripts/metadata.json | .cache/meta |
| 54 | $(info [META] $< -> $@) | 54 | $(info [META] $< -> $@) |
| 55 | 55 | ||
| 56 | mkdir -p $(@D) | 56 | mkdir -p $(@D) |
| 57 | $(eval PAGES_FILES = $(filter .cache/meta/%.json,$^)) | 57 | $(eval PAGES_FILES = $(filter .cache/meta/%.json,$^)) |
| 58 | $(eval NAMESPACE = $(call namespace,$@,.cache/meta)) | 58 | $(eval NAMESPACE = $(call namespace,$@,.cache/meta)) |
| 59 | $(if $(PAGES_FILES),jq -s --arg namespace "$(NAMESPACE)" -f scripts/subpages.jq $(PAGES_FILES) > "$@.pages",echo "{}" > "$@.pages") | 59 | $(if $(PAGES_FILES),jq -s --arg namespace "$(NAMESPACE)" -f scripts/subpages.jq $(PAGES_FILES) > "$@.pages",echo "{ \"pages\": [] }" > "$@.pages") |
| 60 | pandoc \ | 60 | pandoc \ |
| 61 | -f markdown-citations-implicit_figures \ | 61 | -f markdown-citations-implicit_figures \ |
| 62 | -t html5 \ | 62 | -t html5 \ |
| @@ -65,7 +65,7 @@ subpages = $(patsubst content/%.md,.cache/meta/%.json, \ | |||
| 65 | --metadata-file "$@.pages" \ | 65 | --metadata-file "$@.pages" \ |
| 66 | --template scripts/metadata.json \ | 66 | --template scripts/metadata.json \ |
| 67 | --metadata namespace="$(NAMESPACE)" \ | 67 | --metadata namespace="$(NAMESPACE)" \ |
| 68 | --metadata file_out="$(patsubst .cache/meta/%.json,out/%.html,$@)" \ | 68 | --metadata file_out="$(patsubst .cache/meta/%.json,/%.html,$@)" \ |
| 69 | $(PANDOC_FILTERS) \ | 69 | $(PANDOC_FILTERS) \ |
| 70 | -o "$@.meta" "$<" | 70 | -o "$@.meta" "$<" |
| 71 | rm "$@.pages" | 71 | rm "$@.pages" |
| @@ -74,11 +74,11 @@ subpages = $(patsubst content/%.md,.cache/meta/%.json, \ | |||
| 74 | -t html5 \ | 74 | -t html5 \ |
| 75 | --wrap preserve \ | 75 | --wrap preserve \ |
| 76 | --lua-filter scripts/metadata.lua \ | 76 | --lua-filter scripts/metadata.lua \ |
| 77 | --lua-filter scripts/subpages.lua \ | 77 | --lua-filter scripts/pages_content.lua \ |
| 78 | $(GLOBAL_METADATA) \ | 78 | $(GLOBAL_METADATA) \ |
| 79 | --metadata-file "$@.meta" \ | 79 | --metadata-file "$@.meta" \ |
| 80 | --metadata build.mode="$(MODE)" \ | 80 | --metadata build.mode="$(MODE)" \ |
| 81 | --metadata build.file_out="$@" \ | 81 | --metadata build.file_out="$(patsubst .cache/meta/%.json,/%.html,$@)" \ |
| 82 | $(PANDOC_FILTERS) \ | 82 | $(PANDOC_FILTERS) \ |
| 83 | -o "$@.content" "$<" | 83 | -o "$@.content" "$<" |
| 84 | jq '. + { content: $$content }' --rawfile content "$@.content" "$@.meta" > "$@" | 84 | jq '. + { content: $$content }' --rawfile content "$@.content" "$@.meta" > "$@" |
| @@ -92,6 +92,7 @@ out/%.html: content/%.md .cache/meta/%.json .cache/assets.json $(CONTENT_TEMPLAT | |||
| 92 | $(info [MARK] $< -> $@) | 92 | $(info [MARK] $< -> $@) |
| 93 | 93 | ||
| 94 | mkdir -p $(@D) | 94 | mkdir -p $(@D) |
| 95 | $(eval NAMESPACE = $(call namespace,$@,.cache/meta)) | ||
| 95 | pandoc \ | 96 | pandoc \ |
| 96 | -f markdown-citations-implicit_figures \ | 97 | -f markdown-citations-implicit_figures \ |
| 97 | -t html5 \ | 98 | -t html5 \ |
| @@ -103,7 +104,8 @@ out/%.html: content/%.md .cache/meta/%.json .cache/assets.json $(CONTENT_TEMPLAT | |||
| 103 | --metadata-file .cache/assets.json \ | 104 | --metadata-file .cache/assets.json \ |
| 104 | --metadata-file "$(filter .cache/meta/%.json,$^)" \ | 105 | --metadata-file "$(filter .cache/meta/%.json,$^)" \ |
| 105 | --metadata build.mode="$(MODE)" \ | 106 | --metadata build.mode="$(MODE)" \ |
| 106 | --metadata build.file_out="$@" \ | 107 | --metadata build.namespace="$(NAMESPACE)" \ |
| 108 | --metadata build.file_out="$(patsubst out/%,/%,$@)" \ | ||
| 107 | $(PANDOC_FILTERS) \ | 109 | $(PANDOC_FILTERS) \ |
| 108 | -o "$@" "$<" | 110 | -o "$@" "$<" |
| 109 | 111 | ||
| @@ -111,6 +113,7 @@ out/%.xml: content/%.md .cache/meta/%.json $(FEED_TEMPLATES_SRC) metadata/*.yaml | |||
| 111 | $(info [FEED] $< -> $@) | 113 | $(info [FEED] $< -> $@) |
| 112 | 114 | ||
| 113 | mkdir -p $(@D) | 115 | mkdir -p $(@D) |
| 116 | $(eval NAMESPACE = $(call namespace,$@,.cache/meta)) | ||
| 114 | pandoc \ | 117 | pandoc \ |
| 115 | -f markdown-citations-implicit_figures \ | 118 | -f markdown-citations-implicit_figures \ |
| 116 | -t html5 \ | 119 | -t html5 \ |
| @@ -121,7 +124,8 @@ out/%.xml: content/%.md .cache/meta/%.json $(FEED_TEMPLATES_SRC) metadata/*.yaml | |||
| 121 | $(GLOBAL_METADATA) \ | 124 | $(GLOBAL_METADATA) \ |
| 122 | --metadata-file "$(filter .cache/meta/%.json,$^)" \ | 125 | --metadata-file "$(filter .cache/meta/%.json,$^)" \ |
| 123 | --metadata build.mode="$(MODE)" \ | 126 | --metadata build.mode="$(MODE)" \ |
| 124 | --metadata build.file_out="$@" \ | 127 | --metadata build.namespace="$(NAMESPACE)" \ |
| 128 | --metadata build.file_out="$(patsubst out/%,/%,$@)" \ | ||
| 125 | $(PANDOC_FILTERS) \ | 129 | $(PANDOC_FILTERS) \ |
| 126 | -o "$@" "$<" | 130 | -o "$@" "$<" |
| 127 | 131 | ||
