diff options
author | Sebastian Pech <windows@spech.de> | 2020-05-10 12:52:43 +0300 |
---|---|---|
committer | Sebastian Pech <windows@spech.de> | 2020-05-10 12:52:43 +0300 |
commit | 9f00220df8dfb7252c917b9e4e1adef7126cbb85 (patch) | |
tree | fc5e8761419e483dcbab089fcb0d3b2c2aec1e97 | |
parent | 05ec3e5a234087dd9e5afe36b5c2a581d54ddefa (diff) |
jscdn, csscdn extended
-rw-r--r-- | README.md | 5 | ||||
-rw-r--r-- | layouts/partials/head.html | 4 | ||||
-rw-r--r-- | layouts/partials/js.html | 8 |
3 files changed, 17 insertions, 0 deletions
@@ -259,6 +259,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"] ``` @@ -267,7 +268,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 3114a3e..1f4bf11 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -31,6 +31,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 30950e7..63c885c 100644 --- a/layouts/partials/js.html +++ b/layouts/partials/js.html @@ -5,6 +5,14 @@ {{ $allscript := slice $jquery $bootstrap $mainjs $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> |