From 772d7335d3fb01cfd95a886e6a535f7f7e7ed979 Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Mon, 20 Apr 2020 16:29:46 +0800 Subject: Add webp checker for dev use --- layouts/partials/head.html | 14 ++++++++++-- layouts/partials/scripts.html | 50 +++++++++++++++++++++++++++---------------- 2 files changed, 43 insertions(+), 21 deletions(-) (limited to 'layouts/partials') diff --git a/layouts/partials/head.html b/layouts/partials/head.html index c5331cc..658030e 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -5,6 +5,7 @@ {{ hugo.Generator }} + {{ partial "favicon.html" . }} {{ if .IsHome }} @@ -18,20 +19,29 @@ {{ 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 }} + + +{{ if .Site.Params.webpChecker }} +{{ $webp := resources.Get "js/modernizr-webp.min.js" }} + +{{ end }} {{ with .Site.Params.cdnIntersectionObserverJS }} -{{ end }} + +{{ end }} + + {{ if or .Params.math .Site.Params.math }} {{ partial "math.html" . }} {{ end }} \ No newline at end of file diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index e807e36..d734202 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -1,13 +1,13 @@ - {{ if and (.IsPage) (.Site.Params.utterancesComment) }} + {{ end }} - {{ if .Site.Params.scrollTop }} + {{ end }} - +{{ if .Site.Params.webpChecker }} + + +{{ end }} +