mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-17 10:59:13 +00:00
tpl/tmplimpl: Add MIME type to embedded JS
So they get minified correctly. See #5042
This commit is contained in:
parent
fb3cb05cc3
commit
755d1ffe7a
5 changed files with 8 additions and 8 deletions
|
@ -79,7 +79,7 @@ var EmbeddedTemplates = [][2]string{
|
||||||
{`disqus.html`, `{{- $pc := .Page.Site.Config.Privacy.Disqus -}}
|
{`disqus.html`, `{{- $pc := .Page.Site.Config.Privacy.Disqus -}}
|
||||||
{{- if not $pc.Disable -}}
|
{{- if not $pc.Disable -}}
|
||||||
{{ if .Site.DisqusShortname }}<div id="disqus_thread"></div>
|
{{ if .Site.DisqusShortname }}<div id="disqus_thread"></div>
|
||||||
<script>
|
<script type="application/javascript">
|
||||||
var disqus_config = function () {
|
var disqus_config = function () {
|
||||||
{{with .GetParam "disqus_identifier" }}this.page.identifier = '{{ . }}';{{end}}
|
{{with .GetParam "disqus_identifier" }}this.page.identifier = '{{ . }}';{{end}}
|
||||||
{{with .GetParam "disqus_title" }}this.page.title = '{{ . }}';{{end}}
|
{{with .GetParam "disqus_title" }}this.page.title = '{{ . }}';{{end}}
|
||||||
|
@ -102,7 +102,7 @@ var EmbeddedTemplates = [][2]string{
|
||||||
{`google_analytics.html`, `{{- $pc := .Site.Config.Privacy.GoogleAnalytics -}}
|
{`google_analytics.html`, `{{- $pc := .Site.Config.Privacy.GoogleAnalytics -}}
|
||||||
{{- if not $pc.Disable -}}
|
{{- if not $pc.Disable -}}
|
||||||
{{ with .Site.GoogleAnalytics }}
|
{{ with .Site.GoogleAnalytics }}
|
||||||
<script>
|
<script type="application/javascript">
|
||||||
{{ template "__ga_js_set_doNotTrack" $ }}
|
{{ template "__ga_js_set_doNotTrack" $ }}
|
||||||
if (!doNotTrack) {
|
if (!doNotTrack) {
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
|
@ -141,7 +141,7 @@ var doNotTrack = (dnt == "1" || dnt == "yes");
|
||||||
{`google_analytics_async.html`, `{{- $pc := .Site.Config.Privacy.GoogleAnalytics -}}
|
{`google_analytics_async.html`, `{{- $pc := .Site.Config.Privacy.GoogleAnalytics -}}
|
||||||
{{- if not $pc.Disable -}}
|
{{- if not $pc.Disable -}}
|
||||||
{{ with .Site.GoogleAnalytics }}
|
{{ with .Site.GoogleAnalytics }}
|
||||||
<script>
|
<script type="application/javascript">
|
||||||
{{ template "__ga_js_set_doNotTrack" $ }}
|
{{ template "__ga_js_set_doNotTrack" $ }}
|
||||||
if (!doNotTrack) {
|
if (!doNotTrack) {
|
||||||
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
|
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
|
||||||
|
@ -320,7 +320,7 @@ if (!doNotTrack) {
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</figure>
|
</figure>
|
||||||
<!-- image -->`},
|
<!-- image -->`},
|
||||||
{`shortcodes/gist.html`, `<script src="//gist.github.com/{{ index .Params 0 }}/{{ index .Params 1 }}.js{{if len .Params | eq 3 }}?file={{ index .Params 2 }}{{end}}"></script>`},
|
{`shortcodes/gist.html`, `<script type="application/javascript" src="//gist.github.com/{{ index .Params 0 }}/{{ index .Params 1 }}.js{{if len .Params | eq 3 }}?file={{ index .Params 2 }}{{end}}"></script>`},
|
||||||
{`shortcodes/highlight.html`, `{{ if len .Params | eq 2 }}{{ highlight (trim .Inner "\n\r") (.Get 0) (.Get 1) }}{{ else }}{{ highlight (trim .Inner "\n\r") (.Get 0) "" }}{{ end }}`},
|
{`shortcodes/highlight.html`, `{{ if len .Params | eq 2 }}{{ highlight (trim .Inner "\n\r") (.Get 0) (.Get 1) }}{{ else }}{{ highlight (trim .Inner "\n\r") (.Get 0) "" }}{{ end }}`},
|
||||||
{`shortcodes/instagram.html`, `{{- $pc := .Page.Site.Config.Privacy.Instagram -}}
|
{`shortcodes/instagram.html`, `{{- $pc := .Page.Site.Config.Privacy.Instagram -}}
|
||||||
{{- if not $pc.Disable -}}
|
{{- if not $pc.Disable -}}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{{- $pc := .Page.Site.Config.Privacy.Disqus -}}
|
{{- $pc := .Page.Site.Config.Privacy.Disqus -}}
|
||||||
{{- if not $pc.Disable -}}
|
{{- if not $pc.Disable -}}
|
||||||
{{ if .Site.DisqusShortname }}<div id="disqus_thread"></div>
|
{{ if .Site.DisqusShortname }}<div id="disqus_thread"></div>
|
||||||
<script>
|
<script type="application/javascript">
|
||||||
var disqus_config = function () {
|
var disqus_config = function () {
|
||||||
{{with .GetParam "disqus_identifier" }}this.page.identifier = '{{ . }}';{{end}}
|
{{with .GetParam "disqus_identifier" }}this.page.identifier = '{{ . }}';{{end}}
|
||||||
{{with .GetParam "disqus_title" }}this.page.title = '{{ . }}';{{end}}
|
{{with .GetParam "disqus_title" }}this.page.title = '{{ . }}';{{end}}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{{- $pc := .Site.Config.Privacy.GoogleAnalytics -}}
|
{{- $pc := .Site.Config.Privacy.GoogleAnalytics -}}
|
||||||
{{- if not $pc.Disable -}}
|
{{- if not $pc.Disable -}}
|
||||||
{{ with .Site.GoogleAnalytics }}
|
{{ with .Site.GoogleAnalytics }}
|
||||||
<script>
|
<script type="application/javascript">
|
||||||
{{ template "__ga_js_set_doNotTrack" $ }}
|
{{ template "__ga_js_set_doNotTrack" $ }}
|
||||||
if (!doNotTrack) {
|
if (!doNotTrack) {
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{{- $pc := .Site.Config.Privacy.GoogleAnalytics -}}
|
{{- $pc := .Site.Config.Privacy.GoogleAnalytics -}}
|
||||||
{{- if not $pc.Disable -}}
|
{{- if not $pc.Disable -}}
|
||||||
{{ with .Site.GoogleAnalytics }}
|
{{ with .Site.GoogleAnalytics }}
|
||||||
<script>
|
<script type="application/javascript">
|
||||||
{{ template "__ga_js_set_doNotTrack" $ }}
|
{{ template "__ga_js_set_doNotTrack" $ }}
|
||||||
if (!doNotTrack) {
|
if (!doNotTrack) {
|
||||||
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
|
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
<script src="//gist.github.com/{{ index .Params 0 }}/{{ index .Params 1 }}.js{{if len .Params | eq 3 }}?file={{ index .Params 2 }}{{end}}"></script>
|
<script type="application/javascript" src="//gist.github.com/{{ index .Params 0 }}/{{ index .Params 1 }}.js{{if len .Params | eq 3 }}?file={{ index .Params 2 }}{{end}}"></script>
|
Loading…
Add table
Reference in a new issue