From 7376c7f9e511b59638271861600305dd821c559a Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Thu, 23 Apr 2020 10:51:20 +0800 Subject: Optional CDN assets --- layouts/partials/head.html | 59 +++++++++++++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 19 deletions(-) (limited to 'layouts/partials/head.html') diff --git a/layouts/partials/head.html b/layouts/partials/head.html index f34ea88..9f3ef76 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,9 +1,9 @@ - - + + - - + + {{ hugo.Generator }} {{ partial "favicon.html" . }} @@ -13,32 +13,53 @@ {{ else }} {{ .Title }} - {{ .Site.Title }} {{ end }} - - + + {{ if .Params.tags }} - + {{ end }} {{ template "_internal/opengraph.html" . }} {{ template "_internal/twitter_cards.html" . }} - {{ partial "analytic-google.html" . }} {{ $options := (dict "targetPath" "css/main.min.css" "outputStyle" "compressed") }} -{{ $style := resources.Get "sass/main.scss" | resources.ToCSS $options }} - +{{ $style := resources.Get "sass/main.scss" | resources.ToCSS $options | resources.Fingerprint }} + - - - - +{{ if .Site.Params.useCDN }} + + + + + +{{ if or .Params.math .Site.Params.math }} + + + +{{ end }} +{{ else }} + +{{ $jquery := resources.Get "js/jquery.min.js" | resources.Fingerprint }} + +{{ $lazysizes := resources.Get "js/lazysizes.min.js" | resources.Fingerprint }} + +{{ $fontawesome := resources.Get "js/fontawesome.min.js" | resources.Fingerprint }} + + +{{ if or .Params.math .Site.Params.math }} +{{ $katexCSS := resources.Get "css/katex.min.css" | resources.Fingerprint }} + +{{ $katexJS := resources.Get "js/katex.min.js" | resources.Fingerprint }} + +{{ $katexRender := resources.Get "js/auto-render.min.js" | resources.Fingerprint }} + +{{ end }} +{{ end }} + + {{ if .Site.Params.webpChecker }} {{ $webp := resources.Get "js/modernizr-webp.min.js" }} -{{ end }} - - -{{ if or .Params.math .Site.Params.math }} -{{ partial "math.html" . }} {{ end }} \ No newline at end of file -- cgit v1.2.3