From 2e6c4ab9d218ddf30f390a1d911e6056df4965be Mon Sep 17 00:00:00 2001 From: xiaoqing Date: Sat, 16 Dec 2023 23:45:10 +0800 Subject: [PATCH 1/2] 1. Display page count for paginated titles 2. The canonical URL for pagination is the same as the page URL. --- i18n/am.toml | 8 ++++- i18n/ar.toml | 6 ++++ i18n/ca.toml | 6 ++++ i18n/de.toml | 6 ++++ i18n/el.toml | 6 ++++ i18n/en.toml | 6 ++++ i18n/es.toml | 6 ++++ i18n/fr.toml | 7 +++++ i18n/hi.toml | 8 ++++- i18n/id.toml | 6 ++++ i18n/it.toml | 6 ++++ i18n/ko.toml | 6 ++++ i18n/pl.toml | 6 ++++ i18n/pt-BR.toml | 6 ++++ i18n/pt-PT.toml | 6 ++++ i18n/ro.toml | 6 ++++ i18n/ru.toml | 6 ++++ i18n/sr.toml | 6 ++++ i18n/te.toml | 8 ++++- i18n/th.toml | 6 ++++ i18n/ti.toml | 8 ++++- i18n/tr.toml | 6 ++++ i18n/uk.toml | 6 ++++ i18n/vi.toml | 6 ++++ i18n/zh-CN.toml | 5 ++++ i18n/zh-TW.toml | 6 ++++ layouts/_default/baseof.html | 8 +++++ layouts/_default/section.html | 16 +++++----- layouts/index.html | 24 +++++++-------- layouts/partials/head/link.html | 6 +++- layouts/partials/head/paginator.html | 45 ++++++++++++++++++++++++++++ layouts/taxonomy/list.html | 25 ++++++---------- 32 files changed, 247 insertions(+), 41 deletions(-) create mode 100644 layouts/partials/head/paginator.html diff --git a/i18n/am.toml b/i18n/am.toml index af96c51de..31af640f0 100644 --- a/i18n/am.toml +++ b/i18n/am.toml @@ -1,4 +1,4 @@ -# Translations for English +# Translations for Amharic # https://gohugo.io/content-management/multilingual/#translation-of-strings # === baseof == @@ -252,3 +252,9 @@ other = "ተለውጧል" [deleted] other = "ተሰርዟል።" # === shortcodes/version.html === + +[prefixPageNumber] +other = "ገጽ" + +[suffixPageNumber] +other = " " diff --git a/i18n/ar.toml b/i18n/ar.toml index d6a79f88e..6a7725f5d 100644 --- a/i18n/ar.toml +++ b/i18n/ar.toml @@ -192,3 +192,9 @@ other = "تم تعديله" [deleted] other = "حُذف" # === shortcodes/version.html === + +[prefixPageNumber] +other = " " + +[suffixPageNumber] +other = "الصفحة" diff --git a/i18n/ca.toml b/i18n/ca.toml index 69ddfc6e5..b45781349 100644 --- a/i18n/ca.toml +++ b/i18n/ca.toml @@ -192,3 +192,9 @@ other = "CANVIAT" [deleted] other = "SUPRIMIT" # === shortcodes/version.html === + +[prefixPageNumber] +other = "Página" + +[suffixPageNumber] +other = " " diff --git a/i18n/de.toml b/i18n/de.toml index 5b113e289..cef7ee10c 100644 --- a/i18n/de.toml +++ b/i18n/de.toml @@ -191,3 +191,9 @@ other = "GEÄNDERT" [deleted] other = "GELÖSCHT" # === shortcodes/version.html === + +[prefixPageNumber] +other = "Seite" + +[suffixPageNumber] +other = " " diff --git a/i18n/el.toml b/i18n/el.toml index 515fec6b5..5eaf35b7d 100644 --- a/i18n/el.toml +++ b/i18n/el.toml @@ -196,3 +196,9 @@ other = "ΑΛΛΑΓΜΕΝΟ" [deleted] other = "ΔΙΑΓΡΑΜΜΕΝΟ" # === shortcodes/version.html === + +[prefixPageNumber] +other = "Σελίδα" + +[suffixPageNumber] +other = " " diff --git a/i18n/en.toml b/i18n/en.toml index a7cb04aeb..202b068a3 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -252,3 +252,9 @@ other = "CHANGED" [deleted] other = "DELETED" # === shortcodes/version.html === + +[prefixPageNumber] +other = "Page" + +[suffixPageNumber] +other = " " diff --git a/i18n/es.toml b/i18n/es.toml index 288f19628..d01eff550 100644 --- a/i18n/es.toml +++ b/i18n/es.toml @@ -235,3 +235,9 @@ other = "MODIFICADO" [deleted] other = "ELIMINADO" # === shortcodes/version.html === + +[prefixPageNumber] +other = "Página" + +[suffixPageNumber] +other = " " diff --git a/i18n/fr.toml b/i18n/fr.toml index 4c4df87f1..7c3f1f248 100644 --- a/i18n/fr.toml +++ b/i18n/fr.toml @@ -256,3 +256,10 @@ other = "CHANGÉ" [deleted] other = "EFFACÉ" # === shortcodes/version.html === + +[prefixPageNumber] +other = "Page" + +[suffixPageNumber] +other = " " + diff --git a/i18n/hi.toml b/i18n/hi.toml index 26f2c930e..bf39d027e 100644 --- a/i18n/hi.toml +++ b/i18n/hi.toml @@ -191,4 +191,10 @@ other = "बदला हुआ" [deleted] other = "हटाए गए" -# === shortcodes/version.html === \ No newline at end of file +# === shortcodes/version.html === + +[prefixPageNumber] +other = "पृष्ठ" + +[suffixPageNumber] +other = " " diff --git a/i18n/id.toml b/i18n/id.toml index 72da3d83f..fefd9b8b5 100644 --- a/i18n/id.toml +++ b/i18n/id.toml @@ -192,3 +192,9 @@ other = "BERUBAH" [deleted] other = "DIHAPUS" # === shortcodes/version.html === + +[prefixPageNumber] +other = "Halaman" + +[suffixPageNumber] +other = " " diff --git a/i18n/it.toml b/i18n/it.toml index e074b03ce..20b8ee7a8 100644 --- a/i18n/it.toml +++ b/i18n/it.toml @@ -191,3 +191,9 @@ other = "CAMBIATO" [deleted] other = "CANCELLATO" # === shortcodes/version.html === + +[prefixPageNumber] +other = "Pagina" + +[suffixPageNumber] +other = " " diff --git a/i18n/ko.toml b/i18n/ko.toml index 83cc97031..85af682c5 100644 --- a/i18n/ko.toml +++ b/i18n/ko.toml @@ -218,3 +218,9 @@ other = "변경" [deleted] other = "삭제" # === shortcodes/version.html === + +[prefixPageNumber] +other = " " + +[suffixPageNumber] +other = "페이지" diff --git a/i18n/pl.toml b/i18n/pl.toml index 0743c5bab..6e5222c95 100644 --- a/i18n/pl.toml +++ b/i18n/pl.toml @@ -191,3 +191,9 @@ other = "Zmieniono" [deleted] other = "Usunięte" # === shortcodes/version.html === + +[prefixPageNumber] +other = "Strona" + +[suffixPageNumber] +other = " " diff --git a/i18n/pt-BR.toml b/i18n/pt-BR.toml index f9db82ad6..929ccd8d7 100644 --- a/i18n/pt-BR.toml +++ b/i18n/pt-BR.toml @@ -251,3 +251,9 @@ other = "ALTERADO" [deleted] other = "EXCLUÍDO" # === shortcodes/version.html === + +[prefixPageNumber] +other = "Página" + +[suffixPageNumber] +other = " " diff --git a/i18n/pt-PT.toml b/i18n/pt-PT.toml index 47d50f6ba..21bf77390 100644 --- a/i18n/pt-PT.toml +++ b/i18n/pt-PT.toml @@ -251,3 +251,9 @@ other = "ALTERADO" [deleted] other = "EXCLUÍDO" # === shortcodes/version.html === + +[prefixPageNumber] +other = "Página" + +[suffixPageNumber] +other = " " diff --git a/i18n/ro.toml b/i18n/ro.toml index 1b80587d9..d5033b6af 100644 --- a/i18n/ro.toml +++ b/i18n/ro.toml @@ -191,3 +191,9 @@ other = "SCHIMBAT" [deleted] other = "ȘTERS" # === shortcodes/version.html === + +[prefixPageNumber] +other = "Pagină" + +[suffixPageNumber] +other = " " diff --git a/i18n/ru.toml b/i18n/ru.toml index 662a76dec..9d1fef82c 100644 --- a/i18n/ru.toml +++ b/i18n/ru.toml @@ -252,3 +252,9 @@ other = "ИЗМЕНЕН" [deleted] other = "УДАЛЕН" # === shortcodes/version.html === + +[prefixPageNumber] +other = "Стр." + +[suffixPageNumber] +other = " " diff --git a/i18n/sr.toml b/i18n/sr.toml index 39ebd91f3..fbd0713ef 100644 --- a/i18n/sr.toml +++ b/i18n/sr.toml @@ -191,3 +191,9 @@ other = "ПРОМЕЊЕНО" [deleted] other = "ОБРИСАНО" # === shortcodes/version.html === + +[prefixPageNumber] +other = "Страница" + +[suffixPageNumber] +other = " " diff --git a/i18n/te.toml b/i18n/te.toml index 4104e2af3..42ad41300 100644 --- a/i18n/te.toml +++ b/i18n/te.toml @@ -192,4 +192,10 @@ other = "మార్చబడింది" [deleted] other = "తొలగించిన" -# === shortcodes/version.html === \ No newline at end of file +# === shortcodes/version.html === + +[prefixPageNumber] +other = "పుట" + +[suffixPageNumber] +other = " " diff --git a/i18n/th.toml b/i18n/th.toml index d0e3f25fe..3ddff9db6 100644 --- a/i18n/th.toml +++ b/i18n/th.toml @@ -192,3 +192,9 @@ other = "เปลี่ยนแปลง" [deleted] other = "ลบ" # === shortcodes/version.html === + +[prefixPageNumber] +other = "หน้า" + +[suffixPageNumber] +other = " " diff --git a/i18n/ti.toml b/i18n/ti.toml index 2fd7df56f..6ed081681 100644 --- a/i18n/ti.toml +++ b/i18n/ti.toml @@ -1,4 +1,4 @@ -# Translations for English +# Translations for Tigrinya # https://gohugo.io/content-management/multilingual/#translation-of-strings # === baseof == @@ -252,3 +252,9 @@ other = "ተለዊጡ" [deleted] other = "ተደምሲሱ" # === shortcodes/version.html === + +[prefixPageNumber] +other = "ስራሕ" + +[suffixPageNumber] +other = " " diff --git a/i18n/tr.toml b/i18n/tr.toml index 6df8c630e..31345cf1c 100644 --- a/i18n/tr.toml +++ b/i18n/tr.toml @@ -253,3 +253,9 @@ other = "DEĞİŞTİRİLDİ" [deleted] other = "SİLİNDİ" # === shortcodes/version.html === + +[prefixPageNumber] +other = "Sayfa" + +[suffixPageNumber] +other = " " diff --git a/i18n/uk.toml b/i18n/uk.toml index 1b6eb5c3c..a765f6b59 100644 --- a/i18n/uk.toml +++ b/i18n/uk.toml @@ -193,3 +193,9 @@ other = "ЗМІНЕНИЙ" [deleted] other = "ВИДАЛЕНИЙ" # === shortcodes/version.html === + +[prefixPageNumber] +other = "Cторінка" + +[suffixPageNumber] +other = " " diff --git a/i18n/vi.toml b/i18n/vi.toml index 2a5da99eb..52a2d8924 100644 --- a/i18n/vi.toml +++ b/i18n/vi.toml @@ -252,3 +252,9 @@ other = "THAY ĐỔI" [deleted] other = "XOÁ" # === shortcodes/version.html === + +[prefixPageNumber] +other = "Trang" + +[suffixPageNumber] +other = " " diff --git a/i18n/zh-CN.toml b/i18n/zh-CN.toml index 67f0c851a..acc51cf30 100644 --- a/i18n/zh-CN.toml +++ b/i18n/zh-CN.toml @@ -251,3 +251,8 @@ other = "更改" other = "删除" # === shortcodes/version.html === +[prefixPageNumber] +other = "第" + +[suffixPageNumber] +other = "页" diff --git a/i18n/zh-TW.toml b/i18n/zh-TW.toml index 427d566dd..643b63b53 100644 --- a/i18n/zh-TW.toml +++ b/i18n/zh-TW.toml @@ -189,3 +189,9 @@ other = "更改" [deleted] other = "刪除" # === shortcodes/version.html === + +[prefixPageNumber] +other = "第" + +[suffixPageNumber] +other = "頁" diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 950cff59f..c132c5270 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -7,6 +7,14 @@ + + {{- /* Paginate */ -}} + {{- /* Paginate in here, To solve the problem of the canonical URL being the same in the pagination */ -}} + {{- /* see more https://github.com/gohugoio/hugo/issues/4507 */ -}} + {{- /* see more https://discourse.gohugo.io/t/control-pagination-and-page-collections-from-baseof-html/37643/8 */ -}} + {{- /* see more https://discourse.gohugo.io/t/determine-if-current-page-is-result-of-pagination/37494/4 */ -}} + {{- partial "head/paginator.html" . -}} + {{- block "title" . }}{{ .Site.Title }}{{ end -}} diff --git a/layouts/_default/section.html b/layouts/_default/section.html index 186601626..b6ba5ef0b 100644 --- a/layouts/_default/section.html +++ b/layouts/_default/section.html @@ -1,5 +1,10 @@ {{- define "title" }} - {{- .Params.Title | default (T .Section) | default .Section | dict "Some" | T "allSome" }} - {{ .Site.Title -}} + {{- if (gt .Paginator.PageNumber 1) -}} + {{ $pageNumber := printf "%v %v %v" (T "prefixPageNumber" ) .Paginator.PageNumber (T "suffixPageNumber" ) }} + {{- .Params.Title | default (T .Section) | default .Section | dict "Some" | T "allSome" }} {{ $pageNumber }} - {{ .Site.Title -}} + {{- else -}} + {{- .Params.Title | default (T .Section) | default .Section | dict "Some" | T "allSome" }} - {{ .Site.Title -}} + {{- end -}} {{- end -}} {{- define "content" -}} @@ -10,15 +15,10 @@

