diff --git a/assets/templates/default.html b/assets/templates/default.html index 9ecd0d1..519d44d 100644 --- a/assets/templates/default.html +++ b/assets/templates/default.html @@ -15,6 +15,10 @@ hr { border: 0; border-bottom: 1px solid black; margin-top: 16px } td { padding: 0em .5em; vertical-align: top } footer { font-size: small; text-align: right } + /* permalinks */ + h1 a::after, h2 a::after, h3 a::after, h4 a::after, h5 a::after, h6 a::after { content: "ΒΆ"; opacity: 0; margin-left: .5em; } + h1:hover a::after, h2:hover a::after, h3:hover a::after, h4:hover a::after, h5:hover a::after, h6:hover a::after { opacity: 100; } + h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { text-decoration: none; }
diff --git a/main.scm b/main.scm index 3ee380d..7e42a9e 100755 --- a/main.scm +++ b/main.scm @@ -94,7 +94,12 @@ (substring* 0 40))) (define (enumerate-tag tag inner) - `(,tag (@ (id ,(slugify tag inner))) ,inner)) + (let ((slug (slugify tag inner))) + `(,tag + (@ (id ,slug)) + ,inner + (a (@ (title "Permalink to this section") + (href "#" ,slug)))))) (define (sxml-html-rules adjust-relative) `(;; assign all headings an id so you can link to them