Luapress v3.3
Markdown goes in, HTML comes out. Luapress is a simple and fast static site/blog generator.
Install with Luarocks:
$ luarocks install luapress
Create a new site in the current directory:
$ luapress init http://mywebsite.com
Drop Markdown files in posts/ & pages/ and build with:
$ luapress
Markdown Extras
Luapress handles a few extensions to normal markdown:
- Use
--MORE--to generate a excerpt/read-more link in posts - Use
[=pages|posts/NAME]to generate crosslinks between posts/pages - Set
$key=valueto set data for that post/page:- Set
$time=time_in_epoch_secondsto set post time - Or
$date=day/month/year(overrides above) $order=numbersets the order pages appear in the menu$hidden=truehides pages from the menu
- Set
Config Options
Modify the auto-generated config.lua to customise the Luapress output:
config.titleto change the site titleconfig.templateto use a custom templateconfig.posts_dirandconfig.pages_dirchange the output dirsconfig.index_pageto use a page as indexconfig.sticky_pageto stick a pages contents on top of the first indexlink_dirs = falsebuild post/pages at/name.htmlrather than/name/index.html
All the available options and defaults can be viewed in the default config.
Environments
Multiple environments can be defined in the config file:
config = {
url = 'http://localhost/mysite',
envs = {
production = {
url = 'http://mysite.com',
build_dir = 'production'
}
}
}
To build against envs:
# Builds default (localhost/mysite) to ./build (the default)
$ luapress
# Builds production (mysite.com) to ./production
$ luapress production
Templates
Luapress templates use mustache, but also offer legacy support for LHTML. You only need to worry about a few files:
header.mustachefooter.mustache- One or both of
post.mustache&page.mustache - Optionally an
archive.mustache
The included templates and this website serve as good references for building templates.
Plugins
Plugins can be used like so:
$! MY_PLGUIN arg, arg, arg !$
To use plugins not included with Luapress, just drop them in plugins/ alongside your posts/ and pages/. Plugins must contain an init.lua file which returns a single function. Check out the gallery plugin as a good reference for building plugins.