punch
punch copied to clipboard
include snippet only during punch generate
Is there a way to include a snippet only during punch generate? I need to include a certain snippet only when the site is build.
Can you explain bit more about the use case?
If your snippet is a plugin, you can create a property for it config.json and toggle it between development/generation.
I think this could be useful for example including/excluding Google Analytics code which you would only want after statically generating.
{{#static_only}}
<script><!-- GA Code here --></script>
{{#static_only}}
or inversely
{{#dynamic_only}}
<!-- Debug only Code -->
{{/dynamic_only}}
I'm not sure if this is what the OP meant.