composer require schornio/static-website-generator
- 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
echo
join
replace
toJSON
toAlphaNum
equal
switch
case
split
useDynamic
markdown
getStory
getStories
getCurrentStory
url
resize
resolveSlug
textToSlug
isActiveStory
renderTimestamp
formatDate
storyblokToken
- (
storyblokBridge
)
RewriteCond %{REQUEST_URI} ^/public/images/.+
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ public/imageProcessor.php [L]
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}}}");
?>
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