;;; Copyright © 2019 - 2026 Jakob L. Kreuze ;;; ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License as ;;; published by the Free Software Foundation; either version 3 of the ;;; License, or (at your option) any later version. ;;; ;;; This program is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;; General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with this program. If not, see ;;; . (define-module (jakob builder index) #:use-module (haunt artifact) #:use-module (haunt html) ;; #:use-module (haunt post) ;; #:use-module (haunt utils) ;; #:use-module (ice-9 format) ;; #:use-module (ice-9 match) #:use-module (jakob builder blog) #:use-module (jakob theme) #:use-module (jakob utils org-mode) ;; #:use-module (jakob utils pagination) ;; #:use-module (jakob utils sxml) ;; #:use-module (jakob utils tags) ;; #:use-module (jakob utils comments) #:use-module (srfi srfi-1) #:use-module (srfi srfi-11) ;; #:use-module (srfi srfi-19) ;; #:use-module (srfi srfi-26) ;; #:use-module (web uri) #:export (index) ) (define about-me-section `(section (@ (id "about-me")) (h2 (@ (class "section-header")) "About Me") ,@(let-values (((_ sxml) (read-org-mode-file "pages/about.org"))) sxml))) (define about-site-section `(section (@ (id "about-site")) (h2 (@ (class "section-header")) "About This Website") ,@(let-values (((_ sxml) (read-org-mode-file "pages/about-site.org"))) sxml))) (define selected-works-section `(section (@ (id "selected-works")) (h2 (@ (class "section-header")) "Selected Works") (p "Click a thumbnail to view project details.") (div (@ (class "project-grid") (role "list")) ,(map (lambda (i) `(a (@ (class "project-thumb") (role "listitem") (href "#")) ,(format #f "[ PROJECT ~a ]" i))) (iota 6))))) (define (posts-section posts) `((h2 (@ (class "section-header")) "Recent Articles") ,@(map render-preview posts))) (define (index) "Return a Haunt build procedure to create an index page." (lambda (site posts) `(,(serialized-artifact "index.html" (theme ;; #:title (post-ref post 'title) ;; #:description (description-from-post post) ;; #:keywords (post-ref post 'tags) ;; #:meta (if (not (eof-object? meta-tags)) meta-tags '()) ;; #:scripts (if (not (eof-object? scripts)) scripts '()) #:content `(,about-me-section (hr (@ (aria-hidden "true"))) ,(posts-section (take (sort-posts posts) 3)) (hr (@ (aria-hidden "true"))) ,selected-works-section (hr (@ (aria-hidden "true"))) ,about-site-section )) sxml->html))))