From 9f00220df8dfb7252c917b9e4e1adef7126cbb85 Mon Sep 17 00:00:00 2001 From: Sebastian Pech Date: Sun, 10 May 2020 11:52:43 +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 8814104..ef8abed 100644 --- a/README.md +++ b/README.md @@ -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 @@ {{- 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 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" }} +{{- range .Site.Params.jscdn }} + +{{- end }} + +{{- range .Params.jscdn }} + +{{- end }} + {{- range .Site.Params.js }} {{ $pagescript := resources.Get . | minify | fingerprint "sha512" }} -- cgit v1.2.3