diff options
Diffstat (limited to 'website/builders/replicant-blog-search.scm')
| -rw-r--r-- | website/builders/replicant-blog-search.scm | 20 |
1 files changed, 17 insertions, 3 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)))) |
