schornio / static-website-generator
Generates files from Handlebar-Templates on the server
Package info
github.com/schornio/static-website-generator
pkg:composer/schornio/static-website-generator
v5.4.0
2021-05-06 12:38 UTC
Requires
- erusev/parsedown: ^1.7
- guzzlehttp/guzzle: ^6.3
- phpmailer/phpmailer: ^6.4
- zordius/lightncandy: ^1.2
This package is auto-updated.
Last update: 2026-06-20 02:02:38 UTC
README
composer require schornio/static-website-generator
Scripts
- sio-swg-compile: compiles
./componentsto stdout php-script - sio-swg-generator: each component has the opportunity to run a script at render time (
generator.php,function <component_name>_generator ()) - sio-swg-render: overwrites
./distwith given Storyblok content
Handlebar helpers
echojoinreplacetoJSONtoAlphaNumequalswitchcasesplituseDynamicmarkdowngetStorygetStoriesgetCurrentStoryurlresizeresolveSlugtextToSlugisActiveStoryrenderTimestampformatDatestoryblokToken- (
storyblokBridge)
Image Processor must be located at public/images
RewriteCond %{REQUEST_URI} ^/public/images/.+
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ public/imageProcessor.php [L]
Difference between static (.html) and dynamic (.php) content
The hbs-helper {{useDynamic}} markes a template as dynamic content. If at least one template in the render-chain is marked as dynamic then the resulting file will end in .php instead of .html.
{{useDynamic}}
<?php
// Dynamic content here
$data = json_decode("{{{toJSON data}}}");
?>
Special slug --fileextension-
If a slug contains (filename)--fileextension-(extension) the file will be stored as (filename).(extension). Eg sitemap--fileextension-xml will be converted to sitemap.xml