diff options
| author | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2024-03-19 18:46:16 +0100 |
|---|---|---|
| committer | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2025-06-15 01:30:27 +0200 |
| commit | 9a9ec1f61251e7c31f7b768a815fb3afcf8773f3 (patch) | |
| tree | 411668e18540b821d01e09e9fe963277e857c892 | |
| parent | 325ffa517ad063e25368205ed45c48ec4d6a5cc8 (diff) | |
| download | haunt-blog-9a9ec1f61251e7c31f7b768a815fb3afcf8773f3.tar.gz haunt-blog-9a9ec1f61251e7c31f7b768a815fb3afcf8773f3.tar.bz2 haunt-blog-9a9ec1f61251e7c31f7b768a815fb3afcf8773f3.zip | |
haunt: Add metadata in the articles.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
| -rw-r--r-- | website/builders/replicant-blog.scm | 19 | ||||
| -rw-r--r-- | website/readers/wordpress-markdown.scm | 3 |
2 files changed, 22 insertions, 0 deletions
diff --git a/website/builders/replicant-blog.scm b/website/builders/replicant-blog.scm index 92c2475..1f8052b 100644 --- a/website/builders/replicant-blog.scm +++ b/website/builders/replicant-blog.scm @@ -73,6 +73,25 @@ (define (replicant-default-post-template post) `((h1 (@ (id "title")) ,(post-ref post 'title)) + ;; Metadata + (p (string-append + "Posted" + ,(if + (post-ref post 'authors) + (string-append " by " (post-ref post 'authors)) + "") + ,(if + (post-ref post 'date) + (string-append + " on the " + (date->string (post-ref post 'date) "~d ~B ~Y at ~kh~M")) + "") + ,(if (post-ref post 'licenses) + (string-append + " under the " + (post-ref post 'licenses) " license(s)") + "") + ".")) (div (@ (id "post-content")) ,(post-sxml post)))) (define (replicant-default-collection-template site title posts prefix) diff --git a/website/readers/wordpress-markdown.scm b/website/readers/wordpress-markdown.scm index 203b170..aaa3fca 100644 --- a/website/readers/wordpress-markdown.scm +++ b/website/readers/wordpress-markdown.scm @@ -45,7 +45,10 @@ SRFI-19 date object." (lambda _ (string->date str "~Y~m~d ~H:~M")) (const #f)))) +(define (string->string* str) str) (register-metadata-parser! 'date string->custom-date*) +(register-metadata-parser! 'authors string->string*) +(register-metadata-parser! 'license string->string*) (define wordpress-markdown-reader (make-reader (make-file-extension-matcher "md") |
