Pronounced ‘zerts’, it means to gulp something down quickly and/or in a greedy fashion
xertz is a static site generator with first-class support for Markdown and Handlebars templates
xertz requires Node.js to be installed and is distributed on npm. It can easily be installed and executed by using the npx tool, which is distributed with newer versions of Node.js.
npx xertz init [folder_name]
- Initializes a new xertz project
npx xertz new [Post Title]
- Create a new folder in posts/.
npx xertz serve
- Builds and serves a xertz project on http://localhost:8080. Also watches and rebuilds on any changes.
npx xertz build
- Buids a xertz project and outputs to _dist
folder.
When you initialize a xertz site, a directory will created that looks like this:
|-- my_site
|-- _layouts
|-- media
|-- posts
|-- styles
|-- _config.yml
|-- index.html.hbs
Configuration comes from one of these places, in order of precedence:
A file with the html.hbs
extension will be processed as a Handlebars template and have access to pages
data which will be an array of all pages in the current and subdirectories.
date
variable.slug
variable and effect the output path.If subdirectory of posts/
contains contains a file called index.md
, it will be deemed a Content Package Directory. This means all files within the directory will be processed as a unit and copied to a corresponding output directory.
For example, if you had a directory structure defined as:
|-- content
|-- 2019-03-13-crazy-pets
|-- index.md
|-- catz_lol.jpg
|-- doggy_do_little.jpg
The 2019-03-13-crazy-pets/
folder is considered a Content Package Directory. It would be output as:
|-- crazy-pets
|-- index.html
|-- catz_lol.jpg
|-- doggy_do_little.jpg
and accessible at https://youdomain.com/crazy-pets/
Any file with a _
prefix is ignored.
CSS and SaSS can be placed within any folder but when it is placed in the styles/
folder you have access to the styles within templates. This is useful, for example, if you want to inline your styles within a template with <style/>
rather than linking to a path with <link rel="stylesheet"/>
.
Any file with a _
prefix is ignored.
The following Handlebars helpers are made available in xertz:
{{ limit pages 15 }}
{{ filter pages "type" "post" }}
{{ iif excerpt site_description }}
{{ dateFormat "now" "yyyy" }}
{{{ indent my_text 4 }}}
{{#group pages by="year"}}
{{#encodeURI site_url}}