{{- /* Paginate */ -}} + {{- /* Paginate is first call on baseof.html */ -}} {{- if .Pages -}} - {{- $pages := .Pages.GroupByDate "2006" -}} - {{- with .Site.Params.section.paginate | default .Site.Params.paginate -}} - {{- $pages = $.Paginate $pages . -}} - {{- else -}} - {{- $pages = .Paginate $pages -}} - {{- end -}} {{- partial "recentlyUpdated.html" . -}} - {{- range $pages.PageGroups -}} + {{- range .Paginator.PageGroups -}}

{{ .Key }}

{{- range .Pages -}}
diff --git a/layouts/index.html b/layouts/index.html index d603a9825..352ab18dc 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,3 +1,13 @@ +{{- define "title" }} + {{- with .Scratch.Get "paginatorPager" -}} + {{- if gt .PageNumber 1 -}} + {{- T "prefixPageNumber" }} {{ .PageNumber }} {{ T "suffixPageNumber" }} - {{ $.Site.Title -}} + {{ else }} + {{- $.Site.Title -}} + {{- end -}} + {{- end -}} +{{- end -}} + {{- define "content" -}} {{- $params := .Scratch.Get "params" -}} {{- $profile := .Site.Params.home.profile -}} @@ -21,18 +31,8 @@ {{- /* Posts */ -}} {{- if ne $posts.enable false | and .Site.RegularPages -}} {{- /* Paginate */ -}} - {{- $pages := where .Site.RegularPages "Type" "in" site.Params.mainSections -}} - {{- if .Site.Params.page.hiddenFromHomePage -}} - {{- $pages = where $pages "Params.hiddenfromhomepage" false -}} - {{- else -}} - {{- $pages = where $pages "Params.hiddenfromhomepage" "!=" true -}} - {{- end -}} - {{- with $posts.paginate | default .Site.Params.paginate -}} - {{- $pages = $.Paginate $pages . -}} - {{- else -}} - {{- $pages = .Paginate $pages -}} - {{- end -}} - {{- range $pages.Pages -}} + {{- /* Paginate is first call on baseof.html */ -}} + {{- range .Paginator.Pages -}} {{- .Render "summary" -}} {{- end -}} {{- partial "paginator.html" . -}} diff --git a/layouts/partials/head/link.html b/layouts/partials/head/link.html index 432e8b36b..8cdcd41a9 100644 --- a/layouts/partials/head/link.html +++ b/layouts/partials/head/link.html @@ -18,7 +18,11 @@ {{- end -}} {{- end -}} - +{{ $canonicalURL := .Permalink }} +{{ with .Scratch.Get "paginatorPager" }} + {{ $canonicalURL = .URL | absLangURL }} +{{ end }} + {{- if .PrevInSection -}} {{- end -}} diff --git a/layouts/partials/head/paginator.html b/layouts/partials/head/paginator.html new file mode 100644 index 000000000..7cf9e0332 --- /dev/null +++ b/layouts/partials/head/paginator.html @@ -0,0 +1,45 @@ +{{- if .IsHome -}} + {{- $posts := .Site.Params.home.posts -}} + {{- if ne $posts.enable false | and .Site.RegularPages -}} + {{- $pages := where .Site.RegularPages "Type" "in" site.Params.mainSections -}} + {{- if .Site.Params.page.hiddenFromHomePage -}} + {{- $pages = where $pages "Params.hiddenfromhomepage" false -}} + {{- else -}} + {{- $pages = where $pages "Params.hiddenfromhomepage" "!=" true -}} + {{- end -}} + {{- with $posts.paginate | default .Site.Params.paginate -}} + {{- $pages = $.Paginate $pages . -}} + {{- else -}} + {{- $pages = .Paginate $pages -}} + {{- end -}} + {{- .Scratch.Set "paginatorPager" $pages -}} + {{- end -}} + +{{- else if and .IsSection .Pages -}} + {{- $pages := .Pages.GroupByDate "2006" -}} + {{- with .Site.Params.section.paginate | default .Site.Params.paginate -}} + {{- $pages = $.Paginate $pages . -}} + {{- else -}} + {{- $pages = .Paginate $pages -}} + {{- end -}} + {{- .Scratch.Set "paginatorPager" $pages -}} +{{- else if and (eq .Kind "term") .Pages -}} + {{- $taxonomy := .Data.Singular -}} + {{- $pages := .Pages.ByParam "series_weight" -}} + {{- if eq $taxonomy "series" -}} + {{- $pages = .Pages.ByParam "series_weight" -}} + {{- with .Site.Params.list.paginate | default .Site.Params.paginate -}} + {{- $pages = $.Paginate $pages . -}} + {{- else -}} + {{- $pages = .Paginate $pages -}} + {{- end -}} + {{- else -}} + {{- $pages = .Pages.GroupByDate "2006" -}} + {{- with .Site.Params.list.paginate | default .Site.Params.paginate -}} + {{- $pages = $.Paginate $pages . -}} + {{- else -}} + {{- $pages = .Paginate $pages -}} + {{- end -}} + {{- end -}} + {{- .Scratch.Set "paginatorPager" $pages -}} +{{- end -}} diff --git a/layouts/taxonomy/list.html b/layouts/taxonomy/list.html index 4cc0c0e99..922127b23 100644 --- a/layouts/taxonomy/list.html +++ b/layouts/taxonomy/list.html @@ -1,10 +1,14 @@ {{- define "title" -}} - {{- .Title }} - {{ T .Data.Singular | default .Data.Singular }} - {{ .Site.Title -}} + {{- if (gt .Paginator.PageNumber 1) -}} + {{ $pageNumber := printf "%v %v %v" (T "prefixPageNumber" ) .Paginator.PageNumber (T "suffixPageNumber" ) }} + {{- .Title }} - {{ T .Data.Singular | default .Data.Singular }} {{ $pageNumber }} - {{ .Site.Title -}} + {{- else -}} + {{- .Title }} - {{ T .Data.Singular | default .Data.Singular }} - {{ .Site.Title -}} + {{- end -}} {{- end -}} {{- define "content" -}} {{- $params := .Scratch.Get "params" -}} -
{{- /* Title */ -}}

