From dfb6e1f80754c1c8f2d4d332c5292319f008a67b Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Wed, 27 May 2020 22:53:13 +0800 Subject: v2 original port --- layouts/partials/scripts-end.html | 146 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 layouts/partials/scripts-end.html (limited to 'layouts/partials/scripts-end.html') diff --git a/layouts/partials/scripts-end.html b/layouts/partials/scripts-end.html new file mode 100644 index 0000000..d82ab58 --- /dev/null +++ b/layouts/partials/scripts-end.html @@ -0,0 +1,146 @@ + + + + +{{ if and (and (ne .Params.noComments true) (.IsPage)) (.Site.Params.utterancesRepo) }} + +{{ else }} + +{{ end }} + +{{ with .Params.playerURL }} + +{{ end }} \ No newline at end of file -- cgit v1.2.3 From d47a131ca03b813b26345c752d41cc8999a646ce Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Fri, 29 May 2020 16:14:13 +0800 Subject: Fix highlight.js --- layouts/partials/scripts-end.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'layouts/partials/scripts-end.html') diff --git a/layouts/partials/scripts-end.html b/layouts/partials/scripts-end.html index d82ab58..ea37e5c 100644 --- a/layouts/partials/scripts-end.html +++ b/layouts/partials/scripts-end.html @@ -72,13 +72,15 @@ background: mediumTheme }); - // init highlight.js hljs.initHighlightingOnLoad(); // remove empty ul in toc if article only have ## and ### if ($('.sidebar-toc ul ul').length > 0 && $('.sidebar-toc ul ul li').text() === '') { $('.sidebar-toc ul ul').hide(); } + + // init highlight.js + hljs.initHighlighting(); {{ if and (and (ne .Params.noComments true) (.IsPage)) (.Site.Params.utterancesRepo) }} -- cgit v1.2.3 From 594655b050145b7c3beab06166678940e613a79a Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Fri, 29 May 2020 16:55:27 +0800 Subject: Disqus support --- layouts/partials/scripts-end.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'layouts/partials/scripts-end.html') diff --git a/layouts/partials/scripts-end.html b/layouts/partials/scripts-end.html index ea37e5c..39b3a00 100644 --- a/layouts/partials/scripts-end.html +++ b/layouts/partials/scripts-end.html @@ -118,6 +118,22 @@ } }); +{{ else if and (and (ne .Params.noComments true) (.IsPage)) (.Site.Params.disqusShortname) }} + {{ else }} - - - -{{ if and (and (ne .Params.noComments true) (.IsPage)) (.Site.Params.utterancesRepo) }} - -{{ else if and (and (ne .Params.noComments true) (.IsPage)) (.Site.Params.disqusShortname) }} - + + +{{ if .Site.Params.customHighlight }} + {{ else }} - + {{ end }} + {{ with .Params.playerURL }} + -{{ if .Site.Params.customHighlight }} - -{{ else }} - -{{ end }} - + + + {{ with .Params.playerURL }} -- cgit v1.2.3 From 02c3891865c7741b8f772aea75cc01564d2f0ff4 Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Mon, 1 Jun 2020 15:44:04 +0800 Subject: Remove jQuery --- layouts/partials/scripts-end.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'layouts/partials/scripts-end.html') diff --git a/layouts/partials/scripts-end.html b/layouts/partials/scripts-end.html index 1e02812..99f9e9e 100644 --- a/layouts/partials/scripts-end.html +++ b/layouts/partials/scripts-end.html @@ -1,8 +1,8 @@ + - {{ with .Params.playerURL }} @@ -19,5 +19,12 @@ cover: '{{ $.Params.playerCover }}' }] }); + // aplayer toc anchors fix + // see https://github.com/MoePlayer/APlayer/issues/242#issuecomment-602471423 + document.addEventListener('DOMContentLoaded', function () { + var issueTocEle = document.querySelector('.sidebar-toc'); + var newTocEle = issueTocEle.cloneNode(true); + issueTocEle.parentNode.replaceChild(newTocEle, issueTocEle); + }); {{ end }} \ No newline at end of file -- cgit v1.2.3 From e6afd04368f56af57b77f71be4dda5a4d9279a64 Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Tue, 2 Jun 2020 12:57:59 +0800 Subject: CDN support added --- layouts/partials/scripts-end.html | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'layouts/partials/scripts-end.html') diff --git a/layouts/partials/scripts-end.html b/layouts/partials/scripts-end.html index 99f9e9e..d992095 100644 --- a/layouts/partials/scripts-end.html +++ b/layouts/partials/scripts-end.html @@ -1,6 +1,10 @@ +{{ if .Site.Params.mainAssetsCDN }} + +{{ else }} +{{ end }} -- cgit v1.2.3 From 3df71601ae866aff9c2ae060ed1ac7407807fcc4 Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Wed, 3 Jun 2020 13:58:49 +0800 Subject: New comment area & opt out of font awesome --- layouts/partials/scripts-end.html | 2 ++ 1 file changed, 2 insertions(+) (limited to 'layouts/partials/scripts-end.html') diff --git a/layouts/partials/scripts-end.html b/layouts/partials/scripts-end.html index d992095..fee6e18 100644 --- a/layouts/partials/scripts-end.html +++ b/layouts/partials/scripts-end.html @@ -1,5 +1,7 @@ + + {{ if .Site.Params.mainAssetsCDN }} {{ else }} -- cgit v1.2.3 From dc8d94d73fa6f72c17b522e5bc4416129fae7967 Mon Sep 17 00:00:00 2001 From: amzrk2 Date: Wed, 3 Jun 2020 19:25:18 +0800 Subject: Fix aplayer toc anchors --- layouts/partials/scripts-end.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'layouts/partials/scripts-end.html') diff --git a/layouts/partials/scripts-end.html b/layouts/partials/scripts-end.html index fee6e18..3cbc866 100644 --- a/layouts/partials/scripts-end.html +++ b/layouts/partials/scripts-end.html @@ -29,8 +29,10 @@ // see https://github.com/MoePlayer/APlayer/issues/242#issuecomment-602471423 document.addEventListener('DOMContentLoaded', function () { var issueTocEle = document.querySelector('.sidebar-toc'); - var newTocEle = issueTocEle.cloneNode(true); - issueTocEle.parentNode.replaceChild(newTocEle, issueTocEle); + if (issueTocEle) { + var newTocEle = issueTocEle.cloneNode(true); + issueTocEle.parentNode.replaceChild(newTocEle, issueTocEle); + } }); {{ end }} \ No newline at end of file -- cgit v1.2.3