This is probably more of a Javascript question than a Nikola one, but I want to create a template shortcode that relies on a Javascript library. The dirt simple approach is to just have a `<script src=xxx>` element in the shortcode output, but that means that if I use the shortcode twice, I'll be loading the library twice. And any initialisation I do will happen twice, etc.
Is there a good way to put some sort of "do this once per page" block into a shortcode template, so that the actual shortcode logic can rely on it? The alternative, I guess, is to write a shortcode plugin which adds stuff to `site.template_hooks["extra_head"]`, but that seems like overkill here... Paul -- You received this message because you are subscribed to the Google Groups "nikola-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nikola-discuss/04bb4aaf-c5a3-4d39-9b8f-8547e07549aan%40googlegroups.com.
