summaryrefslogtreecommitdiffstats
path: root/website
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2021-04-11 11:05:45 +0200
committerRicardo Wurmus <rekado@elephly.net>2021-04-11 11:05:45 +0200
commit82e437898d40a215d41ab368ad8c7f4a405e2cf9 (patch)
treeec09f405ac281d493b3806edc70f79edcf69b303 /website
parentwebsite: Fix vertical alignment. (diff)
website: Disable menu item for current location.
Diffstat (limited to 'website')
-rw-r--r--website/haunt.scm43
-rw-r--r--website/software.md1
-rw-r--r--website/static/css/main.css4
3 files changed, 29 insertions, 19 deletions
diff --git a/website/haunt.scm b/website/haunt.scm
index 5d00630..54090b7 100644
--- a/website/haunt.scm
+++ b/website/haunt.scm
@@ -22,7 +22,8 @@
22 (haunt builder assets) 22 (haunt builder assets)
23 (haunt reader) 23 (haunt reader)
24 (haunt reader commonmark) 24 (haunt reader commonmark)
25 (srfi srfi-71)) 25 (srfi srfi-71)
26 (ice-9 match))
26 27
27(define %cwd 28(define %cwd
28 (and=> (assq-ref (current-source-location) 'filename) 29 (and=> (assq-ref (current-source-location) 'filename)
@@ -39,19 +40,25 @@
39 40
40(define* (base-layout body #:key (title "") (meta '()) 41(define* (base-layout body #:key (title "") (meta '())
41 (posts '()) site) 42 (posts '()) site)
42 (define menubar 43 (define (menubar where)
43 `(div (@ (id "menubar") 44 (let ((locations
44 (class "width-control")) 45 '(("about" "About" "/")
45 (ul 46 ("software" "Software" "/software")
46 (li (a (@ (href ,(base-url "/"))) 47 ("blog" "Blog" "/blog"))))
47 "About")) 48 `(div (@ (id "menubar")
48 (li (a (@ (href ,(base-url "/software"))) 49 (class "width-control"))
49 "Software")) 50 (ul
50 (li (a (@ (href ,(base-url "/blog"))) 51 ,@(map (match-lambda
51 "Blog")) 52 ((key text path)
52 (li (a (@ (href ,(base-url "/blog/feed.xml"))) 53 (if (and where (string=? where key))
53 (img (@ (alt "Atom feed") 54 `(li (@ (class "selected"))
54 (src ,(image-url "/feed.png"))))))))) 55 (span ,text))
56 `(li (a (@ (href ,(base-url path)))
57 ,text)))))
58 locations)
59 (li (a (@ (href ,(base-url "/blog/feed.xml")))
60 (img (@ (alt "Atom feed")
61 (src ,(image-url "/feed.png"))))))))))
55 (define front-page? 62 (define front-page?
56 (assoc-ref meta 'frontpage)) 63 (assoc-ref meta 'frontpage))
57 64
@@ -85,7 +92,7 @@
85 92
86 ;; Add the large-font welcoming message on the 93 ;; Add the large-font welcoming message on the
87 ;; front page. 94 ;; front page.
88 ,@(if (assoc-ref meta 'frontpage) 95 ,@(if front-page?
89 `((p (@ (id "heading") 96 `((p (@ (id "heading")
90 (class "front-page-heading")) 97 (class "front-page-heading"))
91 "Welcome to the GNU Assembly! We write " 98 "Welcome to the GNU Assembly! We write "
@@ -95,9 +102,9 @@
95 "giving them individual and collective control " 102 "giving them individual and collective control "
96 "over their computing, from the operating " 103 "over their computing, from the operating "
97 "system to applications.")) 104 "system to applications."))
98 `(,menubar)))) 105 `(,(menubar (assoc-ref meta 'menu))))))
99 ,@(if (assoc-ref meta 'frontpage) 106 ,@(if front-page?
100 `(,menubar) 107 `(,(menubar "about"))
101 '()) 108 '())
102 109
103 (div (@ (id "content") 110 (div (@ (id "content")
diff --git a/website/software.md b/website/software.md
index af4b017..5e5c455 100644
--- a/website/software.md
+++ b/website/software.md
@@ -1,5 +1,6 @@
1title: Participating Projects 1title: Participating Projects
2author: The GNU Assembly 2author: The GNU Assembly
3menu: software
3--- 4---
4 5
5# Participating Projects 6# Participating Projects
diff --git a/website/static/css/main.css b/website/static/css/main.css
index e11cfb1..8e2d1a0 100644
--- a/website/static/css/main.css
+++ b/website/static/css/main.css
@@ -225,7 +225,9 @@ hr {
225 text-decoration: none; 225 text-decoration: none;
226 font-size: small; 226 font-size: small;
227} 227}
228 228#menubar li.selected span {
229 border-bottom: 2px solid black;
230}
229#menubar li img { 231#menubar li img {
230 vertical-align: middle; 232 vertical-align: middle;
231} 233}