summaryrefslogtreecommitdiff
path: root/doc/haunt.texi
diff options
context:
space:
mode:
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