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') 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 }} + + + {{ if .Site.Params.webpChecker }} {{ $webp := resources.Get "js/modernizr-webp.min.js" }} {{ end }} -{{ with .Site.Params.cdnIntersectionObserverJS }} - -{{ end }} - - - {{ if or .Params.math .Site.Params.math }} diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index d734202..79befb5 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -86,12 +86,4 @@ }); }); -{{ end }} - - \ No newline at end of file +{{ end }} \ No newline at end of file diff --git a/layouts/shortcodes/lazyimg-col.html b/layouts/shortcodes/lazyimg-col.html index 0192ba5..0067762 100644 --- a/layouts/shortcodes/lazyimg-col.html +++ b/layouts/shortcodes/lazyimg-col.html @@ -1 +1 @@ -

{{ index .Params 0 }}

\ No newline at end of file +

{{ index .Params 0 }}

\ No newline at end of file diff --git a/layouts/shortcodes/lazyimg-row.html b/layouts/shortcodes/lazyimg-row.html index dd07f93..1e76de0 100644 --- a/layouts/shortcodes/lazyimg-row.html +++ b/layouts/shortcodes/lazyimg-row.html @@ -1 +1 @@ -

{{ index .Params 0 }}

\ No newline at end of file +

{{ index .Params 0 }}

\ No newline at end of file diff --git a/layouts/shortcodes/lazyimg.html b/layouts/shortcodes/lazyimg.html index a23a15e..468a901 100644 --- a/layouts/shortcodes/lazyimg.html +++ b/layouts/shortcodes/lazyimg.html @@ -1 +1 @@ -

{{ index .Params 0 }}

\ No newline at end of file +

{{ index .Params 0 }}

