summaryrefslogtreecommitdiff
path: root/doc/haunt.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/haunt.texi')
-rw-r--r--doc/haunt.texi50
1 files changed, 44 insertions, 6 deletions
diff --git a/doc/haunt.texi b/doc/haunt.texi
index 6be2fb5..2d82c8d 100644
--- a/doc/haunt.texi
+++ b/doc/haunt.texi
@@ -299,6 +299,7 @@ programming interfaces.
@menu
* Invoking haunt build:: Build the website.
* Invoking haunt serve:: Serve the website over HTTP.
+* Invoking haunt new:: Generating a blog template.
* Invoking haunt publish:: Publish the website.
@end menu
@@ -375,6 +376,25 @@ Automatically rebuild the site when source files change.
@end table
+@node Invoking haunt new
+@section Invoking @command{haunt new}
+
+The @command{haunt new} command creates a starter template for a new website.
+
+Usage:
+
+@example
+haunt new
+@end example
+
+By default, haunt will create a directory called @file{blog}. To use a
+different name for your new blog, simply provide the name at the
+command line as follows:
+
+@example
+haunt new my-blog
+@end example
+
@node Invoking haunt publish
@section Invoking @command{haunt publish}
@@ -864,7 +884,9 @@ in some markup language to full web pages. Flat pages work great for
the more informational parts of a website that don't require any fancy
programming to generate, like an ``About me'' page.
-@deffn {Procedure} flat-pages directory [#:template] [#:prefix]
+@deffn {Procedure} flat-pages [directory "pages"] @@
+ [#:template ugly-page-template] @@
+ [#:prefix "/"]
Return a procedure that parses the files in @var{directory} and
returns a list of HTML pages, one for each file. The files are parsed
@@ -886,23 +908,39 @@ of demonstrating Haunt's flat page functionality. I live here in this
manual with my two cats: Bob and Carol.
@end example
+If the above text were saved to @file{about.md} in the flat pages
+directory, the resulting HTML page would be @file{about.html}.
+
+For ``pretty'' URLS (@file{/about} rather than @file{/about.html}),
+the special metadata item @code{index: true} can be specified in the
+page header:
+
+@example
+title: About me
+index: true
+---
+
+# About me
+
+...
+@end example
+
+With the @code{index} metadata flag, Haunt will generate
+@file{about/index.html} rather than @file{about.html}.
+
The content of each flat page is inserted into a complete HTML
document by the @var{template} procedure. This procedure takes three
arguments:
@itemize
@item the site object
-@item the page title string (from the metadata header)
+@item the page metadata association list
@item an SXML tree of the page body
@end itemize
@var{template} should return a single value: a new SXML tree
representing a complete HTML page that presumably wraps the page body.
-Conveniently, the signature of @var{template} matches the blog theme
-layout procedure so that it can be reused for flat pages. @xref{Blog}
-for more information.
-
The structure of @var{directory} is preserved in the resulting pages
and may be optionally nested within the directory @var{prefix}. If no
prefix is specified, the files are placed starting at the root of the