helloandre / pressing
extensible library for static site generation
Requires
- php: ^5.4|^7.0
- twig/twig: ~1.9
This package is not auto-updated.
Last update: 2025-01-30 01:43:29 UTC
README
A Static Site Generator library for PHP.
Install
composer install helloandre/pressing
Usage
$config = [];
$pressing = new Pressing\Pressing;
$pressing->generate($config);
Config
Pressing Config
output_dir
- default: public/ - where the generated output will go.
input_dir
- default: src/ - where Pressing should look for files to move to output_dir
template_engine
- default: Twig - what engine to use to render templates
template_dir
- default: templates/ - where templates are located
Frontmatter
Each file may contain a frontmatter config that is JSON inside a top and bottom "marker" of three dashes as the very first thing in the file.
A file will be run through the template engine ONLY IF a frontmatter is found.
---
{ ... }
---
...
or empty
---
---
...
Any data contained within the frontmatter will be passed to the template.
Special Frontmatter
template
- default: none - declares which template to use.
Template Engines
currently available template engines: