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

github.com/yoshiharuyamashita/blackburn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Birke <gabriel.birke@gmail.com>2018-03-19 00:24:43 +0300
committerGabriel Birke <gabriel.birke@gmail.com>2018-03-19 00:29:38 +0300
commita31925cea06c06362682ad5e7323b15f229dcfab (patch)
treea0338d8956ad863fa47d1ddaff2a3164ccc20d01 /layouts
parentf976ec9e543870fcf808491891f54ed40a91b36e (diff)
Allow external JS and CSS to be included
Allow params.custom_css and params.custom_js to contain HTTP and HTTPS URLs.
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/head.html12
1 files changed, 10 insertions, 2 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index f503bfb..f31a14b 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -52,10 +52,18 @@
{{ partial "favicon.html" . }}
{{ range .Site.Params.custom_css }}
- <link rel="stylesheet" href="{{ $.Site.BaseURL }}{{ . }}">
+ {{ if findRE "https?://" . }}
+ <link rel="stylesheet" href="{{ . }}">
+ {{ else }}
+ <link rel="stylesheet" href="{{ $.Site.BaseURL }}{{ . }}">
+ {{ end }}
{{ end }}
{{ range .Site.Params.custom_js }}
- <script src="{{ $.Site.BaseURL }}{{ . }}"></script>
+ {{ if findRE "https?://" . }}
+ <script src="{{ . }}"></script>
+ {{ else }}
+ <script src="{{ $.Site.BaseURL }}{{ . }}"></script>
+ {{ end }}
{{ end }}
</head>