summaryrefslogtreecommitdiffstats
path: root/main.scm
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2025-12-28 20:58:09 +0200
committerJan Tuomi <jan@jantuomi.fi>2025-12-28 20:58:09 +0200
commita8e90254b6f2637e4a44908787d8c948d4eb2b38 (patch)
tree7954708c784bd5a86d1c1f07219c400644748374 /main.scm
parentf6215e55d7499d6cc3a3737cfb753f08ce1d4b45 (diff)
Improve post links
Diffstat (limited to 'main.scm')
-rw-r--r--main.scm20
1 files changed, 2 insertions, 18 deletions
diff --git a/main.scm b/main.scm
index 71bd879..5a59623 100644
--- a/main.scm
+++ b/main.scm
@@ -102,26 +102,10 @@
"</a>"))
(define (nav-html prev next)
- ;; `prev` and `next` here refer to chronological neighbors:
- ;; - prev = older post
- ;; - next = newer post
- ;; Render with chevrons and align prev to the left, next to the right.
- (define prev-html
- (if prev
- (nav-link "post-nav-prev" "‹" #f prev)
- ""))
- (define next-html
- (if next
- (nav-link "post-nav-next" #f "›" next)
- ""))
(string-append
"<nav class=\"post-nav\" aria-label=\"Post navigation\">"
- "<div class=\"post-nav-left\">"
- prev-html
- "</div>"
- "<div class=\"post-nav-right\">"
- next-html
- "</div>"
+ (if prev (string-append "<div class=\"post-nav-left\">" (nav-link "post-nav-prev" "‹" #f prev) "</div>") "")
+ (if next (string-append "<div class=\"post-nav-right\">" (nav-link "post-nav-next" "›" #f next) "</div>") "")
"</nav>"))
(define (patch-file path nav)