Static site generator based on Vapor's Leaf. Blog-aware and Markdown aware.
Statically linked binary. Known to work on Debian and Ubuntu
cd /usr/local/bin \
&& curl -L https://github.com/danramteke/leaf-press/releases/download/0.6.0leaf-press-ubuntu-20.04.tgz | tar xzf - \
&& cd -
leaf-press init
leaf-press build
cd /usr/local/bin \
&& curl -L https://github.com/danramteke/leaf-press/releases/download/0.6.0/leaf-press-macos-11.0.tgz | tar xzf - \
&& cd -
leaf-press init
leaf-press build
cd /usr/local/bin \
&& curl -L https://github.com/danramteke/leaf-press/releases/download/0.6.0/leaf-press-macos-10.15.tgz | tar xzf -
&& cd -
leaf-press init
leaf-press build
git clone https://github.com/danramteke/leaf-press.git
cd leaf-press
swift run leaf-press init
swift run leaf-press build
docker run -it --rm -v `pwd`:`pwd` -w `pwd` --platform linux/amd64 danramteke/leaf-press:0.6.0 leaf-press build
Or for development
docker run -it --rm -v `pwd`:`pwd` -w `pwd` --platform linux/amd64 swift:5.4-focal sh
mint install danramteke/leaf-press
leaf-press build
or
mint run danramteke/leaf-press leaf-press build
After the binary is installed locally, leaf-press init
will scaffold a fresh website for you.
After making changes, run leaf-press build
To scaffold a new blog post, with today's date as the default, run leaf-press new
Although leaf-press serve
isn't implemented yet, it prints out a docker command pointed at your current output directory.
LeafPress is built on Leaf, Vapor's templating engine. Here is the Leaf documentionation.
Configuration is stored in leaf-press.yml
.
distDir
: path to output dir, relative toleaf-press.yml
postsPublishPrefix
: prefix for blog posts. For example if you want them to render to aposts
folder or ablog
folderpagesDir
: path to pages directory, relative toleaf-press.yml
. Pages are standalone pages on the websitepostsDir
: path to posts directory, relative toleaf-press.yml
. Posts need to have a date, and are considered chronological.staticFilesDir
: path to static files. These are copied into the output directory without any processing. Useful for images, or for other assets that don't need processing.templatesDir
: path to templatespostBuildScript
can be used to run minification or CSS helpers.
Here are some projects live examples for reference, since sample projects don't always stay up to date.
- Daniel Delicious: GitLab Repo Website
- DanRamteke.com: GitHub Repo Website
After cloning the repo, generate an Xcode project with swift package generate-xcodeproj
. When adding or removing tests, remember to run swift test --generate-linuxmain
before committing and pushing your changes.
- main is the mainline branch. May be unstable.
- x.x.x tags are releases. Creating a tag will trigger a release build in github actions and on dockerhub.