From eeac3af99b4bbe1b1893fa640be834a8362a3690 Mon Sep 17 00:00:00 2001 From: Rahat Zaman Date: Wed, 2 Oct 2024 10:54:24 -0600 Subject: [PATCH] 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 --- exampleSite/config/_default/params.toml | 4 +- layouts/_default/list.html | 6 ++- layouts/_default/taxonomy.html | 6 ++- layouts/partials/body/share.html | 20 +++------- layouts/partials/service/baidu-analytics.html | 28 +++++++------- layouts/partials/service/google-adsense.html | 30 +++++++-------- .../partials/service/google-analytics.html | 7 ++-- .../partials/service/google-tag-manager.html | 38 +++++++++---------- 8 files changed, 67 insertions(+), 72 deletions(-) diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index 2d7b955..ffe005f 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -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 = "" \ No newline at end of file + link = "" diff --git a/layouts/_default/list.html b/layouts/_default/list.html index f154fd9..d5bf6e2 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -2,7 +2,9 @@
- {{ partial "body/breadcrumb" . }} + {{ if $.Param "enableBreadcrumb" }} + {{ partial "body/breadcrumb" . }} + {{ end }}
{{.Title}}
@@ -30,4 +32,4 @@ {{ partial "script/sidebar-script" . }} {{ partial "script/list-script" . }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html index 583e7eb..84d241f 100644 --- a/layouts/_default/taxonomy.html +++ b/layouts/_default/taxonomy.html @@ -2,7 +2,9 @@
- {{ partial "body/breadcrumb" . }} + {{ if $.Param "enableBreadcrumb" }} + {{ partial "body/breadcrumb" . }} + {{ end }}
{{ .Title }}
@@ -29,4 +31,4 @@ {{ partial "script/sidebar-script" . }} {{ partial "script/taxo-script" . }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/layouts/partials/body/share.html b/layouts/partials/body/share.html index 60467af..9d96422 100644 --- a/layouts/partials/body/share.html +++ b/layouts/partials/body/share.html @@ -40,37 +40,29 @@ {{ partial "svgs/share/line.svg" (dict "width" 35 "height" 35) }} {{ else if eq (lower .name) "telegram" }} - + {{ partial "svgs/social/telegram.svg" (dict "width" 35 "height" 35) }} {{ else if eq (lower .name) "whatsapp" }} - + {{ partial "svgs/social/whatsapp.svg" (dict "width" 35 "height" 35) }} {{ else if eq (lower .name) "pocket" }} - + {{ partial "svgs/share/pocket.svg" (dict "width" 35 "height" 35) }} {{ else if eq (lower .name) "feedly" }} - + {{ partial "svgs/share/feedly.svg" (dict "width" 35 "height" 35) }} {{ else if eq (lower .name) "hatena" }} - + {{ partial "svgs/share/hatena.svg" (dict "width" 35 "height" 35) }} {{ else if eq (lower .name) "pinterest" }} - + {{ partial "svgs/share/pinterest.svg" (dict "width" 35 "height" 35) }} - {{ else if eq (lower .name) "delicious" }} - - {{ partial "svgs/share/delicious.svg" (dict "width" 35 "height" 35) }} - - {{ else if eq (lower .name) "google" }} - - {{ partial "svgs/share/google.svg" (dict "width" 35 "height" 35) }} - {{ end }} {{ end }}
diff --git a/layouts/partials/service/baidu-analytics.html b/layouts/partials/service/baidu-analytics.html index 717e54f..c298a8b 100644 --- a/layouts/partials/service/baidu-analytics.html +++ b/layouts/partials/service/baidu-analytics.html @@ -1,14 +1,14 @@ -{{ if and (.Site.Params.baiduAnalytics) (not .Site.IsServer) }} - -{{ end }} \ No newline at end of file +{{ if and (.Site.Params.baiduAnalytics) (not hugo.IsServer) }} + +{{ end }} diff --git a/layouts/partials/service/google-adsense.html b/layouts/partials/service/google-adsense.html index c08df72..0857fd0 100644 --- a/layouts/partials/service/google-adsense.html +++ b/layouts/partials/service/google-adsense.html @@ -1,15 +1,15 @@ -{{ if and (not .Site.IsServer) (not ($.Param "disableAdsense")) }} - - - - -{{ end }} \ No newline at end of file +{{ if and (not hugo.IsServer) (not ($.Param "disableAdsense")) }} + + + + +{{ end }} diff --git a/layouts/partials/service/google-analytics.html b/layouts/partials/service/google-analytics.html index 3527c0e..bcbfcc0 100644 --- a/layouts/partials/service/google-analytics.html +++ b/layouts/partials/service/google-analytics.html @@ -1,4 +1,3 @@ -{{ if not .Site.IsServer }} - {{ template "_internal/google_analytics.html" . }} - {{ template "_internal/google_analytics_async.html" . }} -{{ end }} \ No newline at end of file +{{ if not hugo.IsServer }} + {{ template "_internal/google_analytics.html" . }} +{{ end }} diff --git a/layouts/partials/service/google-tag-manager.html b/layouts/partials/service/google-tag-manager.html index 82b90ef..e795fca 100644 --- a/layouts/partials/service/google-tag-manager.html +++ b/layouts/partials/service/google-tag-manager.html @@ -1,19 +1,19 @@ -{{ if and ($.Site.Params.googleTagManager) (not .Site.IsServer) }} - - - -{{ end }} - -{{ if and ($.Site.Params.googleTagManager) (not .Site.IsServer) }} - - - - - -{{ end }} +{{ if and ($.Site.Params.googleTagManager) (not hugo.IsServer) }} + + + +{{ end }} + +{{ if and ($.Site.Params.googleTagManager) (not hugo.IsServer) }} + + + + + +{{ end }}