(use-modules (srfi srfi-1) (srfi srfi-19) (haunt asset) (haunt builder blog) (haunt builder atom) (haunt builder assets) (haunt site) (haunt post) (src reader) (src theme)) ;; Set the timezone to UTC, otherwise the dates can get confused. (setenv "TZ" "utc") (define (filter-posts-remove-future-drafts posts) (filter (lambda (post) (timetime-utc (post-ref post 'start-date)) (current-time))) posts)) (define (filter-posts-remove-drafts posts) (filter (lambda (post) (timetime-utc (post-ref post 'end-date)) (current-time))) posts)) (site #:title "Guix Weekly News" #:domain "prototype-guix-weekly-news.cbaines.net" #:build-directory (or (getenv "HAUNT_BUILD_DIRECTORY") "site") #:readers (list post-reader) #:builders (list (blog #:theme weekly-news-theme #:collections `(("Recent posts" "index.html" ,(compose (lambda (posts) (if (< (length posts) 8) posts (take posts 8))) filter-posts-remove-future-drafts posts/reverse-chronological)) ("All posts" "all.html" ,(compose filter-posts-remove-drafts posts/reverse-chronological)))) (atom-feed #:filter (compose filter-posts-remove-drafts posts/reverse-chronological)) (static-directory "static")))