Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kakawait/hugo-tranquilpeak-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibaud LeprĂȘtre <thibaud.lepretre@gmail.com>2018-08-26 17:16:30 +0300
committerThibaud LeprĂȘtre <thibaud.lepretre@gmail.com>2018-08-26 17:16:30 +0300
commitf6339da62c5fbd902afc46bfc58b802a2d8f00be (patch)
treeb7807d64962c8151e783f57f7c0a67e1b90c0af1 /layouts
parent7694e6ecc18b7879b2e2091519c24a345486c6d1 (diff)
Fix script attr defer/async
On chrome you must not add `async=false` is not working properly to disable `async` instead you must no add attr fixes #186
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/script.html2
1 files changed, 1 insertions, 1 deletions
diff --git a/layouts/partials/script.html b/layouts/partials/script.html
index e119947..6e3a652 100644
--- a/layouts/partials/script.html
+++ b/layouts/partials/script.html
@@ -12,7 +12,7 @@
<!--SCRIPTS END-->
{{ range .Site.Params.customJS }}
{{ if isset . "src" }}
- <script{{ range $key, $value := . }} {{ if eq $key "src" }}{{ (printf "%s=\"%s\"" $key ($value | absURL)) | safeHTMLAttr }}{{ else }}{{ (printf "%s=\"%s\"" $key (string $value)) | safeHTMLAttr }}{{ end }}{{ end }}></script>
+ <script{{ range $key, $value := . }} {{ if eq $key "src" }}{{ (printf "%s=\"%s\"" $key ($value | absURL)) | safeHTMLAttr }}{{ else if and (in "async defer" $key) }}{{ if $value }}{{ (printf "%s" $key) | safeHTMLAttr }}{{ end }}{{ else }}{{ (printf "%s=\"%s\"" $key (string $value)) | safeHTMLAttr }}{{ end }}{{ end }}></script>
{{ else }}
<script src="{{ . | absURL }}"></script>
{{ end }}