diff options
| -rw-r--r-- | haunt.scm | 301 | ||||
| -rw-r--r-- | pages/about.md | 27 | ||||
| -rw-r--r-- | posts/2025-09-01-new-website.md | 19 |
3 files changed, 196 insertions, 151 deletions
diff --git a/haunt.scm b/haunt.scm index fa83675..6f29cba 100644 --- a/haunt.scm +++ b/haunt.scm @@ -14,156 +14,177 @@ ;;; along with this program. If not, see <https://www.gnu.org/licenses/>. (use-modules (haunt asset) - (haunt utils) - (haunt site) - (haunt post) - (haunt html) - (haunt page) - (haunt builder blog) - (haunt builder atom) - (haunt builder rss) - (haunt builder assets) - (haunt builder flat-pages) - (haunt reader commonmark) - (srfi srfi-19) - (ice-9 match) - (web uri)) + (haunt utils) + (haunt site) + (haunt post) + (haunt html) + (haunt page) + (haunt builder blog) + (haunt builder atom) + (haunt builder rss) + (haunt builder assets) + (haunt builder flat-pages) + (haunt reader commonmark) + (srfi srfi-19) + (ice-9 match) + (web uri)) ;; First paragraph extractor from David Thompson ;; https://git.dthompson.us/blog/tree/theme.scm (define (first-paragraph post) - (let loop ((sxml (post-sxml post))) - (match sxml - (() '()) - (((and paragraph ('p . _)) . _) - (list paragraph)) - ((head . tail) - (cons head (loop tail)))))) + (let loop ((sxml (post-sxml post))) + (match sxml + (() '()) + (((and paragraph ('p . _)) . _) + (list paragraph)) + ((head . tail) + (cons head (loop tail)))))) (define my-theme - (theme #:name "my-theme" - #:layout - (lambda (site title body) - `((doctype "html") - (html (@ (lang "en")) - (head - (meta (@ (charset "UTF-8"))) - (meta (@ (name "viewport") (content "width=device-width, initial-scale=1.0"))) - (title ,(string-append title " — " (site-title site))) - (link (@ (rel "stylesheet") (href "https://cdnjs.cloudflare.com/ajax/libs/modern-normalize/3.0.1/modern-normalize.min.css"))) - (link (@ (rel "stylesheet") (href "/css/style.css"))) - (link (@ (rel "stylesheet") (href "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/nnfx-dark.min.css") (media "(prefers-color-scheme: dark)"))) - (link (@ (rel "stylesheet") (href "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/nnfx-light.min.css") (media "(prefers-color-scheme: light)"))) - (script (@ (src "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js"))) - (script (@ (src "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/languages/scheme.min.js"))) - (link (@ (rel "icon") (type "image/png") (href "/images/icon-192.png") (sizes "192x192")))) - (body - (div (@ (class "wrapper")) - (header - (h1 (span (@ (class "lambda")) "λ") " " ,(site-title site)) - (ul - (li (a (@ (href "/index.html")) "Home")) - (li (a (@ (href "/about.html")) "About")) - (li (a (@ (href "https://git.marius.pm")) "Git ⤴")) - (li (a (@ (href "https://github.com/mariusly")) "GitHub ⤴")) - (li (a (@ (href "https://codeberg.org/mariusly")) "Codeberg ⤴")))) - (hr) - (main ,body) - (hr) - (footer - (a (@ (href "https://creativecommons.org/licenses/by-sa/4.0/") (class "cc")) - (img (@ (src "/images/cc.png") (alt "CC-BY-NC-SA-4.0")))) - (p "© 2025 marius.pm, Ramblings " - (a (@ (href "https://creativecommons.org/licenses/by-sa/4.0/")) "CC-BY-NC-SA-4.0") - ", " (a (@ (href "#")) "Source") " " - (a (@ (href "https://www.gnu.org/licenses/gpl-3.0.txt")) "GPL-3.0") ".") - (p "This website is built with " - (a (@ (href "https://dthompson.us/projects/haunt.html")) "Haunt") - ", a static site generator written in " - (a (@ (href "https://gnu.org/software/guile")) "Guile Scheme") ".") - (p (a (@ (href "feed.xml")) "feed.xml"))) - (script "hljs.highlightAll();")))))) - - #:post-template - (lambda (post) - `((article (@ (class "post")) - (div (@ (class "date")) - ,(date->string (post-date post) - "~B ~d, ~Y")) - - (h2 (@ (class "title")),(post-ref post 'title)) - - (ul (@ (class "tags")) ,@(map (lambda (tag) - `(li (@ (class "tag")) (a (@ (href ,(string-append "/feeds/tags/" - tag ".xml"))) - ,(string-append "#" tag)))) - (assq-ref (post-metadata post) 'tags))) - (div (@ (class "post")) - ,(post-sxml post))))) - - #:collection-template - (lambda (site title posts prefix) - (define (post-uri post) - (string-append prefix "/" (site-post-slug site post) ".html")) - - `(,(map (lambda (post) - (let ((uri (post-uri post))) - `(div (@ (class "post")) - (span (@ (class "date")) - ,(date->string (post-date post) - "~B ~d, ~Y")) - - (h2 (a (@ (href ,uri)) - ,(post-ref post 'title))) - - (p ,(first-paragraph post)) - - (div (@ (class "tags-container")) - - - (ul (@ (class "tags")) ,@(map (lambda (tag) - `(li (@ (class "tag")) (a (@ (href ,(string-append "/feeds/tags/" - tag ".xml"))) - ,(string-append "#" tag)))) - (assq-ref (post-metadata post) 'tags))) - - (a (@ (href ,uri) (class "read-more")) - , "Read More ›"))))) - posts))) - - #:pagination-template - (lambda (site body previous-page next-page) - `(,@body - (div - ,(if previous-page - `(a (@ (href ,previous-page)) - "Newer Posts ›") - '()) - ,(if next-page - `(a (@ (href ,next-page)) - "‹ Older Posts") - '())))))) + (theme #:name "my-theme" + #:layout + (lambda (site title body) + `((doctype "html") + (html (@ (lang "en")) + (head + (meta (@ (charset "UTF-8"))) + (meta (@ (name "viewport") (content "width=device-width, initial-scale=1.0"))) + (title ,(string-append title " — " (site-title site))) + (link (@ + (rel "stylesheet") + (href "https://cdnjs.cloudflare.com/ajax/libs/modern-normalize/3.0.1/modern-normalize.min.css"))) + (link (@ + (rel "stylesheet") + (href "/css/style.css"))) + (link (@ + (rel "stylesheet") + (href + "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/nnfx-dark.min.css") + (media "(prefers-color-scheme: dark)"))) + (link (@ + (rel "stylesheet") + (href + "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/nnfx-light.min.css") + (media "(prefers-color-scheme: light)"))) + (script (@ + (src "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js"))) + (script (@ + (src "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/languages/scheme.min.js"))) + (link (@ + (rel "icon") + (type "image/png") + (href "/images/icon-192.png") + (sizes "192x192")))) + (body + (div (@ (class "wrapper")) + (header + (h1 (span (@ (class "lambda")) "λ") " " ,(site-title site)) + (ul + (li (a (@ (href "/index.html")) "Home")) + (li (a (@ (href "/about.html")) "About")) + (li (a (@ (href "https://git.marius.pm")) "Git ⤴")) + (li (a (@ (href "https://github.com/mariusly")) "GitHub ⤴")) + (li (a (@ (href "https://codeberg.org/mariusly")) "Codeberg ⤴")))) + (hr) + (main ,body) + (hr) + (footer + (a (@ (href "https://creativecommons.org/licenses/by-sa/4.0/") (class "cc")) + (img (@ (src "/images/cc.png") (alt "CC-BY-NC-SA-4.0")))) + (p "© 2025 marius.pm, Ramblings " + (a (@ (href "https://creativecommons.org/licenses/by-sa/4.0/")) "CC-BY-NC-SA-4.0") + ", " (a (@ (href "#")) "Source") " " + (a (@ (href "https://www.gnu.org/licenses/gpl-3.0.txt")) "GPL-3.0") ".") + (p "This website is built with " + (a (@ (href "https://dthompson.us/projects/haunt.html")) "Haunt") + ", a static site generator written in " + (a (@ (href "https://gnu.org/software/guile")) "Guile Scheme") ".") + (p (a (@ (href "feed.xml")) "feed.xml"))) + (script "hljs.highlightAll();")))))) + + #:post-template + (lambda (post) + `((article (@ (class "post")) + (div (@ (class "date")) + ,(date->string (post-date post) + "~B ~d, ~Y")) + + (h2 (@ (class "title")),(post-ref post 'title)) + + (ul (@ (class "tags")) ,@(map (lambda (tag) + `(li (@ (class "tag")) + (a (@ (href ,(string-append "/feeds/tags/" + tag ".xml"))) + ,(string-append "#" tag)))) + (assq-ref (post-metadata post) 'tags))) + (div (@ (class "post")) + ,(post-sxml post))))) + + #:collection-template + (lambda (site title posts prefix) + (define (post-uri post) + (string-append prefix "/" (site-post-slug site post) ".html")) + + `(,(map (lambda (post) + (let ((uri (post-uri post))) + `(div (@ (class "post")) + (span (@ (class "date")) + ,(date->string (post-date post) + "~B ~d, ~Y")) + + (h2 (a (@ (href ,uri)) + ,(post-ref post 'title))) + + (p ,(first-paragraph post)) + + (div (@ (class "tags-container")) + + + (ul (@ (class "tags")) ,@(map (lambda (tag) + `(li (@ + (class "tag")) + (a (@ (href ,(string-append "/feeds/tags/" + tag ".xml"))) + ,(string-append "#" tag)))) + (assq-ref (post-metadata post) 'tags))) + + (a (@ (href ,uri) (class "read-more")) + , "Read More ›"))))) + posts))) + + #:pagination-template + (lambda (site body previous-page next-page) + `(,@body + (div + ,(if previous-page + `(a (@ (href ,previous-page)) + "Newer Posts ›") + '()) + ,(if next-page + `(a (@ (href ,next-page)) + "‹ Older Posts") + '())))))) (define post-prefix "/posts") (define collections - `(("Recent Posts" "index.html" ,posts/reverse-chronological))) + `(("Recent Posts" "index.html" ,posts/reverse-chronological))) (site #:title "marius.pm" - #:domain "marius.pm" - #:default-metadata - '((author . "marius") + #:domain "marius.pm" + #:default-metadata + '((author . "marius") (email . "mail@marius.pm")) - #:readers (list commonmark-reader) - #:builders (list (blog #:theme my-theme - #:collections collections - #:post-prefix post-prefix - #:posts-per-page 10) - (flat-pages "pages" - #:template (theme-layout my-theme)) - - (atom-feed #:blog-prefix post-prefix) - (atom-feeds-by-tag #:blog-prefix post-prefix) - - (static-directory "images") - (static-directory "css"))) + #:readers (list commonmark-reader) + #:builders (list (blog #:theme my-theme + #:collections collections + #:post-prefix post-prefix + #:posts-per-page 10) + (flat-pages "pages" + #:template (theme-layout my-theme)) + + (atom-feed #:blog-prefix post-prefix) + (atom-feeds-by-tag #:blog-prefix post-prefix) + + (static-directory "images") + (static-directory "css"))) diff --git a/pages/about.md b/pages/about.md index aac4c4b..f187e14 100644 --- a/pages/about.md +++ b/pages/about.md @@ -3,9 +3,13 @@ title: About # About -Hello, I'm Marius! Currently studying for my MSc in Informatics at the University of Oslo. I have a strong passion for programming and technology, and I enjoy exploring both the new and old. +Hello, I'm Marius! Currently studying for my MSc in Informatics at the +University of Oslo. I have a strong passion for programming and technology, and +I enjoy exploring both the new and old. -In my spare time, I spend an unhealthy amount of time constantly tweaking my [system](#). Outside of that, I thorougly enjoy reading, especially fantasy and related genres. Recently I also started dipping my toes into D&D. +In my spare time, I spend an unhealthy amount of time constantly tweaking my +[system](#). Outside of that, I thorougly enjoy reading, especially fantasy and +related genres. Recently I also started dipping my toes into D&D. ## Currently working on @@ -13,17 +17,24 @@ My thesis. ## Tools -**Vim**: .. or NeoVim depending on, was my primary editor for years. I still use it when in the terminal. +**Vim**: .. or NeoVim depending on, was my primary editor for years. I still +use it when in the terminal. -**Emacs**: My primary editor, I keep Zed (with FHS support) as backup in case I need some extension. +**Emacs**: My primary editor, I keep Zed (with FHS support) as backup in case I +need some extension. -**Fish**: The shell I use for interactive use, previously zsh but that is slow as dirt. I still do my scripting in bash. No fancy prompt for me though. All I need is git status and cwd. +**Fish**: The shell I use for interactive use, previously zsh but that is slow +as dirt. I still do my scripting in bash. No fancy prompt for me though. All I +need is git status and cwd. -**Ghostty**: Literally just a terminal emulator. Same old same old, but following system theme shouldn't be so hard. +**Ghostty**: Literally just a terminal emulator. Same old same old, but +following system theme shouldn't be so hard. -**NixOS**: Power of declarative. I love everything about this, except how flakes are still experimental. +**NixOS**: Power of declarative. I love everything about this, except how +flakes are still experimental. -**River**: Been on Wayland for a while now. It works great. River is my compositor of choice. I don't rice. +**River**: Been on Wayland for a while now. It works great. River is my +compositor of choice. I don't rice. ## Contact diff --git a/posts/2025-09-01-new-website.md b/posts/2025-09-01-new-website.md index f5af1dc..5f17220 100644 --- a/posts/2025-09-01-new-website.md +++ b/posts/2025-09-01-new-website.md @@ -3,10 +3,23 @@ date: 2025-09-01 13:46 tags: scheme, lisp --- -I thought it was about time I actually made something useful. So here it is. A website.. with posts! In all seriousness, it was quite interesting. Although this post is just here to have something here. +I thought it was about time I actually made something useful. So here it is. A +website.. with posts! In all seriousness, it was quite interesting. Although +this post is just here to have something here. -Static site generators have grown rather complicated. Far more complicated than I would ever need. Additionally, I would rather not have to relearn the damn thing every time I want to change the site. So I went looking for simple. Preferably written in a lisp-like language or a lisp dialect, because I thought that would be fun. After a little bit of searching, the choice was between [Haunt](https://dthompson.us/projects/haunt.html), written in [Guile Scheme](https://www.gnu.org/software/guile/), and [Bagatto](https://bagatto.co/), written in [Janet](https://janet-lang.org/). +Static site generators have grown rather complicated. Far more complicated than +I would ever need. Additionally, I would rather not have to relearn the damn +thing every time I want to change the site. So I went looking for simple. +Preferably written in a lisp-like language or a lisp dialect, because I thought +that would be fun. After a little bit of searching, the choice was between +[Haunt](https://dthompson.us/projects/haunt.html), written in [Guile +Scheme](https://www.gnu.org/software/guile/), and +[Bagatto](https://bagatto.co/), written in [Janet](https://janet-lang.org/). -I ended up with Haunt, simply because it was in nixpkgs which in turn made my life easier. You can check out the source of the website [here](#). ¯\_(ツ)_/¯ Documentation was so-so, but by taking advantage of the awesome people who made stuff with Haunt over at [Awesome Haunt](https://awesome.haunt.page/), I managed to get up and running. It really is quite a powerful ssg. +I ended up with Haunt, simply because it was in nixpkgs which in turn made my +life easier. You can check out the source of the website [here](#). ¯\_(ツ)_/¯ +Documentation was so-so, but by taking advantage of the awesome people who made +stuff with Haunt over at [Awesome Haunt](https://awesome.haunt.page/), I +managed to get up and running. It really is quite a powerful ssg. That said, Janet might be worth checking out at some point. |