summaryrefslogtreecommitdiff
path: root/doc/haunt.texi
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2023-12-27 17:42:32 -0500
committerDavid Thompson <dthompson2@worcester.edu>2023-12-28 09:00:21 -0500
commite94110b8b12645aa22469a73951905b6e55d3120 (patch)
tree2ab3060b7433ce6fb199c4d15595fd2eb194fff9 /doc/haunt.texi
parentd96ff37148ddb73291a5dbad6bbc43e05afac22b (diff)
Add redirects builder.
Diffstat (limited to 'doc/haunt.texi')
-rw-r--r--doc/haunt.texi29
1 files changed, 29 insertions, 0 deletions
diff --git a/doc/haunt.texi b/doc/haunt.texi
index 6f9d226..7857b38 100644
--- a/doc/haunt.texi
+++ b/doc/haunt.texi
@@ -821,6 +821,7 @@ specification of Markdown, learn more about CommomMark
* Blog:: Dear diary...
* Atom:: Atom feeds.
* RSS:: RSS feeds.
+* Redirects:: Client-side redirects.
@end menu
Builders are procedures that return one or more artifacts
@@ -1018,6 +1019,34 @@ prefix and post prefix. @xref{Blog} for more information.
@end deffn
+@node Redirects
+@subsection Redirects
+
+@example
+(use-modules (haunt builder redirects))
+@end example
+
+The redirects builder creates pages that trigger browser redirects to
+another URL. This allows for easily specifying redirects as part of a
+Haunt site configuration and without the need for modifying the
+configuration of the production web server that is hosting the site.
+
+@deffn {Procedure} redirects specs
+Return a procedure that transforms a list of redirect tuples in
+@var{specs}, with the form @code{(from to)}, into a list of pages that
+trigger a browser-initiated redirect.
+
+@code{from} values must be local page file names, @emph{not} URLs, but
+@var{to} values may be either local page file names or full URLs to
+other websites.
+
+@example
+(redirects '(("/about.html" "/about/me.html") ; local
+ ("/guile.html" "https://gnu.org/software/guile"))) ; remote
+@end example
+
+@end deffn
+
@node Publishers
@section Publishers