fix: don't prepend host url to external js if it starts with http:// or https://

This commit is contained in:
Vivek R
2019-12-31 10:11:22 +05:30
parent 76678b5559
commit 7aba720e77
3 changed files with 8 additions and 3 deletions

View File

@@ -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>