David Thompson
0d67128c3d
serve: Catch exceptions when rebuilding site.
...
Now 'haunt serve --watch' won't crash when you put some bad code in a
post!
* haunt/ui/server.scm (call-with-error-handling): New procedure.
(watch): Wrap build-site call in call-with-error-handling form.
2016-04-21 22:37:44 -04:00
David Thompson
37b4cde1a3
doc: Start writing API docs.
2016-04-02 17:35:43 -04:00
David Thompson
4d31eb056c
doc: Write command-line interface chapter.
2016-04-02 17:08:23 -04:00
David Thompson
a37c3cd585
post: Allow dashes in slugs.
...
* haunt/post.scm (char-set:slug): New variable.
(post-slug): Use slug char set.
2016-04-02 15:56:19 -04:00
David Thompson
796cb05b57
skribe: utils: Export ol.
...
* haunt/skribe/utils.scm: Export ol.
2016-04-02 15:55:47 -04:00
David Thompson
10fa2a715f
guix: Add pkg-config to environment.
2016-02-15 19:57:41 -05:00
David Thompson
5373877f98
build: Allow building with Guile 2.2.
...
* Makefile.am (moddir, goddir): Remove hardcoded "2.0".
* configure.ac: Check to 2.2 as well.
2016-02-15 19:56:41 -05:00
David Thompson
b477823964
build: Don't build dvi docs.
2015-12-06 12:21:21 -05:00
David Thompson
e867118e50
reader: texinfo: Remove unused import.
2015-11-10 21:49:10 -05:00
David Thompson
77db0bd3cf
Renamed README.md to README.
2015-11-10 21:49:10 -05:00
David Thompson
65cced1dda
reader: Add texinfo support.
...
* haunt/reader/texinfo.scm: New file.
* Makefile.am (SOURCES): Add it.
* example/haunt.scm: Activate texinfo reader.
* example/posts/quux.scm: New file.
2015-10-15 22:50:18 -04:00
David Thompson
dfad89079b
post: Add read-metadata-headers procedure.
...
* haunt/post.scm (read-metadata-headers): New procedure.
* haunt/reader.scm (read-html-post): Reimplement using
'read-metadata-headers'.
* tests/post.scm (%tzoffset): New variable.
("read-metadata-headers"): New test.
2015-10-15 22:46:30 -04:00
David Thompson
e505a66a1b
tests: Add post tests.
...
* tests/post.scm: New file.
* Makefile.am (TESTS): Add it.
2015-10-15 22:45:10 -04:00
David Thompson
1ca65755df
Bump version to 0.2.
2015-10-15 21:09:14 -04:00
David Thompson
17e72708a8
Add beginnings of a reference manual.
...
* Makefile.am (info_TEXINFOS): New variable.
* doc/haunt.texi: New file.
* doc/fdl-1.3.texi: New file.
* guix.scm [native-inputs]: Add texinfo.
2015-10-15 21:05:11 -04:00
David Thompson
c013ef276c
Ignore build-aux/test-driver.
...
Generated by Automake. No need to check it into the repo.
2015-10-15 17:10:39 -04:00
David Thompson
397bc485d4
utils: Clean up and add tests.
...
* haunt/utils.scm (flat-map, string-split-at): Add docstring.
(file-name-components): Adjust slightly to handle "/".
(join-file-name-components): Use prefix string join grammar.
(absolute-file-name): Add docstring.
* test-env.in: New file.
* tests/utils.scm: New file.
* Makefile.am (TESTS, TEST_EXTENSIONS, SCM_LOG_COMPILER,
AM_SCM_LOG_FLAGS): New variables.
* configure.ac: Add test-env pre-processed file.
* build-aux/test-driver: New file.
2015-10-14 10:50:03 -04:00
David Thompson
32883938eb
Update Guix development package.
2015-10-12 20:24:06 -04:00
David Thompson
1ddcff389d
Add support for Skribe document format.
...
* haunt/skribe.scm: New file.
* haunt/skribe/utils.scm: New file.
* haunt/reader/skribe.scm: New file.
* configure.ac: Check for guile-reader.
* Makefile.am (SOURCES): Add Skribe modules when guile-reader is
available.
* example/haunt.scm: Include Skribe reader.
* example/posts/baz.skr: New file.
* README.md ("Requirements"): Mention guile-reader as optional dependency.
2015-10-12 20:22:28 -04:00
David Thompson
ec79e5ad1f
utils: Add make-user-module.
...
* haunt/utils.scm (make-user-module): New procedure.
2015-10-12 19:29:57 -04:00
David Thompson
288913eff2
ui: Add CWD to Guile load path.
...
* haunt/ui.scm (haunt-main): Add CWD to Guile load path.
2015-10-12 19:05:50 -04:00
David Thompson
6ab9322709
builder: blog: Export render-post and render-collection.
...
* haunt/builder/blog.scm: Export render-post and render-collection.
2015-10-08 17:40:05 -04:00
David Thompson
33702f3777
html: Remove 'raw' element type.
...
* haunt/html.scm (sxml->html): Remove 'raw' element renderer.
* haunt/reader.scm (read-html-post): Parse to SXML, rather than reading
a raw string.
2015-10-02 20:47:37 -04:00
David Thompson
9cd45089b7
Add package.scm to release tarballs.
2015-08-12 08:36:10 -04:00
David Thompson
bb4626a77b
website: Add license information to home page.
...
* website/haunt.scm (haunt-theme): Add "License" section to index page.
2015-08-10 09:06:04 -04:00
David Thompson
c3df5ff848
Include example and website directories in release tarballs.
2015-08-10 09:04:42 -04:00
David Thompson
7c491608f8
Include README.md in future release tarballs.
...
Thanks to Ben Sturmfels for pointing out that it was missing.
2015-08-10 08:38:33 -04:00
David Thompson
081f8b6e9f
website: Add Piwik analytics.
...
* website/haunt.scm (%piwik-code): New variable.
(haunt-theme): Include Piwik JS on all pages.
* website/js/piwik.js: New file.
2015-08-09 10:21:53 -04:00
David Thompson
a02ac9238d
Add THANKS file.
2015-08-09 10:13:18 -04:00
David Thompson
d24d29fc19
README: Fix Guile version requirements.
...
Thanks to Ben Sturmfels for pointing it out.
2015-08-09 10:11:22 -04:00
David Thompson
c1b96c94a9
website: Add real SHA1 checksum for 0.1 release.
2015-08-08 10:03:11 -04:00
David Thompson
b6917098df
Update Guix development package.
2015-08-08 09:58:59 -04:00
David Thompson
f012747f3a
Add scripts/haunt to bin directory.
...
* Makefile.am (bin_SCRIPTS): New variable.
2015-08-08 09:50:31 -04:00
David Thompson
49a34570ce
Add website.
2015-08-08 09:42:24 -04:00
David Thompson
ddf5b54171
Update Guix package metadata.
2015-08-08 09:28:02 -04:00
David Thompson
bb513b0935
Ignore gzipped tarballs.
2015-08-08 09:19:26 -04:00
David Thompson
884ab20250
ui: serve: Fix auto-rebuilding logic.
...
* haunt/ui/serve.scm (watch): Remove 'ignore-dirs' argument. Add
'check-file?' and 'check-dir?' arguments.
(haunt-serve): Use new 'watch' procedure.
2015-08-08 09:11:31 -04:00
David Thompson
9942e1d97c
blog: Export with-layout.
2015-08-08 00:44:33 -04:00
David Thompson
f5f24c57ce
asset: Filter out assets that do not pass the site file filter.
...
* haunt/asset.scm (directory-assets): Add 'keep?' argument.
(static-directory): Use site file filter.
2015-08-08 00:42:12 -04:00
David Thompson
568b9b8be6
site: Change post-filter to file-filter.
...
Genericized name because the predicate procedure may be used on any
file, not just posts.
* haunt/site.scm (<site>)[post-filter]: Delete.
[file-filter]: New field.
(site): Replace #:post-filter with #:file-filter.
(build-site): Use 'site-post-filter'.
(make-file-name-filter): Delete.
(make-file-filter): New procedure.
(default-file-name-filter): Delete.
(default-file-filter): New procedure.
* haunt/reader.scm (read-posts): Flip predicate around.
2015-08-08 00:40:24 -04:00
David Thompson
35f23fb4f8
example: Remove unnecessary module import.
2015-08-06 08:59:44 -04:00
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
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
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
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
David Thompson
46d38aab9d
ui: serve: Respect site configuration and default options.
...
* haunt/ui/serve.scm (%default-options): Fix alist.
(haunt-serve): Use site config file to determine web server root.
2015-04-11 17:48:19 -04:00
David Thompson
33d7c84e88
ui: Fix load-config.
...
* haunt/ui.scm (load-config): Use an absolute path when calling 'load'.
Fix typo in error message.
2015-04-11 17:47:33 -04:00
David Thompson
40b8242554
site: Tweak log output when building.
...
* haunt/site.scm (build-site): Change log message text.
2015-04-11 17:46:54 -04:00
David Thompson
c7d98392ef
ui: Remove use of defunct haunt-error.
...
* haunt/ui.scm (run-haunt-command): Remove call to 'haunt-error'.
2015-04-11 15:33:56 -04:00
David Thompson
d4ff34e712
page: Ensure output directory exists before writing.
...
* haunt/utils.scm (mkdir-p): New procedure.
* haunt/page.scm (write-page): Create missing directories before writing.
2015-04-11 15:16:33 -04:00
David Thompson
3320a67edb
ui: Improve option processing and help output.
...
* haunt/ui.scm (%common-options, %default-common-options): New
variables.
(simple-args-fols, show-common-options-help, leave, string->number*,
load-config): New procedures.
(haunt-error): Remove.
(show-version-and-exit): Actually exit. Add 'name' argument.
(haunt-main): Use new 'show-version-and-exit'.
* haunt/ui/serve.scm (show-server-help): Remove.
(show-help): New procedure.
(%options, %default-options): New variables.
(haunt-serve): Use SRFI-37 option processing.
2015-04-11 15:10:46 -04:00
David Thompson
11a3e70657
site: Add build-site procedure.
...
* haunt/utils.scm (absolute-file-name, clean-directory): New procedures.
* haunt/site.scm (build-site): New procedure.
2015-04-11 15:10:46 -04:00
David Thompson
7c7b161885
page: Change sxml field to contents.
...
Naming the field 'sxml' is a poor choice because it may contain any type
of data that the writer procedure accepts.
* haunt/page.scm (<page>): Replace 'sxml' field with 'contents'.
(page-sxml): Delete accessor.
(page-contents): New accessor.
(write-page): s/sxml/contents/
2015-04-11 15:10:45 -04:00
David Thompson
4d99832b6b
reader: Add read-posts procedure.
...
* haunt/reader.scm (read-posts): New procedure.
2015-04-11 15:10:45 -04:00
David Thompson
a45269f523
reader: Add html-reader.
...
* haunt/reader.scm (read-html-post): New procedure.
(html-reader): New variable.
2015-04-11 15:10:45 -04:00
David Thompson
0b5bdd9f01
Add utils module.
...
* haunt/utils.scm: New file.
* Makefile.am (SOURCES): Add it.
2015-04-11 15:10:45 -04:00
David Thompson
65c6ca5f0b
reader: Remove stray 'n'.
...
* haunt/reader.scm: Remove stray 'n' character.
2015-04-11 08:44:28 -04:00
David Thompson
e5d6d820ae
Add site module.
...
* haunt/site.scm: New file.
* Makefile.am (SOURCES): Add it.
2015-04-11 08:36:35 -04:00