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
David Thompson
e3a548b777
Add SXML to HTML conversion module.
...
* haunt/build/html.scm: New file.
* Makefile.am (SOURCES): Add it.
2015-04-10 23:44:21 -04:00
David Thompson
aa7aae9d3e
Add page module.
...
* haunt/page.scm: New file.
* Makefile.am (SOURCES): Add it.
2015-04-10 23:39:07 -04:00
David Thompson
dda114b410
Add reader module.
...
* haunt/reader.scm: New file.
* Makefile.am (SOURCES): Add it.
2015-04-10 23:37:42 -04:00
David Thompson
18a0b7ce6b
Add post module.
...
* haunt/post.scm: New file.
* Makefile.am (SOURCES): Add it.
2015-04-10 23:37:27 -04:00
David Thompson
2a878fd9ee
ui: Display version information.
...
* haunt/config.scm: Delete.
* haunt/config.scm.in: New file.
* haunt/ui.scm (show-version-and-exit): New procedure.
(program-name): Change default value.
(haunt-main): Add version option.
* haunt/ui/serve.scm (haunt-serve): Likewise.
* configure.ac (AC_CONFIG_FILES): Add 'haunt/config.scm'.
* .gitignore: Ignore 'haunt/config.scm'.
2015-01-04 22:50:01 -05:00
David Thompson
f299cca709
Add serve command.
...
* haunt/config.scm: New file.
* haunt/serve/mime-types.scm: New file.
* haunt/serve/web-server.scm: New file.
* haunt/ui/serve.scm: New file.
* haunt/ui.scm (commands, program-name): New variables.
(show-haunt-help): Display possible commands.
(run-haunt-command): New procedure.
(haunt-main): Run subcommands.
* Makefile.am (SOURCES): Add files.
2015-01-04 22:49:59 -05:00
David Thompson
1cd43ba967
First commit.
2015-01-04 20:02:16 -05:00