theme.scm 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. (define-module (theme theme)
  2. #:use-module (srfi srfi-19)
  3. #:use-module (haunt site)
  4. #:use-module (haunt post)
  5. #:use-module (utils utils)
  6. #:export (gnucode-layout
  7. date->string*
  8. %meta-sxml-elements
  9. %header-sxml-element
  10. %footer-sxml
  11. %sxml-css-links))
  12. ;; (define %bjj-image
  13. ;; '(img (@ (src "bjj.webp") (alt "Plainfield Brazilian Jiu Jitsu logo"))))
  14. (define (date->string* date)
  15. "Convert DATE to human readable string."
  16. (date->string date "~B ~d, ~Y"))
  17. (define (gnucode-layout site title body)
  18. `((doctype "html")
  19. (head
  20. ,%meta-sxml-elements
  21. ,%sxml-css-links
  22. (title ,(string-append title " — " (site-title site))))
  23. (body
  24. ,%header-sxml-element
  25. ,(if (string=? "Recent Posts" title)
  26. `(h1 ,(site-title site))
  27. `(h1 ,title))
  28. (main
  29. ,body)
  30. ,%footer-sxml
  31. )))
  32. (define %header-sxml-element
  33. `((header
  34. (div (@ (class "header header-fixed"))
  35. (div (@ (class "navbar"))
  36. (div (@ (class "logo"))
  37. (a (@ (href "index.html")) "Home"))
  38. (input (@ (type "checkbox") (id "navbar-toggle")))
  39. (label (@ (for "navbar-toggle")) (i ()))
  40. (nav (@ (class "menu"))
  41. (ul
  42. (li (@ (class "hidden-md")) (a (@ (href "index.html")) "Home"))
  43. (li (a (@ (href "money-raised.html")) "Money Raised"))
  44. )))))))
  45. (define %sxml-css-links
  46. '((link (@ (type "text/css") (href "css/footer.min.css") (rel "stylesheet")) "")
  47. (link (@ (type "text/css") (href "css/header.min.css") (rel "stylesheet")) "")
  48. (link (@ (type "text/css") (href "css/main.min.css") (rel "stylesheet")) "")
  49. (link (@ (type "text/css") (href "css/basic.min.css") (rel "stylesheet")) "")
  50. (link (@ (type "text/css") (href "css/gallery.min.css") (rel "stylesheet")) "")
  51. ))
  52. (define %meta-sxml-elements
  53. '((meta (@ (charset "utf-8")))
  54. ;; this tells mobile phones to render the viewport as large as the phone.
  55. (meta (@ (name "viewport") (content "width=device-width, initial-scale=1")))
  56. (meta (@ (name "keywords") (content "slavery proper naming")))
  57. (meta (@ (name "description")
  58. (content "Not virtue signaling to end slavery.")))
  59. (meta (@ (property "og:title") (content "Proper Naming Initiative")))
  60. (meta (@ (property "og:description") (content "Not virtue signaling to end slavery.")))
  61. ;; TODO https://static.wixstatic.com/media/857da9_7f9b0e10f9e148b895fd851e58946c4f%7Emv2.png/v1/fit/w_2500,h_1330,al_c/857da9_7f9b0e10f9e148b895fd851e58946c4f%7Emv2.png
  62. (meta (@ (property "og:image") (content "")))
  63. (meta (@ (property "og:url") (content "https://www.propernaming.org")))
  64. (meta (@ (property "og:site_name") (content "Proper Naming")))
  65. (meta (@ (property "og:type") (content "website")))
  66. ))
  67. (define %footer-sxml
  68. `((footer
  69. (div
  70. )
  71. (section (@ (class "background-grey copyright"))
  72. (p "©2020 by Proper Naming Initiative. " )))))