From 011e38d0175f69c8f902bfbc5676384f8b756eaf Mon Sep 17 00:00:00 2001
From: Volpeon <git@volpeon.ink>
Date: Wed, 26 May 2021 09:39:23 +0200
Subject: Include content in ATOM feeds

---
 Makefile                 | 14 +++++++-------
 templates/feed.xml       |  2 +-
 templates/feed_entry.xml |  5 +++--
 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, \
 	$(if $(PAGES_FILES),jq -s --arg namespace "$(NAMESPACE)" -f scripts/subpages.jq $(PAGES_FILES) > "$@.pages",touch "$@.pages")
 	pandoc \
 		-f markdown-citations \
-		-t plain \
+		-t html5 \
 		--no-highlight \
 		--template scripts/metadata_tpl.json \
 		--metadata namespace="$(NAMESPACE)" \
 		--metadata file_out="$(patsubst .cache/meta/%.json,out/%.html,$@)" \
 		--metadata-file "$@.pages" \
-		-o "$@" "$<"
-#	pandoc \
+		-o "$@.meta" "$<"
+	pandoc \
 		-f markdown-citations \
-		-t markdown \
+		-t html5 \
 		-o "$@.content" "$<"
-#	jq '. + { content: $$content }' --rawfile content "$@.content" "$@.meta" > "$@"
+	jq '. + { content: $$content }' --rawfile content "$@.content" "$@.meta" > "$@"
 	rm "$@.pages"
-#	rm "$@.meta"
-#	rm "$@.content"
+	rm "$@.meta"
+	rm "$@.content"
 
 out/%.html: content/%.md .cache/meta/%.json $(CONTENT_TEMPLATES_SRC) metadata/*.yaml filters/*.lua scripts/metadata_filter.lua out/style.css | out
 	$(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 @@
 <?xml version="1.0" encoding="utf-8"?>
 <feed xmlns="http://www.w3.org/2005/Atom">
-    <title>$if(namespace.root.is_index)$$else$$title$ – $endif$$site.title$</title>
+    <title><![CDATA[$if(namespace.root.is_index)$$else$$title$ – $endif$$site.title$]]></title>
     <link href="$url.full$" rel="self"/>
     <link href="$page.url.abs$"/>
     <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 @@
 $if(it.last_update)$
     <entry>
         <id>$it.url.full$</id>
-        <title>$it.title$</title>
-        <link rel="alternate" href="$it.url.abs$"/>
+        <title><![CDATA[$it.title$]]></title>
+        <link href="$it.url.abs$"/>
         <updated>$it.last_update.rfc3339$</updated>
+        <content type="html"><![CDATA[$it.content$]]></content>
         $if(it.author)$
             $for(it.author)$
                 <author>
-- 
cgit v1.2.3-70-g09d2