summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2023-12-27 17:42:40 -0500
committerDavid Thompson <dthompson2@worcester.edu>2023-12-28 08:49:08 -0500
commit0517bc566058a2667b32871a17f647c34fed18ff (patch)
tree45c2edb34e56e1cd1b1eed0ee78c1c071bdb7120
parente6d60cdcb62e9e3fefa6be56124cc81c9072324c (diff)
builder: atom: Clarify #:blog-prefix parameter.
-rw-r--r--doc/haunt.texi33
-rw-r--r--haunt/builder/atom.scm26
2 files changed, 39 insertions, 20 deletions
diff --git a/doc/haunt.texi b/doc/haunt.texi
index 178565a..9ba21ed 100644
--- a/doc/haunt.texi
+++ b/doc/haunt.texi
@@ -929,47 +929,54 @@ The default theme is intended only for testing purposes.
(use-modules (haunt builder atom))
@end example
-@deffn {Procedure} atom-feed [#:file-name #:subtitle #:filter #:max-entries #:blog-prefix]
+@deffn {Procedure} atom-feed [#:file-name "feed.xml"] [#:subtitle "Recent Posts"] @
+ [#:filter posts/reverse-chronological] @
+ [#:max-entries 20] [#:blog-prefix ""]
Return a builder procedure that renders a site's posts as an Atom
feed. All arguments are optional:
@table @var
@item file-name:
-The page file name. The default is @file{feed.xml}.
+The page file name.
@item subtitle
-The feed subtitle. The default is ``Recent Posts''.
+The feed subtitle.
@item filter
The procedure called to manipulate the posts list before rendering.
-The default is to keep all posts and sort them in reverse
-chronological order.
@item max-entries
-The maximum number of posts to render in the feed. The default is 20.
+The maximum number of posts to render in the feed.
+
+@item blog-prefix
+The prefix for all post URLs, which is the combination of the blog's
+prefix and post prefix. @xref{Blog} for more information.
+
@end table
@end deffn
-@deffn {Procedure} atom-feeds-by-tag [#:prefix #:filter #:max-entries #:blog-prefix]
+@deffn {Procedure} atom-feeds-by-tag [#:prefix "feeds/tags"] @
+ [#:filter posts/reverse-chronological] @
+ [#:max-entries 20] [#:blog-prefix ""]
Return a builder procedure that renders an atom feed for every tag
used in a post. All arguments are optional:
@table @var
@item prefix
-The directory in which to write the feeds. The default is
-@file{feeds/tags}.
+The directory in which to write the feeds.
@item filter
The procedure called to manipulate the posts list before rendering.
-The default is to keep all posts and sort them in reverse
-chronological order.
@item max-entries
-The maximum number of posts to render in each feed. The default is
-20.
+The maximum number of posts to render in each feed.
+
+@item blog-prefix
+The prefix for all post URLs, which is the combination of the blog's
+prefix and post prefix. @xref{Blog} for more information.
@end table
diff --git a/haunt/builder/atom.scm b/haunt/builder/atom.scm
index 7f85065..cc35b78 100644
--- a/haunt/builder/atom.scm
+++ b/haunt/builder/atom.scm
@@ -176,10 +176,16 @@
"Return a builder procedure that renders a list of posts as an Atom
feed. All arguments are optional:
-FILE-NAME: The page file name
-SUBTITLE: The feed subtitle
-FILTER: The procedure called to manipulate the posts list before rendering
-MAX-ENTRIES: The maximum number of posts to render in the feed"
+FILE-NAME: The page file name.
+
+SUBTITLE: The feed subtitle.
+
+FILTER: The procedure called to manipulate the posts list before rendering.
+
+MAX-ENTRIES: The maximum number of posts to render in the feed.
+
+BLOG-PREFIX: The prefix for all post URLs, which is the combination of
+the blog's prefix and post prefix."
(lambda (site posts)
(let ((uri (uri->string
(build-uri (site-scheme site)
@@ -208,9 +214,15 @@ MAX-ENTRIES: The maximum number of posts to render in the feed"
"Return a builder procedure that renders an atom feed for every tag
used in a post. All arguments are optional:
-PREFIX: The directory in which to write the feeds
-FILTER: The procedure called to manipulate the posts list before rendering
-MAX-ENTRIES: The maximum number of posts to render in each feed"
+PREFIX: The directory in which to write the feeds.
+
+FILTER: The procedure called to manipulate the posts list before
+rendering.
+
+MAX-ENTRIES: The maximum number of posts to render in each feed.
+
+BLOG-PREFIX: The prefix for all post URLs, which is the combination of
+the blog's prefix and post prefix."
(lambda (site posts)
(let ((tag-groups (posts/group-by-tag posts)))
(map (match-lambda