From aea3c7c77e0ac484ae950a2015593599699266b8 Mon Sep 17 00:00:00 2001 From: Sebastian Pech Date: Sun, 10 May 2020 11:52:45 +0200 Subject: jscdn, csscdn extended --- README.md | 5 +++++ layouts/partials/head.html | 4 ++++ layouts/partials/js.html | 8 ++++++++ 3 files changed, 17 insertions(+) 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 @@ {{- end }} +{{- range .Params.csscdn }} + +{{- end }} + {{- range .Site.Params.css }} {{ $pagestyle := resources.Get . | minify | fingerprint "sha512" }} 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" }} +{{- range .Site.Params.jscdn }} + +{{- end }} + +{{- range .Params.jscdn }} + +{{- end }} + {{- range .Site.Params.js }} {{ $pagescript := resources.Get . | minify | fingerprint "sha512" }} -- cgit v1.2.3