Implemented RSS feed.
h3rald h3rald@h3rald.com
Sun, 04 Feb 2024 10:32:31 +0100
2 files changed,
16 insertions(+),
5 deletions(-)
M
site/rules.min
→
site/rules.min
@@ -4,6 +4,7 @@ 'hastysite import
'min-highlight import () :modules +() :posts ;Routing (@@ -46,6 +47,15 @@ :temp contents temp markdown
highlight-codeblocks highlight-codes @contents temp ) (contents %contents) + ( + ; Save post content (plain HTML fragment, no template) + :temp + (temp /content-type "post" ==) + ; Need to save html fragment separately because contents is overwritten. + (temp dup /contents %fragment posts append @posts) + when + temp + ) (:temp tpl temp mustache @page temp) (page %contents) ) tap @result@@ -190,11 +200,12 @@ "mmm" swap mustache %contents output-fwrite
"Generating news page..." notice! ; Get news -contents - (:content ((content 'content-type dhas?) (content /content-type "post" ==)) &&) -filter +;contents +; (:content ((content 'content-type dhas?) (content /content-type "post" ==)) &&) +;filter +posts (:a :b a /date b /date >) -sort :posts +sort @posts {} "news/index" %id
M
site/templates/rss.mustache
→
site/templates/rss.mustache
@@ -9,7 +9,7 @@ <item>
<title>{{title}}</title> <link>https://min-lang.org/{{id}}</link> <description> - {{{contents}}} + {{{fragment}}} </description> </item> {{/posts}}