Improved feed generation.
h3rald h3rald@h3rald.com
Sun, 05 May 2024 10:49:49 +0200
2 files changed,
20 insertions(+),
5 deletions(-)
M
min.nimble
→
min.nimble
@@ -1,11 +1,13 @@
# Package -version = "0.44.0" author = "Fabio Cevasco" +version = "0.44.0" +author = "Fabio Cevasco" description = "A small but practical concatenative programming language and shell." license = "MIT" bin = @["min"] installExt = @["nim", "c", "h", "a"] installFiles = @["min.yml", "min.nim", "prelude.min", "help.json"] +skipFiles = @["mintool.min"] installDirs = @["minpkg"] # Dependencies
M
site/rules.min
→
site/rules.min
@@ -31,6 +31,22 @@ @result
) ) :: + +( + symbol convert-html-entities + (str :content ==> str :result) + ( + content "&[^;]+;" + ( + 0 get :entity + (("<" ">" "&" "'" """) entity in? not) + (entity xentity xentity2utf8 @entity) + when + entity + ) replace-apply @result + ) +) :: + ;Processing operators ( symbol process-md-with-template@@ -52,7 +68,7 @@ ; 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) + (temp dup /contents convert-html-entities %fragment posts append @posts) when temp )@@ -200,9 +216,6 @@ "mmm" swap mustache %contents output-fwrite
"Generating news page..." notice! ; Get news -;contents -; (:content ((content 'content-type dhas?) (content /content-type "post" ==)) &&) -;filter posts (:a :b a /date b /date >) sort @posts