;;; Harmonic Flow web site (define-module (apps blog templates post) #:use-module (apps base templates components) #:use-module (apps base templates theme) #:use-module (apps base types) #:use-module (apps base utils) #:use-module (apps blog utils) #:use-module ((apps blog templates components) #:prefix blog:) #:use-module (apps i18n) #:use-module (haunt post) #:use-module (srfi srfi-19) #:export (post-t)) (define (post-t context) "Return a page in SHTML for the post in the given CONTEXT." (let* ((post (context-datum context "post")) (tags (post-ref post 'tags))) (theme #:title (list (post-ref post 'title) (C_ "webpage title" "|")) #:description (G_ (string-append "Blog post about " (post-ref post 'title) " on Harmonic Flow Blog.")) #:keywords tags #:active-menu-item (C_ "website menu" "Blog") #:css (list (hfweb-url "static/base/css/page.css") (hfweb-url "static/blog/css/post.css")) #:crumbs (list (crumb (C_ "website menu" "Blog") (hfweb-url "blog/")) (crumb (post-ref post 'title) (hfweb-url (post-url-path post)))) #:content `(main (article (@ (class "page centered-block limit-width") (lang "en")) (h2 ,(post-ref post 'title)) (p (@ (class "post-metadata centered-text") (lang ,%current-ietf-tag)) ,(post-ref post 'author) " — " ,(date->string (post-date post) (C_ "SRFI-19 date->string format" "~B ~e, ~Y"))) ,(change-image-to-video (syntax-highlight (post-sxml post))) (div (@ (class "tag-list") (lang ,%current-ietf-tag)) ,(G_ `(p "Related topics:")) ,@(map (lambda (tag) (list (button-little #:label tag #:url (hfweb-url (tag-url-path tag))) " ")) ; NOTE: Force space for readability in non-CSS browsers. (sort tags tag-first?))) (div (@ (class "license") (lang ,%current-ietf-tag)) ,(G_ `(p "Unless otherwise stated, blog posts on this site are copyrighted by their respective authors and published under the terms of the " ,(G_ `(a (@ (href "https://creativecommons.org/licenses/by-sa/4.0/")) "CC-BY-SA 4.0 license."))))))))))