diff options
author | Volpeon <git@volpeon.ink> | 2021-12-17 17:47:08 +0100 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2021-12-17 17:47:08 +0100 |
commit | 03a7b5de1c97bf36bf454d7d3f718e128c19289a (patch) | |
tree | cd8b0eb772691932ade0828d5edd5a0b0a6ca41e | |
parent | Fix subpage content (diff) | |
download | volpeon.ink-03a7b5de1c97bf36bf454d7d3f718e128c19289a.tar.gz volpeon.ink-03a7b5de1c97bf36bf454d7d3f718e128c19289a.tar.bz2 volpeon.ink-03a7b5de1c97bf36bf454d7d3f718e128c19289a.zip |
Fix subpage content for real
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | scripts/subpages.lua | 2 |
2 files changed, 5 insertions, 2 deletions
@@ -62,13 +62,16 @@ subpages = $(patsubst content/%.md,.cache/meta/%.json, \ | |||
62 | --metadata namespace="$(NAMESPACE)" \ | 62 | --metadata namespace="$(NAMESPACE)" \ |
63 | --metadata file_out="$(patsubst .cache/meta/%.json,out/%.html,$@)" \ | 63 | --metadata file_out="$(patsubst .cache/meta/%.json,out/%.html,$@)" \ |
64 | --metadata-file "$@.pages" \ | 64 | --metadata-file "$@.pages" \ |
65 | $(PANDOC_FILTERS) \ | ||
65 | -o "$@.meta" "$<" | 66 | -o "$@.meta" "$<" |
66 | pandoc \ | 67 | pandoc \ |
67 | -f markdown-citations \ | 68 | -f markdown-citations \ |
68 | -t html5 \ | 69 | -t html5 \ |
70 | --lua-filter scripts/metadata_filter.lua \ | ||
69 | --lua-filter scripts/subpages.lua \ | 71 | --lua-filter scripts/subpages.lua \ |
70 | $(GLOBAL_METADATA) \ | 72 | $(GLOBAL_METADATA) \ |
71 | --metadata namespace="$(NAMESPACE)" \ | 73 | --metadata-file "$@.meta" \ |
74 | --metadata file_out="$@" \ | ||
72 | $(PANDOC_FILTERS) \ | 75 | $(PANDOC_FILTERS) \ |
73 | -o "$@.content" "$<" | 76 | -o "$@.content" "$<" |
74 | jq '. + { content: $$content }' --rawfile content "$@.content" "$@.meta" > "$@" | 77 | jq '. + { content: $$content }' --rawfile content "$@.content" "$@.meta" > "$@" |
diff --git a/scripts/subpages.lua b/scripts/subpages.lua index d77759d..b753b1e 100644 --- a/scripts/subpages.lua +++ b/scripts/subpages.lua | |||
@@ -4,7 +4,7 @@ local namespace = '' | |||
4 | local siteUrl = '' | 4 | local siteUrl = '' |
5 | 5 | ||
6 | function meta(meta) | 6 | function meta(meta) |
7 | namespace = pandoc.utils.stringify(meta.namespace) | 7 | namespace = pandoc.utils.stringify(meta.namespace.full) |
8 | siteUrl = pandoc.utils.stringify(meta.site.url):gsub("/$", "") | 8 | siteUrl = pandoc.utils.stringify(meta.site.url):gsub("/$", "") |
9 | end | 9 | end |
10 | 10 | ||