summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <davet@gnu.org>2018-03-13 04:51:40 -0400
committerDavid Thompson <davet@gnu.org>2018-03-13 04:51:40 -0400
commite932a5ecc775cf73584f3b55b5b25185a7e2446a (patch)
treee91a21f3beb4e30ede30c586d6fe0b0ffa4cffd4
parent55767210ca51355109398778dfc1bed2c5c066d9 (diff)
Improve Haunt project page.
-rw-r--r--haunt.scm60
-rw-r--r--snippets/haunt-hello.md7
-rw-r--r--snippets/haunt.scm9
3 files changed, 37 insertions, 39 deletions
diff --git a/haunt.scm b/haunt.scm
index d3da8fa..989e7a8 100644
--- a/haunt.scm
+++ b/haunt.scm
@@ -50,7 +50,7 @@
`(link (@ (rel "stylesheet")
(href ,(string-append "/css/" name ".css")))))
-(define (anchor content uri)
+(define* (anchor content #:optional (uri content))
`(a (@ (href ,uri)) ,content))
(define %cc-by-sa-link
@@ -186,6 +186,9 @@ free culture works available under the " ,%cc-by-sa-link " license.")
(define (highlight-scheme code)
`(pre (code ,(highlights->sxml (highlight lex-scheme code)))))
+(define (raw-snippet code)
+ `(pre (code ,(if (string? code) code (read-string code)))))
+
;; Markdown doesn't support video, so let's hack around that! Find
;; <img> tags with a ".webm" source and substitute a <video> tag.
(define (media-hackery . tree)
@@ -457,40 +460,35 @@ rendering."))
#:description
`(,(centered-image "/images/haunt/logo.png" "crudely drawn ghost")
(p "Haunt is a simple, functional, hackable static site generator
-written in Guile Scheme that gives authors the ability to treat
-websites as programs.")
- (p "Haunt isn't your average static site generator. Its mission
-is to give authors the full expressive power of Scheme to determine
-how every aspect of their websites are generated. Haunt uses a
-simple, functional build system that allows any type of web page to be
-built by writing procedures that return page objects.")
+that gives authors the ability to treat websites as Scheme programs.")
+ (p "By giving authors the full expressive power of Scheme, they
+are able to control every aspect of the site generation process.
+Haunt provides a simple, functional build system that can be easily
+extended for this purpose.")
(p "Haunt has no opinion about what markup language authors
-should use to write posts. Just write the relevant reader procedure
-and Haunt will happily work with that format. Likewise, Haunt has no
-opinion about how authors structure their sites. Haunt ships with
-helpful builder procedures that generate simple blogs or Atom feeds,
-but authors should feel empowered to tweak them, write replacements,
-or add new builders to do things that the Haunt hackers didn't think
-of."))
+should use to write posts, though it comes with support for the
+popular Markdown format. Likewise, Haunt has no opinion about how
+authors structure their sites. Though it comes with support for
+building simple blogs or Atom feeds, authors should feel empowered to
+tweak, replace, or create builders to do things that aren't provided
+out-of-the-box."))
#:usage
`((p "Here's what a simple Haunt configuration looks like:")
,(call-with-input-file "snippets/haunt.scm" highlight-scheme)
- (p "With the above saved into a file named "
- (code "haunt.scm")
- " and a "
- (code "posts")
- " directory populated with the articles to publish,
-the site can be built by running "
- (code "haunt build")
- ". Once the site is built, running "
- (code "haunt serve")
- " and visiting "
- (code "localhost:8080")
- " in a web browser will show the results of the build
-without needing to upload the generated files to a web server."))
- #:requirements '("GNU Guile >= 2.1.4"
- "guile-reader (for Skribe support, optional)"
- "guile-commonmark (for Markdown support, optional)")
+ (p "In a new directory, save the above to a file named "
+ (code "haunt.scm") ".")
+ (p "Create a subdirectory named " (code "posts") ".")
+ (p "Add the following to a new file named " (code "posts/hello.md") ":")
+ ,(call-with-input-file "snippets/haunt-hello.md" raw-snippet)
+ (p "Run " (code "haunt build") " to build the site.")
+ (p "Run " (code "haunt serve") " to a launch a web server to
+preview your work.")
+ (p "Open " ,(anchor "http://localhost:8080") " in your web browser
+and smile, because you've just generated your first Haunt site!"))
+ #:requirements
+ '("GNU Guile >= 2.0"
+ "guile-commonmark (for Markdown support, optional)"
+ "guile-reader (for Skribe support, optional)")
#:license "GNU GPLv3+"
#:releases
`(("0.2.2" ,(date 2018 03 10))
diff --git a/snippets/haunt-hello.md b/snippets/haunt-hello.md
new file mode 100644
index 0000000..99805ac
--- /dev/null
+++ b/snippets/haunt-hello.md
@@ -0,0 +1,7 @@
+title: First post!
+date: 2018-03-13 18:00
+tags: hello
+summary: hello!
+---
+
+Hello, world!
diff --git a/snippets/haunt.scm b/snippets/haunt.scm
index 29250a1..a945372 100644
--- a/snippets/haunt.scm
+++ b/snippets/haunt.scm
@@ -2,9 +2,6 @@
(haunt builder blog)
(haunt builder atom)
(haunt builder assets)
- (haunt reader)
- (haunt reader skribe)
- (haunt reader texinfo)
(haunt reader commonmark)
(haunt site))
@@ -13,11 +10,7 @@
#:default-metadata
'((author . "Eva Luator")
(email . "eva@example.com"))
- #:readers (list commonmark-reader
- texinfo-reader
- skribe-reader
- sxml-reader
- html-reader)
+ #:readers (list commonmark-reader)
#:builders (list (blog)
(atom-feed)
(atom-feeds-by-tag)