\ No newline at end of file -- cgit v1.2.3 From f2b712d0b0922d3b0fd116611589dc25719e2bf8 Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Wed, 22 Apr 2020 19:12:46 +0800 Subject: Adjust progressbar style --- layouts/partials/scripts.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'layouts') diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index 79befb5..c47a474 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -45,12 +45,11 @@ $(function () { var bar = new ProgressBar.Circle("#progress", { color: "#8AA2D3", - strokeWidth: 12, + strokeWidth: 10, trailColor: "#E5E2E4", - trailWidth: 12, + trailWidth: 10, text: { value: '{{ partial "fas/fa-angle-up" . }}', - autoStyleContainer: false, style: null }, fill: "#E5E2E4" -- cgit v1.2.3 From 49e162721ef7c83eb8859af8a83d6d1e95e5a79b Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Wed, 22 Apr 2020 19:22:13 +0800 Subject: Fix sidebar lazyload class --- layouts/partials/sidebar.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'layouts') diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 0c3770d..3b782c6 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -38,6 +38,6 @@ {{ with .Site.Params.bgmImageChart }}
{{ i18n "sidebarBangumiChart" }}
- +
{{ end }} \ No newline at end of file -- cgit v1.2.3 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/comment-utterances.html | 59 ++++++++++++++++++++++++++++++-- layouts/partials/favicon.html | 2 +- layouts/partials/head.html | 59 ++++++++++++++++++++++---------- layouts/partials/math.html | 5 --- 4 files changed, 97 insertions(+), 28 deletions(-) delete mode 100644 layouts/partials/math.html (limited to 'layouts') diff --git a/layouts/partials/comment-utterances.html b/layouts/partials/comment-utterances.html index f515a72..9411ee5 100644 --- a/layouts/partials/comment-utterances.html +++ b/layouts/partials/comment-utterances.html @@ -1,10 +1,63 @@
-
-
+
+
+
+
+

{{ i18n "postCommentLoading" }}

-
\ No newline at end of file diff --git a/layouts/partials/favicon.html b/layouts/partials/favicon.html index c152663..57afd18 100644 --- a/layouts/partials/favicon.html +++ b/layouts/partials/favicon.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file 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 diff --git a/layouts/partials/math.html b/layouts/partials/math.html deleted file mode 100644 index 621a2c8..0000000 --- a/layouts/partials/math.html +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file -- cgit v1.2.3 From 77ec19755260ec2e65ef284a63d28129c42d70dc Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Thu, 23 Apr 2020 11:50:45 +0800 Subject: Switch progressbar.js to fa --- layouts/_default/baseof.html | 4 +- layouts/partials/comment-utterances.html | 56 +------------------------ layouts/partials/fas/fa-angle-double-left.html | 1 - layouts/partials/fas/fa-angle-double-right.html | 1 - layouts/partials/fas/fa-angle-left.html | 1 - layouts/partials/fas/fa-angle-right.html | 1 - layouts/partials/fas/fa-angle-up.html | 1 - layouts/partials/head.html | 30 ++++++------- layouts/partials/scripts.html | 50 +++------------------- layouts/shortcodes/lazyimg-col.html | 2 +- layouts/shortcodes/lazyimg-row.html | 2 +- layouts/shortcodes/lazyimg.html | 2 +- 12 files changed, 27 insertions(+), 124 deletions(-) delete mode 100644 layouts/partials/fas/fa-angle-double-left.html delete mode 100644 layouts/partials/fas/fa-angle-double-right.html delete mode 100644 layouts/partials/fas/fa-angle-left.html delete mode 100644 layouts/partials/fas/fa-angle-right.html delete mode 100644 layouts/partials/fas/fa-angle-up.html (limited to 'layouts') diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index a1eb732..d6e53f4 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -15,8 +15,8 @@ -
-
+
+
diff --git a/layouts/partials/comment-utterances.html b/layouts/partials/comment-utterances.html index 9411ee5..d217238 100644 --- a/layouts/partials/comment-utterances.html +++ b/layouts/partials/comment-utterances.html @@ -1,59 +1,5 @@
-
-
-
-
-
- +

{{ i18n "postCommentLoading" }}

diff --git a/layouts/partials/fas/fa-angle-double-left.html b/layouts/partials/fas/fa-angle-double-left.html deleted file mode 100644 index 95887a1..0000000 --- a/layouts/partials/fas/fa-angle-double-left.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/layouts/partials/fas/fa-angle-double-right.html b/layouts/partials/fas/fa-angle-double-right.html deleted file mode 100644 index 998f859..0000000 --- a/layouts/partials/fas/fa-angle-double-right.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/layouts/partials/fas/fa-angle-left.html b/layouts/partials/fas/fa-angle-left.html deleted file mode 100644 index 39198fc..0000000 --- a/layouts/partials/fas/fa-angle-left.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/layouts/partials/fas/fa-angle-right.html b/layouts/partials/fas/fa-angle-right.html deleted file mode 100644 index 26cb61e..0000000 --- a/layouts/partials/fas/fa-angle-right.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/layouts/partials/fas/fa-angle-up.html b/layouts/partials/fas/fa-angle-up.html deleted file mode 100644 index 47ffb0b..0000000 --- a/layouts/partials/fas/fa-angle-up.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 9f3ef76..05670e5 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -25,14 +25,14 @@ {{ $options := (dict "targetPath" "css/main.min.css" "outputStyle" "compressed") }} -{{ $style := resources.Get "sass/main.scss" | resources.ToCSS $options | resources.Fingerprint }} - +{{ $style := resources.Get "sass/main.scss" | resources.ToCSS $options }} + {{ if .Site.Params.useCDN }} - + {{ if or .Params.math .Site.Params.math }} @@ -41,20 +41,20 @@ {{ 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 }} - +{{ $jquery := resources.Get "js/jquery.min.js" }} + +{{ $lazysizes := resources.Get "js/lazysizes.min.js" }} + +{{ $fontawesome := resources.Get "css/all.min.css" }} + {{ 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 }} - +{{ $katexCSS := resources.Get "css/katex.min.css" }} + +{{ $katexJS := resources.Get "js/katex.min.js" }} + +{{ $katexRender := resources.Get "js/auto-render.min.js" }} + {{ end }} {{ end }} diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index c47a474..8294611 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -2,38 +2,24 @@ +
\ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 241955d..be8f5bf 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,9 +1,5 @@ \ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 05670e5..305106d 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -33,12 +33,6 @@ - -{{ if or .Params.math .Site.Params.math }} - - - -{{ end }} {{ else }} {{ $jquery := resources.Get "js/jquery.min.js" }} @@ -47,15 +41,13 @@ {{ $fontawesome := resources.Get "css/all.min.css" }} +{{ end }} + {{ if or .Params.math .Site.Params.math }} -{{ $katexCSS := resources.Get "css/katex.min.css" }} - -{{ $katexJS := resources.Get "js/katex.min.js" }} - -{{ $katexRender := resources.Get "js/auto-render.min.js" }} - -{{ end }} + + + {{ end }} diff --git a/layouts/partials/post-meta.html b/layouts/partials/post-meta.html index 193b2fc..0164619 100644 --- a/layouts/partials/post-meta.html +++ b/layouts/partials/post-meta.html @@ -1,8 +1,8 @@ - + | - {{ .WordCount }}{{ i18n "postMetaWordCount" }} | + {{ .WordCount }}{{ i18n "postMetaWordCount" }} | {{ if .Params.tags }} diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index 8294611..a6dc367 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -41,8 +41,7 @@ $(function () { Modernizr.on("webp", function (result) { if (!result) { - $('

{{ i18n "webpCheckerFront" }}WebP{{ i18n "webpCheckerEnd" }}

') - .replaceAll("#content img"); + $('

{{ i18n "webpCheckerFront" }}WebP{{ i18n "webpCheckerEnd" }}

').replaceAll("#content img"); } }); }); -- cgit v1.2.3 From 14dececfd2ac91e1be402d3ebfff61974b3d76a1 Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Thu, 23 Apr 2020 14:14:13 +0800 Subject: Update font stack & resources --- layouts/partials/scripts.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'layouts') diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index a6dc367..48a056e 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -31,7 +31,7 @@ $("#scroll-top").click(function () { $("html, body").animate({ scrollTop: 0 - }, "slow"); + }); }); {{ end }} -- cgit v1.2.3 From d30f92f438636baf9ba364a30b87a182713696c5 Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Thu, 23 Apr 2020 14:33:14 +0800 Subject: Fix a space minify issue --- layouts/_default/list.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'layouts') diff --git a/layouts/_default/list.html b/layouts/_default/list.html index a4cdf89..a2d3b47 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -13,7 +13,7 @@ {{ .Summary }}
- READ MORE +  READ MORE 
{{ end }} -- cgit v1.2.3 From 79d5fe67c9e96e5de250cd74412d3ce7993ad862 Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Thu, 23 Apr 2020 14:37:43 +0800 Subject: Fix tags page pagination navbar --- layouts/_default/tag.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'layouts') diff --git a/layouts/_default/tag.html b/layouts/_default/tag.html index 026af4c..6a0d4d2 100644 --- a/layouts/_default/tag.html +++ b/layouts/_default/tag.html @@ -16,7 +16,7 @@ {{ .Summary }}
- READ MORE ... +  READ MORE 
{{ end }} @@ -71,7 +71,7 @@ {{ end }} {{ if ne $paginator.PageNumber $paginator.TotalPages }}
  • - READ MORE +
  • {{ end }} -- cgit v1.2.3 From 39d85cc63387f940dcfd6cef1a6d43d2cc4ebdf1 Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Thu, 23 Apr 2020 19:36:26 +0800 Subject: Support in-post or global APlayer --- layouts/_default/baseof.html | 5 +++++ layouts/_default/single.html | 3 +++ layouts/partials/head.html | 12 +++++++++++- layouts/partials/post-meta.html | 6 +++--- layouts/partials/scripts.html | 35 +++++++++++++++++++++++++++++++++++ 5 files changed, 57 insertions(+), 4 deletions(-) (limited to 'layouts') diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index d6e53f4..6df6ad6 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -15,9 +15,14 @@ + {{ if .Site.Params.playerURL }} +
    + {{ end }} + {{ if .Site.Params.scrollTop }}
    + {{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 04d016c..7bd92e8 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -6,6 +6,9 @@
    {{ partial "post-meta.html" . }}
    + {{ with .Params.playerURL }} +
    + {{ end }}
    {{ .Content }}
    diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 305106d..5b6de37 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -33,6 +33,10 @@ +{{ if or (.Site.Params.playerURL) (.Params.playerURL) }} + + +{{ end }} {{ else }} {{ $jquery := resources.Get "js/jquery.min.js" }} @@ -41,10 +45,16 @@ {{ $fontawesome := resources.Get "css/all.min.css" }} +{{ if or (.Site.Params.playerURL) (.Params.playerURL) }} +{{ $aplayerCSS := resources.Get "css/APlayer.min.css" }} + +{{ $aplayerJS := resources.Get "js/APlayer.min.js" }} + +{{ end }} {{ end }} -{{ if or .Params.math .Site.Params.math }} +{{ if or (.Params.math) (.Site.Params.math) }} diff --git a/layouts/partials/post-meta.html b/layouts/partials/post-meta.html index 0164619..7e5b47b 100644 --- a/layouts/partials/post-meta.html +++ b/layouts/partials/post-meta.html @@ -1,10 +1,10 @@ - + | - + {{ .WordCount }}{{ i18n "postMetaWordCount" }} | -