From e94110b8b12645aa22469a73951905b6e55d3120 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 27 Dec 2023 17:42:32 -0500 Subject: Add redirects builder. --- doc/haunt.texi | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'doc') 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 -- cgit v1.2.3