all repos — min @ ce7be5c702e69ee1a654c4b70f6c06cfd0f0050c

A small but practical concatenative programming language.

Implemented RSS feed.
h3rald h3rald@h3rald.com
Sun, 04 Feb 2024 10:32:31 +0100
commit

ce7be5c702e69ee1a654c4b70f6c06cfd0f0050c

parent

e04257b67c420a49c33945e2e81d19e2a6242b95

2 files changed, 16 insertions(+), 5 deletions(-)

jump to
M site/rules.minsite/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.mustachesite/templates/rss.mustache

@@ -9,7 +9,7 @@ <item>

<title>{{title}}</title> <link>https://min-lang.org/{{id}}</link> <description> - {{{contents}}} + {{{fragment}}} </description> </item> {{/posts}}