~aasg/haunted-blog

700e1d89c2446bc030df6b16695cd0325af18531 — Aluísio Augusto Silva Gonçalves 10 months ago 09a8905
haunt: Add language specifier and skip-to-content link for accessibility
1 files changed, 45 insertions(+), 41 deletions(-)

M haunt.scm
M haunt.scm => haunt.scm +45 -41
@@ 96,45 96,49 @@

(define (aasg-layout site title body)
  `((doctype "html")
    (head
      (meta (@ (charset "utf-8")))
      (meta (@ (name "viewport")
               (content "width=device-width, initial-scale=1")))
      (title ,(string-append title " — " (site-title site)))
      (link (@ (rel "alternate")
               (title "Posts")
               (type "application/atom+xml")
               (href "feed.xml")))
      (link (@ (rel "stylesheet")
               (href "css/a11y.css")))
      (link (@ (rel "stylesheet")
               (href "css/classless.css")))
      (link (@ (rel "stylesheet")
               (href "css/site.css"))))
    (body
      (header
        (nav (@ (class "profile-links"))
             (ul
               (li (a (@ (href "index.html")
                         (aria-label "Home"))
                      ,(embedded-icon 'signature)
                      (span "~aasg")))
               (li ,(profile-link "GitHub" "https://github.com/AluisioASG"))
               (li ,(profile-link "GitLab" "https://gitlab.com/AluisioASG"))
               (li ,(profile-link "sourcehut" "https://sr.ht/~aasg"))
               (li ,(profile-link "LinkedIn" "https://www.linkedin.com/in/aasg/")))))
      ,body
      (footer (p
                (a (@ (rel "license")
                      (href "https://creativecommons.org/licenses/by-sa/4.0/")
                      (title "Creative Commons Attribution-ShareAlike 4.0 International")
                      (aria-label "Creative Commons Attribution-ShareAlike 4.0 International"))
                   "\U01F16D\U01F16F\U01F10E")
                " Aluísio Augusto Silva Gonçalves. "
                ,(link-as `("Built with, powered by, licensed under, "
                            (i "et cetera, et cetera, et cetera")
                            ".")
                          "about-site.html"))))))
    (html (@ (lang "en"))
          (head
            (meta (@ (charset "utf-8")))
            (meta (@ (name "viewport")
                     (content "width=device-width, initial-scale=1")))
            (title ,(string-append title " — " (site-title site)))
            (link (@ (rel "alternate")
                     (title "Posts")
                     (type "application/atom+xml")
                     (href "feed.xml")))
            (link (@ (rel "stylesheet")
                     (href "css/a11y.css")))
            (link (@ (rel "stylesheet")
                     (href "css/classless.css")))
            (link (@ (rel "stylesheet")
                     (href "css/site.css"))))
          (body
            (p (@ (class "visually-hidden"))
               (a (@ (href "#content")) "Skip to content"))
            (header
              (nav (@ (class "profile-links"))
                   (ul
                     (li (a (@ (href "index.html")
                               (aria-label "Home"))
                            ,(embedded-icon 'signature)
                            (span "~aasg")))
                     (li ,(profile-link "GitHub" "https://github.com/AluisioASG"))
                     (li ,(profile-link "GitLab" "https://gitlab.com/AluisioASG"))
                     (li ,(profile-link "sourcehut" "https://sr.ht/~aasg"))
                     (li ,(profile-link "LinkedIn" "https://www.linkedin.com/in/aasg/")))))
            ,body
            (footer (p
                      (span (@ (class "visually-hidden")) "Copyright:")
                      (a (@ (rel "license")
                            (href "https://creativecommons.org/licenses/by-sa/4.0/")
                            (title "Creative Commons Attribution-ShareAlike 4.0 International")
                            (aria-label "Creative Commons Attribution-ShareAlike 4.0 International"))
                         "\U01F16D\U01F16F\U01F10E")
                      " Aluísio Augusto Silva Gonçalves. "
                      ,(link-as `("Built with, powered by, licensed under, "
                                  (i "et cetera, et cetera, et cetera")
                                  ".")
                                "about-site.html")))))))

(define (author-hcard post)
  (let* ((author-name (post-ref post 'author))


@@ 185,7 189,7 @@
    `((h1 (@ (class "p-name"))
          ,(post-ref post 'title))
      ,(when (post-ref post 'toc) (sxml-toc (post-sxml post)))
      (div (@ (class "e-content"))
      (div (@ (id "content") (class "e-content"))
           ,(post-sxml post))))
  (define %comments-link
    `(p (@ (class "post-comments"))


@@ 200,7 204,7 @@
(define (aasg-page-template post)
  `(article (@ (class "h-entry"))
            (h1 (@ (class "p-name")) ,(post-ref post 'title))
            (div (@ (class "e-content")) ,(post-sxml post))))
            (div (@ (id "content") (class "e-content")) ,(post-sxml post))))

(define (taglist post)
  (define (tag-link tag)