Permalink
Browse files

Merge pull request #67 from gbirke/allow-external-resources

Allow external JS and CSS to be included
  • Loading branch information...
yoshiharuyamashita committed Apr 8, 2018
2 parents f976ec9 + a31925c commit 1bd3b1a49e8bc7f1236377fb8d65d947fc6f8af7
Showing with 13 additions and 5 deletions.
  1. +3 −3 README.md
  2. +10 −2 layouts/partials/head.html
@@ -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
@@ -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>

0 comments on commit 1bd3b1a

Please sign in to comment.