@@ -49,16 +53,11 @@

{{- end -}} {{- /* Paginate */ -}} + {{- /* Paginate is first call on baseof.html */ -}} {{- if .Pages -}} {{- $taxonomy := .Data.Singular -}} {{- if eq $taxonomy "series" -}} - {{- $pages := .Pages.ByParam "series_weight" -}} - {{- with .Site.Params.list.paginate | default .Site.Params.paginate -}} - {{- $pages = $.Paginate $pages . -}} - {{- else -}} - {{- $pages = .Paginate $pages -}} - {{- end -}} - {{- range $pages.Pages -}} + {{- range .Paginator.Pages -}} {{- end -}} {{- else -}} - {{- $pages := .Pages.GroupByDate "2006" -}} - {{- with .Site.Params.list.paginate | default .Site.Params.paginate -}} - {{- $pages = $.Paginate $pages . -}} - {{- else -}} - {{- $pages = .Paginate $pages -}} - {{- end -}} - {{- range $pages.PageGroups -}} + {{- range .Paginator.PageGroups -}}

{{ .Key }}

{{- range .Pages -}}
From 12c58504464b046922458a3bce065d1b70322798 Mon Sep 17 00:00:00 2001 From: xiaoqing Date: Thu, 21 Dec 2023 19:24:53 +0800 Subject: [PATCH 2/2] 1. Removed microdata and unified use of JSON-LD. 2. Add alternateName field to webSite schema. That is an alternate site name used in Google search results. 3. Fix missing field in google rich result test. 4. Prioritize using the featured image in front matter as the article image in JSON-LD. --- exampleSite/config/_default/params.toml | 4 + .../theme-documentation-basics/index.en.md | 3 + .../theme-documentation-basics/index.zh-cn.md | 3 + layouts/_default/summary.html | 4 +- layouts/index.html | 11 +- layouts/partials/footer.html | 8 +- layouts/partials/head/seo.html | 179 ++++++++++++------ 7 files changed, 141 insertions(+), 71 deletions(-) diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index a23406290..c0cbe4eb6 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -545,6 +545,10 @@ cacheRemoteImages = false # thumbnail URL # 缩略图 URL thumbnailUrl = "/images/screenshot.png" + # Google 搜索结果中网站备用名字 + # alternate site name in Google search result + # https://developers.google.com/search/docs/appearance/site-names#alternative + # alternateName = ["Hugo DoIt"] # Analytics config # 网站分析配置 diff --git a/exampleSite/content/posts/theme-documentation-basics/index.en.md b/exampleSite/content/posts/theme-documentation-basics/index.en.md index 754f784ab..78cf64568 100644 --- a/exampleSite/content/posts/theme-documentation-basics/index.en.md +++ b/exampleSite/content/posts/theme-documentation-basics/index.en.md @@ -772,6 +772,9 @@ Please open the code block below to view the complete sample configuration :(far image = "" # thumbnail URL thumbnailUrl = "" + # {{< version 0.4.1 >}} + # alternate site name in Google search result + alternateName = ["Hugo DoIt"] # {{< version 0.2.0 >}} Analytics config [params.analytics] diff --git a/exampleSite/content/posts/theme-documentation-basics/index.zh-cn.md b/exampleSite/content/posts/theme-documentation-basics/index.zh-cn.md index 17845b493..52d0835ea 100644 --- a/exampleSite/content/posts/theme-documentation-basics/index.zh-cn.md +++ b/exampleSite/content/posts/theme-documentation-basics/index.zh-cn.md @@ -776,6 +776,9 @@ hugo image = "" # 缩略图 URL thumbnailUrl = "" + # {{< version 0.4.1 >}} + # Google 搜索结果中网站备用名字 + alternateName = ["Hugo DoIt"] # {{< version 0.2.0 >}} 网站分析配置 [params.analytics] diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 1f38c69d2..5f675fe05 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -1,6 +1,6 @@ {{- $params := .Params | merge .Site.Params.page -}} -
+
{{- /* Featured image */ -}} {{- $image := $params.featuredImagePreview | default $params.featuredImage -}} {{- $height := "auto" -}} @@ -29,7 +29,7 @@ {{- end -}} {{- /* Title */ -}} -

