From 47d49fcaf0209232560d85b271066b15da34d0f5 Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Wed, 3 Nov 2021 16:52:40 +1100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=9A=20Move=20vendor=20includes=20to=20?= =?UTF-8?q?new=20partial?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- exampleSite/content/samples/charts.md | 1 + layouts/partials/head.html | 41 ++------------------------- layouts/partials/vendor.html | 39 +++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 39 deletions(-) create mode 100644 layouts/partials/vendor.html diff --git a/exampleSite/content/samples/charts.md b/exampleSite/content/samples/charts.md index 0732736e..9c35548b 100755 --- a/exampleSite/content/samples/charts.md +++ b/exampleSite/content/samples/charts.md @@ -77,6 +77,7 @@ data: { 'rgba(54, 162, 235, 0.7)', 'rgba(255, 205, 86, 0.7)' ], + borderWidth: 0, hoverOffset: 4 }] } diff --git a/layouts/partials/head.html b/layouts/partials/head.html index c44c57e7..c3ce9fd9 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -125,45 +125,8 @@ {{ range $name, $url := $links }}{{ end }} {{ end }} {{ end }} - {{/* Mermaid */}} - {{ if .Page.HasShortcode "mermaid" }} - {{ $mermaidJS := resources.Get "vendor/mermaid/mermaid.min.js" }} - {{ if $mermaidJS }} - {{ $mermaidJS := $mermaidJS | resources.Fingerprint "sha512" }} - - - {{ end }} - {{ end }} - {{/* Chart */}} - {{ if .Page.HasShortcode "chart" }} - {{ $chartJS := resources.Get "vendor/chart/chart.min.js" }} - {{ if $chartJS }} - {{ $chartJS := $chartJS | resources.Fingerprint "sha512" }} - - - {{ end }} - {{ end }} + {{/* Vendor */}} + {{ partial "vendor.html" . }} {{/* Analytics */}} {{ partialCached "analytics.html" .Site }} {{/* Extend head - eg. for custom analytics scripts, etc. */}} diff --git a/layouts/partials/vendor.html b/layouts/partials/vendor.html new file mode 100644 index 00000000..52ce1df3 --- /dev/null +++ b/layouts/partials/vendor.html @@ -0,0 +1,39 @@ +{{/* Mermaid */}} +{{ if .Page.HasShortcode "mermaid" }} + {{ $mermaidJS := resources.Get "vendor/mermaid/mermaid.min.js" }} + {{ if $mermaidJS }} + {{ $mermaidJS := $mermaidJS | resources.Fingerprint "sha512" }} + + {{ end }} +{{ end }} +{{/* Chart */}} +{{ if .Page.HasShortcode "chart" }} + {{ $chartJS := resources.Get "vendor/chart/chart.min.js" }} + {{ if $chartJS }} + {{ $chartJS := $chartJS | resources.Fingerprint "sha512" }} + + + {{ end }} +{{ end }}