From cb8c7cde36d46d226fbe1f7f553304e850ef43ac Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Tue, 3 Nov 2015 22:02:07 +0100 Subject: [PATCH] website: Add support for Haunt. This provides a simple way to build the website locally. * website/guixsd.scm: New file. * website/README: Document the new build process. --- website/README | 11 +++++++---- website/guixsd.scm | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 website/guixsd.scm diff --git a/website/README b/website/README index 9112726..b6d60f4 100644 --- a/website/README +++ b/website/README @@ -15,10 +15,13 @@ website]] which is implemented in [[https://www.gnu.org/software/guile][Guile]] * Building -In this implementation, links assume =/software/guix= is the root directory of -the website. In order to build the website on your machine, you will want to -modify the values of ‘(current-url-root)’ and ‘(gnu.org-root)’ parameter -objects. +Building the website depends on the static site generator: + + - [[http://haunt.dthompson.us/][Haunt]] + +To build the site, run ‘haunt build -c guixsd.scm’ to compile all of +the HTML pages. To view the results, run ‘haunt serve -c guixsd.scm’ +and visit in a web browser. * Copying diff --git a/website/guixsd.scm b/website/guixsd.scm new file mode 100644 index 0000000..41d1509 --- /dev/null +++ b/website/guixsd.scm @@ -0,0 +1,45 @@ +;;; GuixSD website --- GNU's advanced distro website +;;; Copyright © 2015 Mathieu Lirzin +;;; +;;; This file is part of GuixSD website. +;;; +;;; GuixSD website is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or +;;; (at your option) any later version. +;;; +;;; GuixSD website is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;;; General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GuixSD website. If not, see . + +(use-modules (haunt site) + (haunt reader) + (haunt page) + (haunt html) + (haunt utils) + (haunt builder assets) + (ice-9 match) + (www) + (www utils)) + +(site #:title "GNU's advanced distro and transactional package manager" + #:domain "gnu.org/software/guix" + #:default-metadata + '((author . "GuixSD Contributors") + (email . "guix-devel@gnu.org")) + #:readers (list sxml-reader) + #:builders + `(,@(map (match-lambda + ((file-name contents) + (lambda (site posts) + (parameterize + ((current-url-root "") + (gnu.org-root "https://www.gnu.org")) + (make-page file-name (contents) sxml->html)))) + (_ const)) + %web-pages) + ,(static-directory "static"))) -- 2.6.1