all repos — hex @ 7df54b94e7da3695208a4b259b7c6744c49f3571

A tiny, minimalist, slightly-esoteric concatenative programming lannguage.

Implemented script to manage generate changelog.
h3rald h3rald@h3rald.com
Mon, 09 Dec 2024 15:59:38 +0100
commit

7df54b94e7da3695208a4b259b7c6744c49f3571

parent

62f3370435f3f45ba3633ca2b84d441374050be6

4 files changed, 55 insertions(+), 5 deletions(-)

jump to
A CHANGELOG.html

@@ -0,0 +1,13 @@

+<article> + <h2>Changelog</h2> + + <section> + <h3>v0.1.0 - TBD</h3> + + <p>Initial release.</p> + <ul> + <li>...</li> + </ul> +</section> + +</article>
A releases/0.1.0.html

@@ -0,0 +1,8 @@

+<section> + <h3>v0.1.0 - TBD</h3> + + <p>Initial release.</p> + <ul> + <li>...</li> + </ul> +</section>
M scripts/web.hexscripts/web.hex

@@ -4,6 +4,7 @@ "web/assets" "d-assets" :

"web/templates" "d-templates" : "web/contents" "d-contents" : "web/out" "d-out" : +"releases" "d-releases" : ; Get all files from a directory ("ls " swap cat run 0x1 get "\n" split) "ls" :

@@ -11,6 +12,7 @@

; Get relevant files d-contents ls . "contents" : d-assets ls . "assets" : +d-releases ls . "releases" : d-templates "/page.html" cat "t-page" : ; Convenience symbol for debugging

@@ -32,8 +34,33 @@ while

pt-content ) "process-tag" : +"" "releases-content" : +( + releases + ( + "id-release" : + ; Update releases-content + d-releases "/" id-release cat cat read releases-content swap cat "releases-content" : + ) + each +) "process-releases" : + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;; Generate CHANGELOG.html +"*** Updating CHANGELOG.html..." puts +process-releases . + +; Read changelog template and add generated release content +d-contents "/" "changelog.html" cat cat read +"releases" releases-content process-tag . + +; Write CHANGELOG.html +"CHANGELOG.html" write +"*** Done!" puts + +;;;;; Write web site contents "*** Generating hex web site..." puts -; Write contents contents ( "fn-content" :

@@ -45,9 +72,13 @@ "content" content process-tag .

"title" id-content process-tag . "release" meta-release process-tag . "year" meta-year process-tag . + "releases" releases-content process-tag . "new-content" : (fn-content "home.html" ==) - (d-out "/index.html" cat "dst-file" :) + ( + ; Process home page + d-out "/index.html" cat "dst-file" : + ) ( ("sh -c \"mkdir -p " d-out "/" id-content "\"") () map "" join exec (d-out id-content "index.html") () map "/" join "dst-file" :
M web/contents/changelog.htmlweb/contents/changelog.html

@@ -1,7 +1,5 @@

<article> <h2>Changelog</h2> - <blockquote> - <p>Under construction.</p> - </blockquote> + {{releases}} </article>