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

github.com/vividvilla/ezhil.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek R <vividvilla@gmail.com>2019-12-31 07:41:22 +0300
committerVivek R <vividvilla@gmail.com>2019-12-31 07:41:22 +0300
commit7aba720e7744ecaea04f512f07d8f64c574ee406 (patch)
tree773739f5f93d2de33374c48f8942779be0a74513 /layouts
parent76678b55595595bc9313f78ae4290d1e3ae568d5 (diff)
fix: don't prepend host url to external js if it starts with http:// or https://
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/header.html4
1 files changed, 4 insertions, 0 deletions
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 3fa8a71..62e9d27 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -42,7 +42,11 @@
<script src="{{ .Site.BaseURL }}js/main.js"></script>
{{- if isset .Site.Params "customjs" -}}
{{- range .Site.Params.customJS }}
+ {{- if or (hasPrefix . "http://") (hasPrefix . "https://") }}
+ <script src="{{ . }}"></script>
+ {{- else }}
<script src="{{ $.Site.BaseURL }}{{ . }}"></script>
{{- end }}
{{- end }}
+ {{- end }}
</head>