Maintainance updates (#2)

* delicious and google bookmarks discontinued

* delicious and google bookmarks discontinued

* fix: i18n keys

* Social services i18n keys had "line" as a key, fixed accordingly.

* fix: added missing share services

Added "telegram" and "whatsapp" in the list.

* fix: breadcrumb not turning-off when in term list

When breadcrumb is turned-off in config file, it remains available in `/categories/{term}/` and `/tags/{term}/ ` list view.

* fix: breadcrumb not turning-off when set in config

Fixed breadcrumb showing in "Section List" regardless of "false" setting in config params.

* upd: deprecated in Hugo v0.119.0, removed in Hugo v0.125.0

* fix: use hugo.IsServer as .Site.IsServer is deprecated

---------

Co-authored-by: I'M YourOnly.One <1079205+techmagus@users.noreply.github.com>
Co-authored-by: techmagus <techmagus@im.youronly.one>
This commit is contained in:
Rahat Zaman 2024-10-02 10:54:24 -06:00 committed by GitHub
parent 4736bfca22
commit eeac3af99b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 67 additions and 72 deletions

View File

@ -199,7 +199,7 @@ commento = false
paypal = ""
patreon = ""
# possible share name: ["facebook","twitter", "reddit", "linkedin", "tumblr", "weibo", "douban", "line", "pocket", "feedly", "hatena", "pinterest", "delicious", "google"]
# possible share name: ["facebook", "twitter", "reddit", "linkedin", "tumblr", "weibo", "douban", "line", "telegram", "whatsapp", "pocket", "feedly", "hatena", "pinterest"]
[[share]]
name = "facebook"
username = ""
@ -211,4 +211,4 @@ commento = false
link = ""
[[footerLinks]]
name = ""
link = ""
link = ""

View File

@ -2,7 +2,9 @@
<main class="main inner" data-sidebar-position="{{ $.Param "sidebarPosition" }}">
<div class="list__main {{ if $.Param "enableSidebar" }}{{ if eq ($.Param "sidebarPosition") "left" }}mr{{ else }}lm{{ end }}{{ else }}lmr{{ end }}">
{{ partial "body/breadcrumb" . }}
{{ if $.Param "enableBreadcrumb" }}
{{ partial "body/breadcrumb" . }}
{{ end }}
<header class="list__header">
<h5 class="list__header--title capitalize h5">{{.Title}}</h5>
</header>
@ -30,4 +32,4 @@
{{ partial "script/sidebar-script" . }}
{{ partial "script/list-script" . }}
{{ end }}
{{ end }}

View File

@ -2,7 +2,9 @@
<main class="main inner" data-sidebar-position="{{ $.Param "sidebarPosition" }}">
<div class="list__main {{ if $.Param "enableSidebar" }}{{ if eq ($.Param "sidebarPosition") "left" }}mr{{ else }}lm{{ end }}{{ else }}lmr{{ end }}">
{{ partial "body/breadcrumb" . }}
{{ if $.Param "enableBreadcrumb" }}
{{ partial "body/breadcrumb" . }}
{{ end }}
<header class="list__header">
<h5 class="list__header--title capitalize h5">{{ .Title }}</h5>
</header>
@ -29,4 +31,4 @@
{{ partial "script/sidebar-script" . }}
{{ partial "script/taxo-script" . }}
{{ end }}
{{ end }}

View File

@ -40,37 +40,29 @@
{{ partial "svgs/share/line.svg" (dict "width" 35 "height" 35) }}
</a>
{{ else if eq (lower .name) "telegram" }}
<a href='https://telegram.me/share/url?url=' onclick='window.open(&apos;https://telegram.me/share/url?url=&apos;+encodeURIComponent(location.href)+&apos;&amp;bodytext=&amp;tags=&amp;text=&apos;+encodeURIComponent(document.title));return false;' class="donation__item" target="_blank" rel="noreferrer" title="{{ i18n "line" | default "Telegram" }}" aria-label="Telegram Share Button" data-type="share">
<a href='https://telegram.me/share/url?url=' onclick='window.open(&apos;https://telegram.me/share/url?url=&apos;+encodeURIComponent(location.href)+&apos;&amp;bodytext=&amp;tags=&amp;text=&apos;+encodeURIComponent(document.title));return false;' class="donation__item" target="_blank" rel="noreferrer" title="{{ i18n "telegram" | default "Telegram" }}" aria-label="Telegram Share Button" data-type="share">
{{ partial "svgs/social/telegram.svg" (dict "width" 35 "height" 35) }}
</a>
{{ else if eq (lower .name) "whatsapp" }}
<a href="https://web.whatsapp.com/send?text={{ $ctx.Title }} - {{ $ctx.Permalink | absLangURL }}" data-href="{{ $ctx.Permalink | absLangURL }}" class="donation__item" target="_blank" rel="noreferrer" title="{{ i18n "line" | default "WhatsApp" }}" aria-label="WhatsApp Share Button" data-type="share">
<a href="https://web.whatsapp.com/send?text={{ $ctx.Title }} - {{ $ctx.Permalink | absLangURL }}" data-href="{{ $ctx.Permalink | absLangURL }}" class="donation__item" target="_blank" rel="noreferrer" title="{{ i18n "whatsapp" | default "WhatsApp" }}" aria-label="WhatsApp Share Button" data-type="share">
{{ partial "svgs/social/whatsapp.svg" (dict "width" 35 "height" 35) }}
</a>
{{ else if eq (lower .name) "pocket" }}
<a href="https://getpocket.com/save?url={{ $ctx.Permalink | absLangURL }}" class="donation__item" target="_blank" rel="noreferrer" title="{{ i18n "line" | default "Pocket" }}" aria-label="Pocket Share Button" data-type="share">
<a href="https://getpocket.com/save?url={{ $ctx.Permalink | absLangURL }}" class="donation__item" target="_blank" rel="noreferrer" title="{{ i18n "pocket" | default "Pocket" }}" aria-label="Pocket Share Button" data-type="share">
{{ partial "svgs/share/pocket.svg" (dict "width" 35 "height" 35) }}
</a>
{{ else if eq (lower .name) "feedly" }}
<a href="https://feedly.com/i/subscription/feed/{{ .Permalink | absLangURL }}index.xml" class="donation__item" target="_blank" rel="noreferrer" title="{{ i18n "line" | default "Feedly" }}" aria-label="Feedly Share Button" data-type="share">
<a href="https://feedly.com/i/subscription/feed/{{ .Permalink | absLangURL }}index.xml" class="donation__item" target="_blank" rel="noreferrer" title="{{ i18n "feedly" | default "Feedly" }}" aria-label="Feedly Share Button" data-type="share">
{{ partial "svgs/share/feedly.svg" (dict "width" 35 "height" 35) }}
</a>
{{ else if eq (lower .name) "hatena" }}
<a href="https://b.hatena.ne.jp/entry/panel/?btitle={{ $ctx.Title }}&url={{ $ctx.Permalink | absLangURL }}" title="{{ i18n "Hatena Blog" | default "Hatena Blog" }}" aria-label="Hatena Blog Share Button" class="donation__item" target="_blank" rel="noreferrer" data-type="share">
<a href="https://b.hatena.ne.jp/entry/panel/?btitle={{ $ctx.Title }}&url={{ $ctx.Permalink | absLangURL }}" title="{{ i18n "hatena" | default "Hatena Blog" }}" aria-label="Hatena Blog Share Button" class="donation__item" target="_blank" rel="noreferrer" data-type="share">
{{ partial "svgs/share/hatena.svg" (dict "width" 35 "height" 35) }}
</a>
{{ else if eq (lower .name) "pinterest" }}
<a href="http://www.pinterest.com/pin/create/button/?url={{ $ctx.Permalink | absLangURL }}{{ if $.Param "featured_image" }}&media={{ (print "images/" ($.Param "featured_image")) | absURL }}{{ else if $.Param "image" }}&media={{ $.Param "image" | absURL }}{{end}}&description={{ $ctx.Description }}" title="{{ i18n "Pinterest" | default "Pinterest" }}" aria-label="Pinterest Share Button" class="donation__item" target="_blank" rel="noreferrer" data-type="share">
<a href="http://www.pinterest.com/pin/create/button/?url={{ $ctx.Permalink | absLangURL }}{{ if $.Param "featured_image" }}&media={{ (print "images/" ($.Param "featured_image")) | absURL }}{{ else if $.Param "image" }}&media={{ $.Param "image" | absURL }}{{end}}&description={{ $ctx.Description }}" title="{{ i18n "pinterest" | default "Pinterest" }}" aria-label="Pinterest Share Button" class="donation__item" target="_blank" rel="noreferrer" data-type="share">
{{ partial "svgs/share/pinterest.svg" (dict "width" 35 "height" 35) }}
</a>
{{ else if eq (lower .name) "delicious" }}
<a href="http://www.delicious.com/save?url={{ $ctx.Permalink | absLangURL }}&title={{ $ctx.Title }}" title="{{ i18n "Delicious" | default "Delicious" }}" aria-label="Delicious Share Button" class="donation__item" target="_blank" rel="noreferrer" data-type="share">
{{ partial "svgs/share/delicious.svg" (dict "width" 35 "height" 35) }}
</a>
{{ else if eq (lower .name) "google" }}
<a href="https://www.google.com/bookmarks/mark?op=add&bkmk={{ $ctx.Permalink | absLangURL }}&title={{ $ctx.Title }}" title="{{ i18n "Google Bookmark" | default "Google Bookmark" }}" aria-label="Google Bookmark Share Button" class="donation__item" target="_blank" rel="noreferrer" data-type="share">
{{ partial "svgs/share/google.svg" (dict "width" 35 "height" 35) }}
</a>
{{ end }}
{{ end }}
</div>

View File

@ -1,14 +1,14 @@
{{ if and (.Site.Params.baiduAnalytics) (not .Site.IsServer) }}
<script>
{{ $baiduAnalyticsId := .Site.Params.baiduAnalytics }}
var baiduAnalyticsId = JSON.parse({{ $baiduAnalyticsId | jsonify }});
var _hmt = _hmt || [];
(function () {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?" + baiduAnalyticsId;
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
{{ end }}
{{ if and (.Site.Params.baiduAnalytics) (not hugo.IsServer) }}
<script>
{{ $baiduAnalyticsId := .Site.Params.baiduAnalytics }}
var baiduAnalyticsId = JSON.parse({{ $baiduAnalyticsId | jsonify }});
var _hmt = _hmt || [];
(function () {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?" + baiduAnalyticsId;
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
{{ end }}

View File

@ -1,15 +1,15 @@
{{ if and (not .Site.IsServer) (not ($.Param "disableAdsense")) }}
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins
class="adsbygoogle"
style="display:block; text-align:center;"
data-ad-layout="in-article"
data-ad-format="fluid"
data-ad-client="ca-pub-xxxxxx"
data-ad-slot="xxxxx"
>
</ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
{{ end }}
{{ if and (not hugo.IsServer) (not ($.Param "disableAdsense")) }}
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins
class="adsbygoogle"
style="display:block; text-align:center;"
data-ad-layout="in-article"
data-ad-format="fluid"
data-ad-client="ca-pub-xxxxxx"
data-ad-slot="xxxxx"
>
</ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
{{ end }}

View File

@ -1,4 +1,3 @@
{{ if not .Site.IsServer }}
{{ template "_internal/google_analytics.html" . }}
{{ template "_internal/google_analytics_async.html" . }}
{{ end }}
{{ if not hugo.IsServer }}
{{ template "_internal/google_analytics.html" . }}
{{ end }}

View File

@ -1,19 +1,19 @@
{{ if and ($.Site.Params.googleTagManager) (not .Site.IsServer) }}
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id={{ $.Site.Params.googleTagManager }}" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
{{ end }}
{{ if and ($.Site.Params.googleTagManager) (not .Site.IsServer) }}
<!-- Google Tag Manager -->
<!-- create dataLayer -->
<script>
var dataLayer = window.dataLayer = window.dataLayer || [];
dataLayer.push({
page:'{{ .Title }}',
categories:'only examples about your dataLayer'
});
</script>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','{{ $.Site.Params.googleTagManager }}');</script>
<!-- End Google Tag Manager -->
{{ end }}
{{ if and ($.Site.Params.googleTagManager) (not hugo.IsServer) }}
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id={{ $.Site.Params.googleTagManager }}" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
{{ end }}
{{ if and ($.Site.Params.googleTagManager) (not hugo.IsServer) }}
<!-- Google Tag Manager -->
<!-- create dataLayer -->
<script>
var dataLayer = window.dataLayer = window.dataLayer || [];
dataLayer.push({
page:'{{ .Title }}',
categories:'only examples about your dataLayer'
});
</script>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','{{ $.Site.Params.googleTagManager }}');</script>
<!-- End Google Tag Manager -->
{{ end }}