David Thompson
9b3f82e5fa
builder: blog: Add concept of "collections".
...
Rather than having a hardcoded index page, a blog now accepts a variable
number of "collection" tuples that describe the page title, file name,
and the filter procedure for the posts that will appear on that page.
* haunt/builder/blog.scm (<theme>) [list-template]: Delete.
[collection-template]: New field.
(theme-list-template): Delete.
(theme-collection-template): New accessor.
(make-theme): Replace #:list-template with #:collection-template.
(render-list): Delete.
(render-collection): New procedure.
(ugly-theme): Use #:collection-template argument.
(blog): Add #:collections argument.
2015-08-06 08:55:20 -04:00
David Thompson
97e31d42d2
builder: blog: Export date->string*.
...
* haunt/builder/blog.scm: Export date->string*.
2015-08-05 18:17:49 -04:00
David Thompson
ce95359aab
site: Don't crash if there is no posts directory.
...
* haunt/site.scm (build-site): Test for the existence of posts
directory.
2015-08-05 18:17:11 -04:00
David Thompson
49c0dec2e0
site: Update default file filter.
...
* haunt/site.scm (default-file-filter): Ignore files that begin with "."
or "#".
2015-08-05 18:16:10 -04:00
David Thompson
5ed2006c7b
ui: serve: Add --watch option.
...
* haunt/ui/serve.scm (show-help): Add help text for --watch.
(%options): Add --watch option.
(watch): New procedure.
(haunt-serve): DTRT when --watch is specified.
2015-08-03 23:14:09 -04:00
David Thompson
1edd8aa07a
site: Add a way to ignore post files that match a pattern.
...
This allows one to ignore files that would otherwise match a reader's
file extension, such as an Emacs temporary file like ".#foo.html".
* haunt/site.scm (<site>)[post-filter]: New field.
(site-posts-filter): New accessor.
(site): Add #:post-filter argument.
(build-site): Pass post filter procedure to 'read-posts'.
(make-file-name-filter, default-file-name-filter): New procedures.
* haunt/reader.scm (read-posts): Add 'ignore?' argument.
2015-08-03 23:09:31 -04:00
Ricardo Wurmus
ed271eb079
site: Fix procedure name in doc string.
...
* haunt/site.scm (site): Change "POST-SLUG" to "MAKE-SLUG" in doc
string.
2015-07-28 09:38:19 -04:00
Ricardo Wurmus
615361a220
site: Add site-wide slug procedure setting.
...
Co-Authored-By: David Thompson <davet@gnu.org>
* haunt/site.scm (<site>)[make-slug]: New field.
(site-make-slug, site-post-slug): New procedures.
(site): Add #:make-slug keyword argument.
* haunt/builder/blog.scm (render-list): Pass site to theme's list
template.
(ugly-theme): Add 'site' argument to #:list-template procedure.
(blog): Use 'site-post-slug'.
* haunt/builder/atom.scm (atom-feed, post->atom-entry): Likewise.
2015-07-27 20:30:00 -04:00
David Thompson
228932a48b
example: Add image asset.
...
* example/haunt.scm: Add static directory builder.
* example/images/guile-banner.small.png: New file.
* example/posts/foo.sxml: Render Guile banner image.
2015-07-27 08:54:30 -04:00
David Thompson
2d82b5f2f0
web-server: Bypass response sanitization for static files.
...
Just copy the raw bytes.
* haunt/serve/web-server.scm (dump-file): Delete.
(render-file): Return a bytevector instead of a writer procedure.
2015-07-27 08:48:29 -04:00
David Thompson
c2a3fd273a
Remove code that was accidentally committed.
2015-07-27 08:24:49 -04:00
David Thompson
1589d024d7
site: Display unicode arrow when printing asset copy actions.
...
* haunt/site.scm (build-site): Replace '->' with '→'.
2015-07-26 23:15:09 -04:00
David Thompson
8d027f025b
ui: Set default locale for all commands.
...
* haunt/ui.scm (haunt-main): Set LC_ALL.
2015-07-26 23:15:09 -04:00
David Thompson
19a26608f2
utils: file-name-components: Handle empty string.
...
* haunt/utils.scm (file-name-components): Return the empty list when
given the empty string.
2015-07-26 23:15:09 -04:00
David Thompson
2f6b06dd22
asset: Add brief documentation.
...
* haunt/asset.scm: Add introductory comment.
* README.md (Example Configuration): Add 'directory-assets' example.
2015-07-26 23:15:09 -04:00
David Thompson
348e16e264
builder: Add assets builder.
...
* haunt/builder/assets.scm: New file.
* Makefile.am (SOURCES): Add it.
2015-07-26 23:15:08 -04:00
David Thompson
5941c0d27b
Rename (haunt build html) to (haunt html).
...
* haunt/build/html.scm: Delete it.
* haunt/html.scm: New file.
* Makefile.am (SOURCES): Remove old file. Add new file.
* haunt/builder/atom.scm: Use new module.
* haunt/builder/blog.scm: Likewise.
* haunt/ui/serve.scm: Likewise.
2015-07-26 22:35:29 -04:00
David Thompson
75430def43
html: Add punctuation to comment.
2015-07-26 22:29:57 -04:00
David Thompson
d919b527fc
html: Remove gratuitous escape codes.
...
UTF-8 encoded HTML pages are much better than maintaining a giant lookup
table.
* haunt/build/html.scm (%escape-chars): Remove all but the absolutely
necessary escape codes.
* haunt/builder/blog.scm (ugly-theme)[#:layout]: Add UTF-8 meta tag.
2015-07-26 22:27:24 -04:00
David Thompson
a123965c0c
Remove hardcoded Guile executable path.
...
* scripts/haunt: Now a build artifact.
* scripts/haunt.in: New file.
* configure.ac: Pre-process haunt.in.
2015-07-26 15:20:18 -04:00
David Thompson
88d3b34cce
Add GNU Guix development environment helper.
...
* package.scm: New file.
* README.md: Document it.
2015-07-19 10:16:41 -04:00
David Thompson
07d47e2568
README: Add building instructions.
...
* README.md (Requirements, Building): New sections.
2015-07-19 10:14:01 -04:00
David Thompson
5150d32030
Add autotools bootstrap script.
...
* bootstrap: New file.
2015-07-19 10:02:53 -04:00
David Thompson
5a0c70f145
builder: blog: Add theme type.
...
* haunt/builder/blog.scm (<theme>): New record type.
(theme, theme?, theme-name, theme-layout, theme-post-layout,
theme-list-template, with-layout, render-post, render-list,
date->string*): New procedures.
(ugly-theme): Redefine as <theme>.
(blog): Use <theme> object.
2015-04-15 08:29:35 -04:00
David Thompson
1f1784f9f1
Add static asset support.
...
* haunt/asset.scm: New file.
* Makefile.am (SOURCES): Add it.
* haunt/site.scm (build-site): Add support for assets.
* haunt/utils.scm (file-name-components, join-file-name-components): New
procedures.
2015-04-13 21:59:29 -04:00
David Thompson
395b510a6d
example: Remove personal details.
...
* example/haunt.scm: Use made up metadata.
2015-04-13 20:29:00 -04:00
David Thompson
9e6a3efd68
README: Remove personal details from example configuration.
...
* README.md (Example Configuration): Use made up domain/name/email address.
2015-04-13 20:23:28 -04:00
David Thompson
0c4e28c502
README: Remove srfi-19 import from example configuration.
...
* README.md (Example Configuration): Remove (srfi srfi-19).
2015-04-13 20:21:53 -04:00
David Thompson
fdb70223a7
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.
2015-04-13 19:53:39 -04:00
David Thompson
913c6bed6f
builder: Add primitive blog builder.
...
* haunt/builder/blog.scm: New file.
* Makefile.am (SOURCES): Add it.
2015-04-13 19:50:06 -04:00
David Thompson
3592829387
post: Add post-date procedure.
...
* haunt/post.scm (%default-date): New variable.
(post-date): New procedure.
* haunt/builder/atom.scm (post->atom-entry): Use post-date.
* README.md (Example Configuration): Remove date from default metadata.
2015-04-13 19:43:35 -04:00
David Thompson
3614b3e9b9
post: Rename post->time to post-time.
...
* haunt/post.scm (post->time): Rename to...
(post-time): ...this.
2015-04-13 19:24:20 -04:00
Arne Babenhauserheide
87aaae2585
README: Fix date in example config.
...
* README.md: Add missing argument to make-date. Use quasiquote and
unquote to apply make-date.
2015-04-13 17:52:34 -04:00
David Thompson
ba85e9e6c7
Update README.
...
* README.md: Update intro. Add example configuration and usage.
2015-04-12 10:24:19 -04:00
David Thompson
c529bbd0bd
builder: Add Atom feed builder.
...
* haunt/builder/atom.scm: New file.
* Makefile.am (SOURCES): Add it.
2015-04-11 23:41:44 -04:00
David Thompson
fc06ea3d9d
html: Add sxml->html-string.
...
* haunt/build/html.scm (sxml->html-string): New procedure.
2015-04-11 23:34:47 -04:00
David Thompson
44fdd16202
post: Add posts/group-by-tag.
...
* haunt/post.scm (group-by-tag): New procedure.
2015-04-11 23:34:23 -04:00
David Thompson
390980cf5c
serve: web-server: Fix directory rendering.
...
Paths were not being concatenated properly.
* haunt/server/web-server.scm (render-directory): Fix concat+uri-encode.
2015-04-11 23:30:59 -04:00
David Thompson
06321fbdd8
site: Fix cleaning step before building.
...
Cleaning the build directory failed when a subdirectory existed.
* haunt/utils.scm (clean-directory): Remove.
(delete-file-recursively): New procedure.
* haunt/site.scm (build-site): Use delete-file-recursively.
2015-04-11 23:29:20 -04:00
David Thompson
325ecc7934
site: Add 'domain' field.
...
* haunt/site.scm (<site>): Add 'domain' field.
(make-site): New argument.
(site-domain): New accessor.
(site): Add 'domain' keyword argument.
2015-04-11 22:46:08 -04:00
David Thompson
5f7a963c17
reader: Export html-reader and fix style.
...
* haunt/reader.scm (html-reader): Export. Use alist-cons to neaten up
code.
2015-04-11 22:33:55 -04:00
David Thompson
84c65348ea
post: Add metadata parsers.
...
* haunt/post.scm (%metadata-parsers): New variable. Register parser for
'tags and 'date.
(metadata-parser, register-metadata-parser!, parse-metadata): New
procedures.
2015-04-11 22:33:54 -04:00
David Thompson
2464d9d06b
post: Add helper procedures.
...
* haunt/post.scm (post-slug, posts/reverse-chronological): New procedures.
2015-04-11 22:33:54 -04:00
David Thompson
c2191a68f2
utils: Add take-up-to.
...
* haunt/utils.scm (take-up-to): New procedure.
2015-04-11 22:33:54 -04:00
David Thompson
35bb74497d
utils: Add string->date*.
...
* haunt/utils.scm (string->date*): New procedure.
2015-04-11 22:33:54 -04:00
David Thompson
2e136d15a5
config: Remove unneeded things.
...
* haunt/config.scm.in (%haunt-cwd, haunt-file-name,
haunt-output-directory): Remove.
2015-04-11 18:37:24 -04:00
David Thompson
db0f607f28
ui: Add "build" to command list.
...
* haunt/ui.scm (commands): Add "build".
2015-04-11 18:31:54 -04:00
David Thompson
210e58c2ba
ui: Add 'build' subcommand.
...
* haunt/ui/build.scm: New file.
* Makefile.am (SOURCES): Add it.
2015-04-11 17:54:55 -04:00
David Thompson
be627c2cab
reader: sxml-reader: Use absolute path when loading Scheme file.
...
* haunt/reader.scm (sxml-reader): Call 'load' with an absolute file
name.
2015-04-11 17:53:44 -04:00
David Thompson
ad9c4b23dd
server: web-server: Fix directory view.
...
* haunt/serve/web-server.scm (request-path-components,
request-file-name): New procedures.
(render-directory): URI encode href attributes. Properly concatenate
file paths.
(make-handler): Decode URI before using it as a relative file name.
2015-04-11 17:53:00 -04:00