From fdb70223a709e4a523f8503142b05e94029b7790 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Mon, 13 Apr 2015 19:53:39 -0400 Subject: Add example site. * .gitignore: Ignore example build artifacts. * example/haunt.scm: New file. * example/posts/foo.sxml: New file. * example/posts/bar.html: New file. --- .gitignore | 1 + example/haunt.scm | 15 +++++++++++++++ example/posts/bar.html | 8 ++++++++ example/posts/foo.sxml | 22 ++++++++++++++++++++++ 4 files changed, 46 insertions(+) create mode 100644 example/haunt.scm create mode 100644 example/posts/bar.html create mode 100644 example/posts/foo.sxml diff --git a/.gitignore b/.gitignore index 7d8a9cb..47e8631 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ *~ .#* /haunt/config.scm +/example/site/ diff --git a/example/haunt.scm b/example/haunt.scm new file mode 100644 index 0000000..b4405c0 --- /dev/null +++ b/example/haunt.scm @@ -0,0 +1,15 @@ +(use-modules (haunt site) + (haunt reader) + (haunt builder blog) + (haunt builder atom) + (srfi srfi-19)) + +(site #:title "Built with Guile" + #:domain "dthompson.us" + #:default-metadata + '((author . "David Thompson") + (email . "davet@gnu.org")) + #:readers (list sxml-reader html-reader) + #:builders (list (blog) + (atom-feed) + (atom-feeds-by-tag))) diff --git a/example/posts/bar.html b/example/posts/bar.html new file mode 100644 index 0000000..365574b --- /dev/null +++ b/example/posts/bar.html @@ -0,0 +1,8 @@ +title: A Foo Walks Into a Bar +date: 2015-04-11 20:00 +tags: bar +--- +

+ This is an example using raw HTML, because Guile doesn't have a + Markdown parser. +

diff --git a/example/posts/foo.sxml b/example/posts/foo.sxml new file mode 100644 index 0000000..4edde18 --- /dev/null +++ b/example/posts/foo.sxml @@ -0,0 +1,22 @@ +(use-modules (srfi srfi-41) + (haunt utils)) + +(define fib + (stream-cons 0 (stream-cons 1 (stream-map + fib (stream-cdr fib))))) + +(define count 20) + +`((title . "Hello, world!") + (date . ,(string->date* "2015-04-10 23:00")) + (tags "foo" "bar") + (summary . "Just a test") + (content + ((h2 "What is this thing?") + (p "This is Haunt. A static site generator for GNU Guile.") + (p "SXML is cool because you can evaluate Scheme code in your blog +posts. Here are the first " + ,count + " fibonacci numbers, computed with SRFI-41!") + (pre ,(object->string + (stream->list + (stream-take count fib))))))) -- cgit v1.2.3