From 944a735c39a27fc86569c585f2805837b61adb60 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Tue, 2 Aug 2022 20:56:45 +0200 Subject: Slightly tidied up metadata handling --- Makefile | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index cfc583f..863fca1 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ static_files: $(STATIC_FILES) .SECONDEXPANSION: -namespace = $(patsubst %/index,%,$(patsubst %.json,%,$(patsubst $(2)%,%,$(1)))) +namespace = $(patsubst %/index,%,$(basename $(patsubst $(2)%,%,$(1)))) subpages = $(patsubst content/%.md,.cache/meta/%.json, \ $(shell test -d $(patsubst .cache/meta%,content%,$(1)) && find $(patsubst .cache/meta%,content%,$(1)) -maxdepth 1 -type f -name "*.md" ! -name "index.md") \ @@ -64,7 +64,6 @@ subpages = $(patsubst content/%.md,.cache/meta/%.json, \ --no-highlight \ --metadata-file "$@.pages" \ --template scripts/metadata.json \ - --metadata mode="$(MODE)" \ --metadata namespace="$(NAMESPACE)" \ --metadata file_out="$(patsubst .cache/meta/%.json,out/%.html,$@)" \ $(PANDOC_FILTERS) \ @@ -78,8 +77,8 @@ subpages = $(patsubst content/%.md,.cache/meta/%.json, \ --lua-filter scripts/subpages.lua \ $(GLOBAL_METADATA) \ --metadata-file "$@.meta" \ - --metadata mode="$(MODE)" \ - --metadata file_out="$@" \ + --metadata build.mode="$(MODE)" \ + --metadata build.file_out="$@" \ $(PANDOC_FILTERS) \ -o "$@.content" "$<" jq '. + { content: $$content }' --rawfile content "$@.content" "$@.meta" > "$@" @@ -102,9 +101,9 @@ out/%.html: content/%.md .cache/meta/%.json .cache/assets.json $(CONTENT_TEMPLAT --lua-filter scripts/metadata.lua \ $(GLOBAL_METADATA) \ --metadata-file .cache/assets.json \ - --metadata mode="$(MODE)" \ --metadata-file "$(filter .cache/meta/%.json,$^)" \ - --metadata file_out="$@" \ + --metadata build.mode="$(MODE)" \ + --metadata build.file_out="$@" \ $(PANDOC_FILTERS) \ -o "$@" "$<" @@ -121,8 +120,8 @@ out/%.xml: content/%.md .cache/meta/%.json $(FEED_TEMPLATES_SRC) metadata/*.yaml --lua-filter scripts/metadata.lua \ $(GLOBAL_METADATA) \ --metadata-file "$(filter .cache/meta/%.json,$^)" \ - --metadata mode="$(MODE)" \ - --metadata file_out="$@" \ + --metadata build.mode="$(MODE)" \ + --metadata build.file_out="$@" \ $(PANDOC_FILTERS) \ -o "$@" "$<" -- cgit v1.2.3-70-g09d2