kaka.farm

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 282a2967fbc1ba58004d73d85d3023ab650355d1
parent 21e105ce8d759f243da9931d7b3c57e7d6f67266
Author: Yuval Langer <yuval.langer@gmail.com>
Date:   Mon,  8 Jan 2024 09:51:02 +0200

Add json-page-builder and use to generate `contribute.json`.

Diffstat:
Mentr | 2+-
Mhaunt.scm | 28++++++++++++++++++++++++++--
2 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/entr b/entr @@ -1,3 +1,3 @@ #!/bin/sh -find haunt.scm kakafarm posts assets images | guix shell entr -- entr -s 'haunt build' +find haunt.scm kakafarm posts assets images root | guix shell -p haunt-profile -C --pure -- entr -s 'haunt build' diff --git a/haunt.scm b/haunt.scm @@ -5,17 +5,20 @@ (sxml simple) - (haunt asset) (haunt artifact) + (haunt asset) (haunt builder assets) (haunt builder atom) (haunt builder blog) (haunt html) + (haunt page) (haunt post) (haunt reader commonmark) (haunt reader) (haunt site) + (json) + (prefix (kakafarm index) kakafarm:index:) (prefix (kakafarm software clipboard-speaker) kakafarm:software:clipboard-speaker:) (prefix (kakafarm software diceware) kakafarm:software:diceware:) @@ -76,9 +79,19 @@ (lambda (site posts) (serialized-artifact destination - ((theme-layout theme) "" site-title-prefix (make-sxml #:posts posts)) + ((theme-layout theme) + "" + site-title-prefix + (make-sxml #:posts posts)) sxml->html))) +(define* (json-page-builder #:key destination make-scm) + (lambda (site posts) + (make-page + destination + (make-scm) + scm->json))) + (define creative-commons-copyright-notice '(p (@ (xmlns:cc "http://creativecommons.org/ns#") (xmlns:dct "http://purl.org/dc/terms/")) @@ -140,6 +153,15 @@ (theme #:name "topsite-theme" #:layout topsite-layout)) +(define (make-contribute.json-scm) + '((name . "Kaka Farm") + (description . "Personal site.") + (repository . ((url . "https://codeberg.org/kakafarm/kaka.farm/") + (license . "AGPLv3+"))) + (keywords . #(guile haunt)) + (irc . "irc://irc.libera.chat/#kakafarm") + (irc-contacts . #(cow_2001)))) + (site #:title site-title-prefix #:domain "kaka.farm" #:default-metadata '((author . "Yuval Langer") @@ -163,6 +185,8 @@ (page-builder #:destination "/software/clipboard-speaker.html" #:make-sxml kakafarm:software:clipboard-speaker:make-sxml #:theme topsite-theme) + (json-page-builder #:destination "/contribute.json" + #:make-scm make-contribute.json-scm) (atom-feed #:file-name "/haunt/feed.xml" #:blog-prefix "/haunt/posts") (atom-feeds-by-tag #:prefix "/haunt/feeds"