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

github.com/spech66/bootstrap-bp-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pech <windows@spech.de>2020-05-10 12:52:45 +0300
committerSebastian Pech <windows@spech.de>2020-05-10 12:52:45 +0300
commitaea3c7c77e0ac484ae950a2015593599699266b8 (patch)
tree2db7c8b735797ab44d6a0484469adb4064dccb63
parentfabb8570b87a10f08e406a8424372acdba605588 (diff)
jscdn, csscdn extended
-rw-r--r--README.md5
-rw-r--r--layouts/partials/head.html4
-rw-r--r--layouts/partials/js.html8
3 files changed, 17 insertions, 0 deletions
diff --git a/README.md b/README.md
index afed8c1..84dbacb 100644
--- a/README.md
+++ b/README.md
@@ -249,6 +249,7 @@ The second way is using the Site configuration or the post metadata to target sp
```toml
[params]
js=["/js/test_site.js"]
+ jscdn=["https://cdn.jsdelivr.net/npm/vue@2.x/dist/vue.js"]
css=["/css/test_site.css"]
csscdn=["https://fonts.googleapis.com/css?family=Roboto&display=swap"]
```
@@ -257,7 +258,11 @@ The second way is using the Site configuration or the post metadata to target sp
---
js:
- /js/test.js
+jscdn:
+ - https://cdn.jsdelivr.net/npm/vue@2.x/dist/vue.js
css:
- /css/test.css
+csscdn:
+ - https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900
---
```
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 3a75478..2965065 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -29,6 +29,10 @@
<link rel="stylesheet" href="{{ . }}">
{{- end }}
+{{- range .Params.csscdn }}
+ <link rel="stylesheet" href="{{ . }}">
+{{- end }}
+
{{- range .Site.Params.css }}
{{ $pagestyle := resources.Get . | minify | fingerprint "sha512" }}
<link rel="stylesheet" href="{{ $pagestyle.RelPermalink }}" integrity="{{ $pagestyle.Data.Integrity }}">
diff --git a/layouts/partials/js.html b/layouts/partials/js.html
index 0aa07ec..5edcf02 100644
--- a/layouts/partials/js.html
+++ b/layouts/partials/js.html
@@ -4,6 +4,14 @@
{{ $allscript := slice $jquery $bootstrap $customjs | resources.Concat "/js/vendor.js" | minify | fingerprint "sha512" }}
<script src="{{ $allscript.RelPermalink }}" integrity="{{ $allscript.Data.Integrity }}"></script>
+{{- range .Site.Params.jscdn }}
+ <script src="{{ . }}"></script>
+{{- end }}
+
+{{- range .Params.jscdn }}
+ <script src="{{ . }}"></script>
+{{- end }}
+
{{- range .Site.Params.js }}
{{ $pagescript := resources.Get . | minify | fingerprint "sha512" }}
<script src="{{ $pagescript.RelPermalink }}" integrity="{{ $pagescript.Data.Integrity }}"></script>