Closed JOduMonT closed 4 years ago
ok, I change my approach and it work basically I reproduced how piwik is integrated then it mainly work (see the diff)
I would like some help for the mautic fragment
which I'm not sure it is possible since the code have to be manually cut and past from mautic anyway for now we need to integrate 2 variables such as
If it is just the JS that needs injection the config fragment as shown below should work. Memberspace was considered as a separate fragment due to it needing access to the navbar, but we haven't found a good generalized way of injecting it into other fragments such as nav.
A special mautic fragment would be ok, but would for now live outside the main repo until we have a clearer process of internal, external and commercial service fragments (aka fragments providing something specific to a service say netlify, mautic etc.). To clarify we do already have netlify integrated, but that is being thought about splitting out and revising. So we better not add more to this pile yet.
Happy for thoughts so.
+++
fragment = "config"
[[config]]
type = "js"
# block = true # Default is false
html = """
<script type="text/javascript">
if (typeof MauticSDKLoaded == 'undefined') {
var MauticSDKLoaded = true;
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = '{{ .Site.Params.mailing.mautic.domain }}/media/js/mautic-form.js';
script.onload = function() {
MauticSDK.onLoad();
};
head.appendChild(script);
var MauticDomain = '{{ .Site.Params.mailing.mautic.domain }}';
var MauticLang = {
'submittingMessage': "Please wait..."
}
}
</script>
"""
+++
Is this a BUG REPORT or FEATURE REQUEST?: feature
I read this
but didn't really understood how to make it happen
What happened:
I try to inject my mautic javascript inside this hugo theme, so I putted the code inside:
./assets/js/mautic.js
but the theme/hugo, don't bother to render it.What you expected to happen:
I was expecting this would be load by
./themes/syna/layouts/partials/js.html
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
If the principle is not already implemented, syna team could be inspired by https://sourcethemes.com/academic/docs/customization/#add-scripts-js
Environment: