site: Add 'domain' field.

* haunt/site.scm (<site>): Add 'domain' field.
  (make-site): New argument.
  (site-domain): New accessor.
  (site): Add 'domain' keyword argument.
This commit is contained in:
David Thompson 2015-04-11 22:46:08 -04:00
parent 5f7a963c17
commit 325ecc7934
1 changed files with 6 additions and 3 deletions

View File

@ -31,6 +31,7 @@
#:export (site #:export (site
site? site?
site-title site-title
site-domain
site-posts-directory site-posts-directory
site-build-directory site-build-directory
site-default-metadata site-default-metadata
@ -39,10 +40,11 @@
build-site)) build-site))
(define-record-type <site> (define-record-type <site>
(make-site title posts-directory build-directory default-metadata (make-site title domain posts-directory build-directory
readers builders) default-metadata readers builders)
site? site?
(title site-title) (title site-title)
(domain site-domain)
(posts-directory site-posts-directory) (posts-directory site-posts-directory)
(build-directory site-build-directory) (build-directory site-build-directory)
(default-metadata site-default-metadata) (default-metadata site-default-metadata)
@ -51,6 +53,7 @@
(define* (site #:key (define* (site #:key
(title "This Place is Haunted") (title "This Place is Haunted")
(domain "example.com")
(posts-directory "posts") (posts-directory "posts")
(build-directory "site") (build-directory "site")
(default-metadata '()) (default-metadata '())
@ -65,7 +68,7 @@ DEFAULT-METADATA: An alist of arbitrary default metadata for posts
whose keys are symbols whose keys are symbols
READERS: A list of reader objects for processing posts READERS: A list of reader objects for processing posts
BUILDERS: A list of procedures for building pages from posts" BUILDERS: A list of procedures for building pages from posts"
(make-site title posts-directory build-directory (make-site title domain posts-directory build-directory
default-metadata readers builders)) default-metadata readers builders))
(define (build-site site) (define (build-site site)