+

{{ .Title }}

diff --git a/layouts/index.html b/layouts/index.html index 352ab18dc..d871d53a6 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,10 +1,9 @@ {{- define "title" }} - {{- with .Scratch.Get "paginatorPager" -}} - {{- if gt .PageNumber 1 -}} - {{- T "prefixPageNumber" }} {{ .PageNumber }} {{ T "suffixPageNumber" }} - {{ $.Site.Title -}} - {{ else }} - {{- $.Site.Title -}} - {{- end -}} + {{- $paginatorPager := .Scratch.Get "paginatorPager" -}} + {{- if and $paginatorPager (gt $paginatorPager.PageNumber 1) -}} + {{- T "prefixPageNumber" }} {{ $paginatorPager.PageNumber }} {{ T "suffixPageNumber" }} - {{ $.Site.Title -}} + {{ else }} + {{- $.Site.Title -}} {{- end -}} {{- end -}} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 27f47d12b..ca2fa1438 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -34,17 +34,15 @@ {{- if ne .Site.Params.footer.copyright false -}} {{- with .Site.Params.footer.since -}} - - {{- if lt . now.Year }}{{ . }} - {{ end }}{{ now.Year -}} - + {{- if lt . now.Year }}{{ . }} - {{ end }}{{ now.Year -}} {{- else -}} - {{ now.Year }} + {{ now.Year }} {{- end -}} {{- end -}} {{- /* Author */ -}} {{- if ne .Site.Params.footer.author false -}} -  {{ .Site.Author.name }} +  {{ .Site.Author.name }} {{- end -}} {{- /* License */ -}} diff --git a/layouts/partials/head/seo.html b/layouts/partials/head/seo.html index 9d406c17d..b00f5de99 100644 --- a/layouts/partials/head/seo.html +++ b/layouts/partials/head/seo.html @@ -1,5 +1,3 @@ -{{- $params := .Scratch.Get "params" -}} - {{- with .Site.Params.verification.google -}} {{- end -}} @@ -22,57 +20,13 @@ {{- end -}} -{{- /* Home SEO */ -}} -{{- if .IsHome -}} - - -{{- /* Page SEO */ -}} -{{- else if .IsPage -}} - + {{- end -}} + +{{- /* Page SEO */ -}} +{{- else if .IsPage -}} + {{- end -}}