schornio / static-website-generator
Generates files from Handlebar-Templates on the server
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
- dev-master
- v5.4.0
- v5.3.1
- v5.3.0
- v5.2.2
- v5.2.1
- v5.2.0
- v5.1.0
- v5.0.0
- v4.1.0
- v4.0.1
- v4.0.0
- v3.1.1
- v3.1.0
- v3.0.2
- v3.0.1
- v3.0.0
- v2.4.0
- v2.3.0
- v2.2.0
- v2.1.0
- v2.0.0
- v1.8.0
- v1.7.0
- v1.6.1
- v1.6.0
- v1.5.0
- v1.4.0
- v1.3.0
- v1.2.0
- v1.1.1
- v1.1.0
- v1.0.1
- v1.0.0
- dev-dependabot/composer/guzzlehttp/psr7-1.9.1
- dev-dependabot/composer/guzzlehttp/guzzle-6.5.8
- dev-dependabot/composer/phpmailer/phpmailer-6.5.0
This package is auto-updated.
Last update: 2025-03-19 23:17:47 UTC
README
composer require schornio/static-website-generator
Scripts
- sio-swg-compile: compiles
./components
to 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
./dist
with given Storyblok content
Handlebar helpers
echo
join
replace
toJSON
toAlphaNum
equal
switch
case
split
useDynamic
markdown
getStory
getStories
getCurrentStory
url
resize
resolveSlug
textToSlug
isActiveStory
renderTimestamp
formatDate
storyblokToken
- (
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