diff options
| -rw-r--r-- | website/builders/replicant-blog-search.scm | 20 | ||||
| -rw-r--r-- | website/builders/replicant-blog.scm | 4 |
2 files changed, 20 insertions, 4 deletions
diff --git a/website/builders/replicant-blog-search.scm b/website/builders/replicant-blog-search.scm index d19607a..dfbf4c8 100644 --- a/website/builders/replicant-blog-search.scm +++ b/website/builders/replicant-blog-search.scm @@ -41,7 +41,7 @@ (@ (href ,(string-append "https://packages.guix.gnu.org/packages/" name))) ,name)) -(define (replicant-default-collection-template site title posts prefix) +(define (replicant-blog-search-template site title posts prefix) (define (post-uri post) (string-append (or prefix "") "/" (site-post-slug site post) ".html")) @@ -71,7 +71,13 @@ FOSDEM in the blog articles, you can use the following commands:") "\"Full text\" search as by default these file managers usually only " "search the file names only.")))) -(define* (replicant-blog-search-page #:key (theme replicant-theme) prefix +(define replicant-blog-search-theme + (theme #:name "Replicant" + #:layout replicant-layout + #:post-template replicant-default-post-template + #:collection-template replicant-blog-search-template)) + +(define* (replicant-blog-search-page #:key (theme replicant-blog-search-theme) prefix (collections `(("" "search.html" ,posts/reverse-chronological)))) "Return a procedure that transforms a list of posts into pages @@ -82,6 +88,13 @@ decorated by THEME, whose URLs start with PREFIX." base-name)) (lambda (site posts) + (define (post->page post) + (let ((base-name (string-append (site-post-slug site post) + ".html"))) + (serialized-artifact (make-file-name base-name) + (render-post theme site post) + sxml->html))) + (define collection->page (match-lambda ((title file-name filter) @@ -89,4 +102,5 @@ decorated by THEME, whose URLs start with PREFIX." (render-collection theme site title (filter posts) prefix) sxml->html)))) - (append (map collection->page collections)))) + (append (map post->page posts) + (map collection->page collections)))) diff --git a/website/builders/replicant-blog.scm b/website/builders/replicant-blog.scm index b3a8af3..838c27c 100644 --- a/website/builders/replicant-blog.scm +++ b/website/builders/replicant-blog.scm @@ -1,6 +1,6 @@ ;;; Copyright © 2015 David Thompson <davet@gnu.org> ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org> -;;; Copyright © 2023 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> +;;; Copyright © 2023-2024 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> ;;; ;;; This file is based on haunt/builder/blog.scm, ;;; haunt/reader/commonmark.scm and tests/post.scm and from Haunt @@ -34,7 +34,9 @@ #:export (theme-collection-template) #:export (make-theme) #:export (render-collection) + #:export (render-post) #:export (replicant-blog-website) + #:export (replicant-default-post-template) #:export (replicant-layout) #:export (replicant-theme) #:export (theme) |
