How to add JavaScript for all the pages from the base.html?
What I did?
Created a JavaScript file ‘gamescript.html’ and the contents are below:
<script type="text/javascript">
atOptions = {
'key' : '983dqhf9ajfa763ha74hr6gafha7e',
'format' : 'iframe',
'height' : 360,
'width' : 468,
'params' : {}
};
document.write('<scr' + 'ipt type="text/javascript" src="http' + (location.protocol === 'https:' ? 's' : '') + '://www.gamedevenetwork.com/qhf9ajfa763ha74hr6ga/invoke.js"></scr' + 'ipt>');
</script>
And then I modified the base.html file like below. Change only line no 13 ie ‘{{ partial “gamescript.html” . }}’
<html class="nojs" lang="{{ site.LanguageCode | default site.Language.Lang }}" dir="{{ site.Language.LanguageDirection | default "ltr" }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>{{ block "title" . }}{{ .Title }} – {{ site.Title }}{{ end }}</title>
{{ partial "meta.html" . }}
{{ partialCached "styles.html" . }}
{{- block "head" . }}{{ end }}
{{ partial "meta_json_ld.html" . }}
{{ partial "scripts.html" . }}
{{ partial "math.html" . }}
{{ partial "gamescript.html" . }}
{{ partialCached "tracking.html" . }}
</head>
but it is not working.
Any suggestion, like I want to do?
Thank you in advance !