commit ac05de0d4e6ceabeab1d9124f2a9f741c034f490
parent 226d41c2e3db03e06c40b694ea895005e07affab
Author: Yuval Langer <yuval.langer@gmail.com>
Date: Thu, 4 Jan 2024 10:43:40 +0200
Add a Haunt callback footer and copyright footers.
Diffstat:
M | haunt.scm | | | 102 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------- |
M | kakafarm/index.scm | | | 155 | +++++++++++++++++++++++++++++++++++++------------------------------------------ |
2 files changed, 150 insertions(+), 107 deletions(-)
diff --git a/haunt.scm b/haunt.scm
@@ -24,6 +24,16 @@
(define (pp attribute record)
(pretty-print (list attribute (attribute record))))
+(define site-title-prefix "💩 Kaka Farm! 💩")
+
+(define haunt-footer
+ '(p "Built with "
+ (a (@ (href "https://dthompson.us/projects/haunt.html"))
+ "David Thompson's Haunt")
+ "! Find more related sites at "
+ (a (@ (href "https://awesome.haunt.page/"))
+ "Awesome Haunt") "!"))
+
(define (make-favicon-asset)
(make-asset "assets/logo.png" "/favicon.ico"))
@@ -43,43 +53,81 @@
(let ((five-last-posts (take (posts/reverse-chronological posts)
(min (length posts)
5))))
- `((doctype "html")
- (html (head (meta (@ (charset "UTF-8")))
- (link (@ (rel "stylesheet")
- (type "text/css")
- (href "/assets/index.css")))
- (title "Kaka Farm's Haunt site! D:<"))
- (body (h1 "Kakafarm's Haunt")
- (p (a (@ (href "/haunt/posts/"))
- "posts"))
- (p (a (@ (href "/haunt/feed.xml"))
- "atom feed"))
- #;
- ((h2 "Latest posts:")
- (div (@ (class "latest-posts"))
- (ul ,(map post->sxml-link five-last-posts)))))))))
-
-(define* (page-builder destination make-sxml)
+ `(div (h1 "Kakafarm's Haunt")
+ (p (a (@ (href "/haunt/posts/"))
+ "posts"))
+ (p (a (@ (href "/haunt/feed.xml"))
+ "atom feed"))
+ #;
+ ((h2 "Latest posts:")
+ (div (@ (class "latest-posts"))
+ (ul ,(map post->sxml-link five-last-posts)))))))
+
+(define* (page-builder #:key destination make-sxml theme)
(lambda (site posts)
(serialized-artifact
destination
- (make-sxml #:posts posts)
+ ((theme-layout theme) "" site-title-prefix (make-sxml #:posts posts))
sxml->html)))
-(define (blog-theme-layout a-site a-page-title-string an-sxml-tree)
+(define creative-commons-copyright-notice
+ '(p (@ (xmlns:cc "http://creativecommons.org/ns#")
+ (xmlns:dct "http://purl.org/dc/terms/"))
+ (a (@ (property "dct:title")
+ (rel "cc:attributionURL")
+ (href "https://kaka.farm/"))
+ "Kaka Farm")
+ " by "
+ (a (@ (rel "cc:attributionURL dct:creator")
+ (property "cc:attributionName")
+ (href "https://kaka.farm/"))
+ "Yuval Langer")
+ " is licensed under "
+ (a (@ (href "http://creativecommons.org/licenses/by-sa/4.0/?ref=chooser-v1")
+ (target "_blank")
+ (rel "license noopener noreferrer")
+ (style "display:inline-block;"))
+ " Attribution-ShareAlike 4.0 International "
+ (img (@ (style "height:22px!important;margin-left:3px;vertical-align:text-bottom;")
+ (src "https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1")))
+ (img (@ (style "height:22px!important;margin-left:3px;vertical-align:text-bottom;")
+ (src "https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1")))
+ (img (@ (style "height:22px!important;margin-left:3px;vertical-align:text-bottom;")
+ (src "https://mirrors.creativecommons.org/presskit/icons/sa.svg?ref=chooser-v1"))))))
+
+(define (blog-layout a-site a-page-title-string an-sxml-tree)
`((doctype "html")
(html (head (meta (@ (charset "UTF-8")))
(link (@ (rel "stylesheet")
(type "text/css")
(href "/assets/index.css")))
- (title "Kaka Farm's Haunt site! D:<"))
- (body ,an-sxml-tree))))
+ (title ,(string-append site-title-prefix
+ " -- "
+ a-page-title-string)))
+ (body ,an-sxml-tree
+ ,haunt-footer
+ ,creative-commons-copyright-notice))))
(define blog-theme
(theme #:name "blog-theme"
- #:layout blog-theme-layout))
+ #:layout blog-layout))
+
+(define (topsite-layout a-site a-page-title-string an-sxml-tree)
+ `((doctype "html")
+ (html (head (meta (@ (charset "UTF-8")))
+ (link (@ (rel "stylesheet")
+ (type "text/css")
+ (href "/assets/index.css")))
+ (title ,site-title-prefix))
+ (body ,an-sxml-tree
+ ,haunt-footer
+ ,creative-commons-copyright-notice))))
+
+(define topsite-theme
+ (theme #:name "topsite-theme"
+ #:layout topsite-layout))
-(site #:title "kaka.farm - Haunt site"
+(site #:title site-title-prefix
#:domain "kaka.farm"
#:default-metadata '((author . "Yuval Langer")
(email . "yuval.langer@gmail.com"))
@@ -87,8 +135,12 @@
sxml-reader)
#:builders (list (blog #:prefix "/haunt/posts"
#:theme blog-theme)
- (page-builder "/haunt/index.html" make-haunt-blog-index-sxml)
- (page-builder "/index.html" kakafarm:index:make-index-sxml)
+ (page-builder #:destination "/haunt/index.html"
+ #:make-sxml make-haunt-blog-index-sxml
+ #:theme blog-theme)
+ (page-builder #:destination "/index.html"
+ #:make-sxml kakafarm:index:make-index-sxml
+ #:theme topsite-theme)
(atom-feed #:file-name "/haunt/feed.xml"
#:blog-prefix "/haunt/posts")
(atom-feeds-by-tag #:prefix "/haunt/feeds"
diff --git a/kakafarm/index.scm b/kakafarm/index.scm
@@ -4,96 +4,87 @@
(begin
(define* (make-index-sxml #:key posts)
- `((doctype "html")
- (html
- (head
- (meta (@ (charset "UTF-8")))
- (link (@ (rel "stylesheet")
- (type "text/css")
- (href "/assets/index.css")))
- (title "💩 kaka farm 💩"))
- (body
- (div (@ (id "topmostdiv"))
- (h1 "Various stuff:")
- (h2 "Clipboard Speaker")
- (p "An accessibility tool that reads either what you mark with your mouse:"
- (dl
- (dt "Python")
+ `(div (@ (id "topmostdiv"))
+ (h1 "Various stuff:")
+ (h2 "Clipboard Speaker")
+ (p "An accessibility tool that reads either what you mark with your mouse:"
+ (dl
+ (dt "Python")
- (dd (pre "clipboard-speaker -p"))
+ (dd (pre "clipboard-speaker -p"))
- (dt "Guile>")
- (dd (pre "clipboard-speaker --clipboard-type=p")))
+ (dt "Guile>")
+ (dd (pre "clipboard-speaker --clipboard-type=p")))
- "Or the contents of your clipboard:"
+ "Or the contents of your clipboard:"
- (dl
- (dt "Python")
- (dd (pre "clipboard-speaker -b"))
- (dt "Guile")
- (dd (pre "clipboard-speaker --clipboard-type=b")))
+ (dl
+ (dt "Python")
+ (dd (pre "clipboard-speaker -b"))
+ (dt "Guile")
+ (dd (pre "clipboard-speaker --clipboard-type=b")))
- (a (@ (href "https://sr.ht/~kakafarm/clipboard-speaker/"))
- "Clipboard Speaker's Sourcehut repositories"))
- (h3 "Python Clipboard Speaker")
- (p "The original Python code:"
- (a (@ (href "https://git.sr.ht/~kakafarm/clipboard-speaker/"))
- "Python Clipboard Speaker's Sourcehut repository"))
- (h3 "Guile Clipboard Speaker")
- (p "Also rewritten it in Guile:"
- (a (@ (href "https://git.sr.ht/~kakafarm/clipboard-speaker/"))
- "Guile Clipboard Speaker's Sourcehut repository"))
+ (a (@ (href "https://sr.ht/~kakafarm/clipboard-speaker/"))
+ "Clipboard Speaker's Sourcehut repositories"))
+ (h3 "Python Clipboard Speaker")
+ (p "The original Python code:"
+ (a (@ (href "https://git.sr.ht/~kakafarm/clipboard-speaker/"))
+ "Python Clipboard Speaker's Sourcehut repository"))
+ (h3 "Guile Clipboard Speaker")
+ (p "Also rewritten it in Guile:"
+ (a (@ (href "https://git.sr.ht/~kakafarm/clipboard-speaker/"))
+ "Guile Clipboard Speaker's Sourcehut repository"))
- (h2 "Rusty Diceware")
- (p
- (a (@ (href "https://github.com/yuvallanger/rusty-diceware/"))
- "A diceware tool in Rustlang."))
+ (h2 "Rusty Diceware")
+ (p
+ (a (@ (href "https://github.com/yuvallanger/rusty-diceware/"))
+ "A diceware tool in Rustlang."))
- (h2 "Blog")
- (ul
- (li (a (@ (href "//kaka.farm/blog/"))
- "blog-ish"))
- (li (a (@ (href "//kaka.farm/haunt/"))
- "A Haunt blog! Maybe I will migrate everything into Haunt and SXML?")))
+ (h2 "Blog")
+ (ul
+ (li (a (@ (href "//kaka.farm/blog/"))
+ "blog-ish"))
+ (li (a (@ (href "//kaka.farm/haunt/"))
+ "A Haunt blog! Maybe I will migrate everything into Haunt and SXML?")))
- (h2 "Commonly Forgotten")
- (a (@ (href "//kaka.farm/~commonly-forgotten/")) "Commonly Forgotten")
- " "
- "has some terribly written notes (which I should consolidate into Haunt)."
+ (h2 "Commonly Forgotten")
+ (a (@ (href "//kaka.farm/~commonly-forgotten/")) "Commonly Forgotten")
+ " "
+ "has some terribly written notes (which I should consolidate into Haunt)."
- (h2 "Git repository repositories")
- (p (ul (li "The static site generator"
- (a (@ (href "https://codemadness.org/stagit.html"))
- "Stagit")
- "("
- (a (@ (href "https://codemadness.org/git/stagit/file/README.html"))
- "README")
- ") was used to generate"
- (a (@ (href "/stagit/"))
- "my copies of some of my git repositories")
- ".")
- (li (a (@ (href "//sr.ht/~kakafarm/")) "Sourcehut"))
- (li (a (@ (href "//gitgud.io/yuvallanger/")) "GitGud profile"))
- (li (a (@ (href "//gitlab.com/yuvallanger/")) "GitLab profile"))
- (li (a (@ (href "//github.com/yuvallanger/")) "GitHub profile"))))
+ (h2 "Git repository repositories")
+ (p (ul (li "The static site generator"
+ (a (@ (href "https://codemadness.org/stagit.html"))
+ "Stagit")
+ "("
+ (a (@ (href "https://codemadness.org/git/stagit/file/README.html"))
+ "README")
+ ") was used to generate"
+ (a (@ (href "/stagit/"))
+ "my copies of some of my git repositories")
+ ".")
+ (li (a (@ (href "//sr.ht/~kakafarm/")) "Sourcehut"))
+ (li (a (@ (href "//gitgud.io/yuvallanger/")) "GitGud profile"))
+ (li (a (@ (href "//gitlab.com/yuvallanger/")) "GitLab profile"))
+ (li (a (@ (href "//github.com/yuvallanger/")) "GitHub profile"))))
- (h2 "org-roam notes")
- (p
- "Splitting your org-roam notes into"
- (a (@ (href "/private-org-roam-notes/")) "private")
- " "
- "and"
- " "
- (a (@ (href "/org-roam-notes/"))
- "public")
- " "
- "notes is a pain in the arse. Luckily for me I love"
- " "
- (a (@ (href "//en.wikipedia.org/wiki/Pita"))
- "."))
+ (h2 "org-roam notes")
+ (p
+ "Splitting your org-roam notes into"
+ (a (@ (href "/private-org-roam-notes/")) "private")
+ " "
+ "and"
+ " "
+ (a (@ (href "/org-roam-notes/"))
+ "public")
+ " "
+ "notes is a pain in the arse. Luckily for me I love"
+ " "
+ (a (@ (href "//en.wikipedia.org/wiki/Pita"))
+ "."))
- (h2 "Contact(?)")
- (ul
- (li (a (@ (href "https://emacs.ch/@kakafarm"))
- "@kakafarm@emacs.ch")
- ".")))))))))
+ (h2 "Contact(?)")
+ (ul
+ (li (a (@ (href "https://emacs.ch/@kakafarm"))
+ "@kakafarm@emacs.ch")
+ "."))))))