Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

include snippet only during punch generate #100

Open
constantx opened this issue Sep 11, 2013 · 2 comments
Open

include snippet only during punch generate #100

constantx opened this issue Sep 11, 2013 · 2 comments

Comments

@constantx
Copy link

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.

@laktek
Copy link
Owner

laktek commented Sep 14, 2013

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.

@bjfish
Copy link

bjfish commented Oct 19, 2013

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants