summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2021-05-26 09:39:23 +0200
committerVolpeon <git@volpeon.ink>2021-05-26 09:39:23 +0200
commit011e38d0175f69c8f902bfbc5676384f8b756eaf (patch)
tree09af9e014decf4e3cb487dcde226056fa8f4be14
parentFeed: Skip entries without last_update (diff)
downloadvolpeon.ink-011e38d0175f69c8f902bfbc5676384f8b756eaf.tar.gz
volpeon.ink-011e38d0175f69c8f902bfbc5676384f8b756eaf.tar.bz2
volpeon.ink-011e38d0175f69c8f902bfbc5676384f8b756eaf.zip
Include content in ATOM feeds
-rw-r--r--Makefile14
-rw-r--r--templates/feed.xml2
-rw-r--r--templates/feed_entry.xml5
3 files changed, 11 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index b4a58e8..b2fcd6c 100644
--- a/Makefile
+++ b/Makefile
@@ -56,21 +56,21 @@ subpages = $(patsubst content/%.md,.cache/meta/%.json, \
56 $(if $(PAGES_FILES),jq -s --arg namespace "$(NAMESPACE)" -f scripts/subpages.jq $(PAGES_FILES) > "$@.pages",touch "$@.pages") 56 $(if $(PAGES_FILES),jq -s --arg namespace "$(NAMESPACE)" -f scripts/subpages.jq $(PAGES_FILES) > "$@.pages",touch "$@.pages")
57 pandoc \ 57 pandoc \
58 -f markdown-citations \ 58 -f markdown-citations \
59 -t plain \ 59 -t html5 \
60 --no-highlight \ 60 --no-highlight \
61 --template scripts/metadata_tpl.json \ 61 --template scripts/metadata_tpl.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 -o "$@" "$<" 65 -o "$@.meta" "$<"
66# pandoc \ 66 pandoc \
67 -f markdown-citations \ 67 -f markdown-citations \
68 -t markdown \ 68 -t html5 \
69 -o "$@.content" "$<" 69 -o "$@.content" "$<"
70# jq '. + { content: $$content }' --rawfile content "$@.content" "$@.meta" > "$@" 70 jq '. + { content: $$content }' --rawfile content "$@.content" "$@.meta" > "$@"
71 rm "$@.pages" 71 rm "$@.pages"
72# rm "$@.meta" 72 rm "$@.meta"
73# rm "$@.content" 73 rm "$@.content"
74 74
75out/%.html: content/%.md .cache/meta/%.json $(CONTENT_TEMPLATES_SRC) metadata/*.yaml filters/*.lua scripts/metadata_filter.lua out/style.css | out 75out/%.html: content/%.md .cache/meta/%.json $(CONTENT_TEMPLATES_SRC) metadata/*.yaml filters/*.lua scripts/metadata_filter.lua out/style.css | out
76 $(info [MARK] $< -> $@) 76 $(info [MARK] $< -> $@)
diff --git a/templates/feed.xml b/templates/feed.xml
index 458202a..738b1ec 100644
--- a/templates/feed.xml
+++ b/templates/feed.xml
@@ -1,6 +1,6 @@
1<?xml version="1.0" encoding="utf-8"?> 1<?xml version="1.0" encoding="utf-8"?>
2<feed xmlns="http://www.w3.org/2005/Atom"> 2<feed xmlns="http://www.w3.org/2005/Atom">
3 <title>$if(namespace.root.is_index)$$else$$title$ – $endif$$site.title$</title> 3 <title><![CDATA[$if(namespace.root.is_index)$$else$$title$ – $endif$$site.title$]]></title>
4 <link href="$url.full$" rel="self"/> 4 <link href="$url.full$" rel="self"/>
5 <link href="$page.url.abs$"/> 5 <link href="$page.url.abs$"/>
6 <updated>$last_update.rfc3339$</updated> 6 <updated>$last_update.rfc3339$</updated>
diff --git a/templates/feed_entry.xml b/templates/feed_entry.xml
index c9d8af5..1c0302c 100644
--- a/templates/feed_entry.xml
+++ b/templates/feed_entry.xml
@@ -1,9 +1,10 @@
1$if(it.last_update)$ 1$if(it.last_update)$
2 <entry> 2 <entry>
3 <id>$it.url.full$</id> 3 <id>$it.url.full$</id>
4 <title>$it.title$</title> 4 <title><![CDATA[$it.title$]]></title>
5 <link rel="alternate" href="$it.url.abs$"/> 5 <link href="$it.url.abs$"/>
6 <updated>$it.last_update.rfc3339$</updated> 6 <updated>$it.last_update.rfc3339$</updated>
7 <content type="html"><![CDATA[$it.content$]]></content>
7 $if(it.author)$ 8 $if(it.author)$
8 $for(it.author)$ 9 $for(it.author)$
9 <author> 10 <author>