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:
authorYoshiharu Yamashita <yoshiharuyamashita@users.noreply.github.com>2018-04-08 11:54:53 +0300
committerGitHub <noreply@github.com>2018-04-08 11:54:53 +0300
commit1bd3b1a49e8bc7f1236377fb8d65d947fc6f8af7 (patch)
treea0338d8956ad863fa47d1ddaff2a3164ccc20d01
parentf976ec9e543870fcf808491891f54ed40a91b36e (diff)
parenta31925cea06c06362682ad5e7323b15f229dcfab (diff)
Merge pull request #67 from gbirke/allow-external-resources
Allow external JS and CSS to be included
-rw-r--r--README.md6
-rw-r--r--layouts/partials/head.html12
2 files changed, 13 insertions, 5 deletions
diff --git a/README.md b/README.md
index a6087ea..f6959c8 100644
--- a/README.md
+++ b/README.md
@@ -187,18 +187,18 @@ paginate = 10
url = "/about/"
```
-* Override the theme by linking to custom CSS files:
+* Override the theme by linking to custom CSS files or URLs:
```toml
[params]
custom_css = ["css/my.css"]
```
-* Add new behaviours by linking to custom JS files:
+* Add new behaviours by linking to custom JS files or URLs:
```toml
[params]
- custom_js = ["js/my.js"]
+ custom_js = ["js/my.js", "https://cdnjs.cloudflare.com/ajax/libs/zooming/1.4.2/zooming.min.js"]
```
## Shortcodes
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>