summaryrefslogtreecommitdiff
path: root/jakob
diff options
context:
space:
mode:
authorJakob L. Kreuze <zerodaysfordays@sdf.org>2026-02-13 19:11:16 -0500
committerJakob L. Kreuze <zerodaysfordays@sdf.org>2026-02-13 19:12:30 -0500
commit3ff45ef59e1a2898c90ddea8945cd694537a8a3a (patch)
tree1faa80fdc3e0efe68cc6bcdf566907894655e16d /jakob
parent8fa54d5ac98d95016f0c3eaa9fbc4f042294705d (diff)
Initial updates to theme function
Diffstat (limited to 'jakob')
-rw-r--r--jakob/theme.scm154
1 files changed, 114 insertions, 40 deletions
diff --git a/jakob/theme.scm b/jakob/theme.scm
index e9dd303..a3e3019 100644
--- a/jakob/theme.scm
+++ b/jakob/theme.scm
@@ -16,6 +16,7 @@
(define-module (jakob theme)
#:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-19)
#:use-module (ice-9 match)
#:use-module (jakob utils sxml)
#:export (theme))
@@ -25,23 +26,23 @@
;;; SHTML generation in the site's theme.
;;;
-(define %stylesheets '("normalize.css" "fonts.css" "highlight.css" "style.css"))
+(define (fugue-icon-path name)
+ (format #f "background-image: url('/static/image/icons-shadowless/~a.png')" name))
+
+(define %title "jakob.space")
+(define %stylesheets '("fonts.css" "highlight.css" "style.css"))
(define %link-rel '(("alternate" "/feed.xml" "application/atom+xml")
("icon" "/static/image/favicon.ico" "image/vnd.microsoft.icon")
("me" "https://social.jakob.space/jakob")
("webmention" "https://webmention.io/jakob.space/webmention")
("pingback" "https://webmention.io/jakob.space/xmlrpc")
("pgpkey authn" "/static/gpg.txt")))
-(define %nav-bar-tabs '(("About" "/pages/about.html")
- ("Tags" "/tag.html")
- ("More ▼" "#"
- ("Blogroll" "/blogroll/")
- ("Bookmarks" "/bookmark/")
- ("Cookbook" "/cookbook/")
- ("Changelog" "/pages/changelog.html"))))
-
-(define %title "Jakob's Personal Webpage")
+(define %nav-bar-tabs '(("Articles" "/blog/")
+ ("Projects" "/projects/")
+ ("About Me" "/pages/about.html")
+ ("Changelog" "/pages/changelog.html")))
+;; Currently unused as the current nav bar does not do nesting.
(define (format-nav-item item-content)
(let* ((anchor-element (apply hyperlink (reverse (take item-content 2))))
(children (drop item-content 2)))
@@ -54,32 +55,99 @@
(define %header
`(header
- ,(hyperlink "/" (image "trident.svg" "home"))
- (nav (ul
- ,@(map format-nav-item %nav-bar-tabs)))))
+ (@ (class "site-header"))
+ (a (@ (href "/") (class "header-logo")) "jakob.space")
+ (time (@ (datetime ,(date->string (current-date) "~Y-~m-~d")))
+ (string-upcase ,(date->string (current-date) "~d~b~Y")))))
+
+(define %default-sidebar-modules
+ `((section
+ (@ (class "module search-module")
+ (aria-labelledby "search-heading"))
+ (h3 (@ (id "search-heading")
+ (class "module-title module-title-has-icon")
+ (style ,(fugue-icon-path "magnifier")))
+ "Search")
+ (form (@ (action "/search")
+ (method "GET")
+ (role "search")
+ (style "display: flex; gap: 5px;"))
+ (input (@ (type "text") (name "q") (placeholder "Keywords...") (aria-label "Search keywords")))
+ (button (@ (type "submit"))
+ "Go")))
+
+ (section
+ (@ (class "module nav-module")
+ (aria-label "Main Navigation"))
+ (h3 (@ (class "module-title module-title-has-icon")
+ (style ,(fugue-icon-path "navigation")))
+ "Navigation")
+ (ul (@ (class "nav-list"))
+ ,@(map (match-lambda
+ ((name target) `(li (a (@ (href ,target)) ,name))))
+ %nav-bar-tabs)))
+
+ (section
+ (@ (class "module network-module")
+ (aria-label "External Network"))
+ (h3 (@ (class "module-title module-title-has-icon")
+ (style ,(fugue-icon-path "external")))
+ "Network")
+ (ul (@ (class "nav-list"))
+ (li (a (@ (href "https://social.jakob.space/users/jakob")) "Pleroma"))
+ (li (a (@ (href "https://lobste.rs/u/jakob")) "Lobste.rs"))
+ (li (a (@ (href "https://git.sr.ht/~jakob")) "Sr.ht"))))
+
+ (section
+ (@ (class "module status-module")
+ (aria-label "External Network"))
+ (h3 (@ (class "module-title module-title-has-icon")
+ (style ,(fugue-icon-path "dashboard")))
+ "Status")
+ (span (@ (style "font-size: 9px; color: #666; border-bottom: 1px dotted #999;"))
+ "Last updated: " (time (@ (datetime "2026-02-13"))) "13FEB2026")
+ (div (@ (style "font-size: 9px; color: #666; margin-top: 4px;"))
+ "Reading: ..."
+ (br)
+ "Playing: Earthbound"
+ (br)
+ "Hacking: ..."))
+
+ (section
+ (@ (class "module comments-module")
+ (aria-labelledby "comments-heading"))
+ (h3 (@ (class "module-title module-title-has-icon")
+ (style ,(fugue-icon-path "megaphone")))
+ "Recent Comments")
+ (div (@ (class "sidebar-comment-list"))
+ (article (@ (class "sidebar-comment-box"))
+ (span (@ (class "comment-context"))
+ "on: "
+ (a (@ (href "/blog/usb-pd-is-pretty-cool.html")) "USB-PD Is Pretty Cool"))
+ (strong "Bob")
+ (a (@ (href "/blog/usb-pd-is-pretty-cool.html#comment-reply"))
+ "I used PETG to make sure it didn't warp..."))
+ (article (@ (class "sidebar-comment-box"))
+ (span (@ (class "comment-context"))
+ "on: "
+ (a (@ (href "/blog/usb-pd-is-pretty-cool.html")) "USB-PD Is Pretty Cool"))
+ (strong "Alice")
+ (a (@ (href "/blog/usb-pd-is-pretty-cool.html#comment-reply"))
+ "This is a lifesaver for field work. Have you..."))))))
+
+(define* (sidebar #:optional modules)
+ )
(define %footer
- `(footer
- (div
- (p "© 2015 - 2025 Jakob L. Kreuze")
- ,(image "cc-by-sa-4.0.png"
- "Creative Commons Attribution-ShareAlike 4.0 International (CC
-BY-SA 4.0) Logo"))
- (p "Unless otherwise specified, the text and images on this site are free
-culture works available under the "
- ,(hyperlink "https://creativecommons.org/licenses/by-sa/4.0/"
- "Creative Commons Attribution Share-Alike 4.0
-International")
- " license.")
- (p "This website is built with "
- ,(hyperlink "http://haunt.dthompson.us/" "Haunt")
- ", a static site generator written in "
- ,(hyperlink "https://gnu.org/software/guile" "Guile Scheme")
- ". The source code is available "
- ,(hyperlink "https://git.sr.ht/~jakob/blog" "here")
- ".")
- (p (a (@ (href "/pages/weblabels.html") (rel "jslicense"))
- "JavaScript license information"))))
+ (define year (date-year (current-date)))
+ `(footer (@ (class "site-footer"))
+ (img (@ (src "/static/image/cc-by-sa-4.0.png")
+ (alt "Creative Commons BY-SA 4.0")))
+ "©"
+ (time (@ (datetime "2015")) "2015")
+ " - "
+ (time (@ (datetime ,year)) ,year)/
+ " Jakob L. Kreuze"))
(define* (theme #:key
(title '())
@@ -87,7 +155,8 @@ International")
(keywords '())
(meta '())
(scripts '())
- (content '(div "")))
+ (content '(div ""))
+ (sidebar '()))
"Return an SHTML document using the website's theme."
`((doctype "html")
(html
@@ -96,7 +165,7 @@ International")
(head
,(if (null? title)
`(title %title)
- `(title ,(string-join (list title %title) " — ")))
+ `(title ,(string-join (list title %title) " :: ")))
(meta (@ (charset "utf-8")))
(meta (@ (name "keywords") (content ,(string-join keywords ", "))))
@@ -124,7 +193,12 @@ International")
%link-rel))
(body
- ,%header
- ,content
- ,@scripts
- ,%footer))))
+ (div (@ (class "main-container"))
+ ,%header
+ (div (@ (class "content-wrapper"))
+ (aside (@ (class "sidebar"))
+ ,@(or sidebar %default-sidebar-modules))
+ (main (@ (class "main-content"))
+ ,content)
+ ,@scripts)
+ ,%footer)))))