Basildon is a simple static website generator written in PHP and supporting Markdown content, Twig templates, SQLite, and outputs of HTML and PDF (via LaTeX).
composer require samwilson/basildon
- Add content and create templates (see below)
Content goes in the
content/ directory, in whatever structure is required.
Each file comprises two parts:
- a frontmatter block of Yaml-formatted metadata; and
- and a text body after the frontmatter, in any format
(the file's extension should match this, e.g. the default
Read more about Content.
Templates are written in the Twig language, and can output to any format required. Usually HTML is the target format, but LaTeX, XML, or anything else is just as possible. Formats do have to have a file extension though (that's how they're identified, in Basildon).
All templates live in the
templates/ directory of a site.
The structure within that directory can be anything.
Read more about Templates.
Assets (stylesheets and scripts)
Every stylesheet and script in the
will be copied to
Images should be in the
for more information, see the Content documentation page.
All output is in the
output/ directory of a site.
This directory is ready to be uploaded to a web server as the top level of the site.
output/ directory is emptied on every run of Basildon.
However, sometimes you need to be able to keep files or directories that persist.
For example, you might want
output/ to be its own Git repository for Github Pages,
or to add a
_redirects file for Netlify, or any number of other things.
This is possible with the
output_exclude config key,
which takes an array of regular expressions to be matched against relative paths
(these paths include the leading slash, similar to page IDs).
output_exclude: - "|/_redirects|" - "|/\\.git.*|"