This is a bash utility intended to facilitate the generation of a static website.
A prime example is joelkleier.com -- the main motivation for the tool to exist in the first place.
Version 2.x is significantly different than version 1.x -- take a look at the 1.x branch if you're curious how the first version worked.
someplace.com folder in this repo is an example of a very basic site
that can be generated with this tool.
You need this installed:
- shyaml for reading yaml front matter
datefrom the coreutils project (usually installed by default on linux machines, on OS X coreutils needs to be installed with brew or equivalent)
The default configuration is setup to expect the following:
The help should be pretty explanitory for the command usage:
$ ef.sh help Version: 2.0.0 USAGE ----- ef.sh help -- print this help text ef.sh build -- build files that have changed since last run ef.sh fresh -- rebuild entire site regardless of timestamps ef.sh init -- generate a default efshrc and template files in the $PWD (this operation will overwrite any existing files) ----- The script looks for a efshrc file in the $PWD The script requires 'asciidoctor' (by default) to be installed and available on your PATH for asciidoc support. The script requires 'pandoc' (by default) to be installed and available on your PATH for markdown support. The script requires 'shyaml' to be installed. 'pip install shyaml' The script requires the coreutils GNU date command, on OS X 'brew install coreutils' and set EFSH_DATE_CMD to 'gdate' in your efshrc
The basic principle of the utility is:
- scan the PWD directory recursively
- pass each file through a mapped handler (mapped via file extension)
- if no handler for a file, the file is ignored
There are some built-in handlers:
- pandoc -- mapped to *.md by default
- asciidoctor -- mapped to *.adoc by default
- copy -- mapped, by default, to *.css, *.js, *.gif, *.jpg, *.jpeg, *.png, *.svg, and *.html
- blogindex -- mapped, by default, to *.blogindex
- siteindex -- mapped, by default, to *.siteindex
- rssatom -- mapped, by default, to *.rssatom
All of these handlers are defined as a set of bash methods with specially formatted names.
You associate a handler with a file extension in a sites
- make a way to specify a default handler for unknown filetypes
- make generated items the rss/atom handler be generated from templates instead of being hardcoded
- make a blog index item generated from a template instead of being hardcoded
- make it so handlers can be modularized in some fashion
- consider the possibility of doing something with tags
See anything else that you think should be added, changed, or fixed? Create an issue!
Enjoy! or don't...