all repos — min @ 1f3459e6ae4404c214f95697b178c0900d264e6c

A small but practical concatenative programming language.

Improved feed generation.
h3rald h3rald@h3rald.com
Sun, 05 May 2024 10:49:49 +0200
commit

1f3459e6ae4404c214f95697b178c0900d264e6c

parent

1dcfc447fd65cabb7a060c745a1642ff64d79c4a

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

jump to
M min.nimblemin.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.minsite/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