Next: Readers, Previous: Sites, Up: Programming Interface [Contents][Index]
(use-modules (haunt post))
Posts represent the articles that are kept in a site’s post directory and written in a markup format that Haunt can understand. See Readers for how files on disk can be transformed into posts.
Create a new post object that represents the contents of the file file-name. The body of the post, sxml, is represented as an SXML tree (see SXML in GNU Guile Reference Manual) and the metadata is an association list (see Association Lists in GNU Guile Reference Manual) of arbitrary key/value pairs.
Return #t
if object is a post.
Return the file name for post.
Return the metadata association list for post.
Return the SXML tree for post.
Return the metadata value corresponding to key within post.
Return a URL slug suitable for the file name of post. If a
custom slug
metadata value exists for post then that is
returned. Otherwise, a slug is automatically generated from the
title
metadata value.
The original post-slug
procedure above has some less than ideal
behavior. One issue is that version numbers like “1.2.3” get
transformed to “123” rather than something more sensible like
“1-2-3”. Unfortunately, changing this behavior would mean breaking
the URLs for existing Haunt sites. Instead, users may opt-in to using
post-slug-v2
by passing it as the #:make-slug
argument
to make-site
. See Sites for more information.
Transform the title of post into a URL slug. This second
revision does a better job than the original. Like post-slug
,
if a custom slug
metadata value exists for post then that
is returned. Otherwise, a slug is automatically generated from the
title
metadata value.
The default date of a post when no other date is specified in the metadata association list.
Return the date for post, or %default-date
if no date is
specified.
Sort posts, a list of posts, in reverse chronological order.
Return the author of post, or #f
if no author is
specified.
Return list of tags for post, or the empty list if no tags are specified.
Return the title of post, or #f
if no title is
specified.
Create an association list of tags mapped to the posts in the list posts that used them.
Next: Readers, Previous: Sites, Up: Programming Interface [Contents][Index]