site: Add scheme field.

* haunt/site.scm (<site>)[scheme]: New field.
  (site): Add #:scheme keyword argument.
This commit is contained in:
David Thompson 2019-06-28 08:26:01 -04:00
parent efb1739a69
commit 794125e408
1 changed files with 7 additions and 2 deletions

View File

@ -37,6 +37,7 @@
site? site?
site-title site-title
site-domain site-domain
site-scheme
site-posts-directory site-posts-directory
site-file-filter site-file-filter
site-build-directory site-build-directory
@ -51,11 +52,12 @@
default-file-filter)) default-file-filter))
(define-record-type <site> (define-record-type <site>
(make-site title domain posts-directory file-filter build-directory (make-site title domain scheme posts-directory file-filter build-directory
default-metadata make-slug readers builders) default-metadata make-slug readers builders)
site? site?
(title site-title) (title site-title)
(domain site-domain) (domain site-domain)
(scheme site-scheme) ; https or http
(posts-directory site-posts-directory) (posts-directory site-posts-directory)
(file-filter site-file-filter) (file-filter site-file-filter)
(build-directory site-build-directory) (build-directory site-build-directory)
@ -67,6 +69,7 @@
(define* (site #:key (define* (site #:key
(title "This Place is Haunted") (title "This Place is Haunted")
(domain "example.com") (domain "example.com")
(scheme 'https)
(posts-directory "posts") (posts-directory "posts")
(file-filter default-file-filter) (file-filter default-file-filter)
(build-directory "site") (build-directory "site")
@ -77,6 +80,8 @@
"Create a new site object. All arguments are optional: "Create a new site object. All arguments are optional:
TITLE: The name of the site TITLE: The name of the site
DOMAIN: The domain that will host the site
SCHEME: Either 'https' or 'http' ('https' by default)
POSTS-DIRECTORY: The directory where posts are found POSTS-DIRECTORY: The directory where posts are found
FILE-FILTER: A predicate procedure that returns #f when a post file FILE-FILTER: A predicate procedure that returns #f when a post file
should be ignored, and #f otherwise. Emacs temp files are ignored by should be ignored, and #f otherwise. Emacs temp files are ignored by
@ -87,7 +92,7 @@ whose keys are symbols
MAKE-SLUG: A procedure generating a file name slug from a post MAKE-SLUG: A procedure generating a file name slug from a post
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 domain posts-directory file-filter build-directory (make-site title domain scheme posts-directory file-filter build-directory
default-metadata make-slug readers builders)) default-metadata make-slug readers builders))
(define (site-post-slug site post) (define (site-post-slug site post)