diff options
| author | Jakob L. Kreuze <zerodaysfordays@sdf.org> | 2022-08-28 18:31:07 -0400 |
|---|---|---|
| committer | Jakob L. Kreuze <zerodaysfordays@sdf.org> | 2022-08-28 18:31:07 -0400 |
| commit | 2fdf6adbd44d93caeeabf263649a1ee37a93908e (patch) | |
| tree | bcd62f0c747bba1a9a89b1d264c6a784433de735 /haunt | |
| parent | de727db06bcd673ce4e8c06084a5cf78dcb514a9 (diff) | |
Some (roughly-implemented) support for custom meta tags, etc
Diffstat (limited to 'haunt')
| -rw-r--r-- | haunt/jakob/builder/blog.scm | 4 | ||||
| -rw-r--r-- | haunt/jakob/theme.scm | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/haunt/jakob/builder/blog.scm b/haunt/jakob/builder/blog.scm index cf333d6..bea9ed5 100644 --- a/haunt/jakob/builder/blog.scm +++ b/haunt/jakob/builder/blog.scm @@ -134,10 +134,14 @@ (define (post->page post) "Return a Haunt page for POST." + (define meta-tags (call-with-input-string (post-ref post 'meta-tags) read)) + (define scripts (call-with-input-string (post-ref post 'scripts) read)) (make-page (post-uri post) (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 (render-article post)) sxml->html)) diff --git a/haunt/jakob/theme.scm b/haunt/jakob/theme.scm index b9a2dc5..2d999f1 100644 --- a/haunt/jakob/theme.scm +++ b/haunt/jakob/theme.scm @@ -73,6 +73,8 @@ International") (title '()) (description "") (keywords '()) + (meta '()) + (scripts '()) (content '(div ""))) "Return an SHTML document using the website's theme." `((doctype "html") @@ -97,6 +99,11 @@ International") (meta (@ (name "og:title") (content ,title))) + ,@(map (match-lambda + ((name . content) + `(meta (@ (name ,name) (content ,content))))) + meta) + ,@(map (lambda (file-name) (stylesheet file-name)) %stylesheets) ,@(map (match-lambda @@ -107,4 +114,5 @@ International") (body ,%header ,content + ,@scripts ,%footer)))) |