From ef6876a0d34013483b6ddf4461852bd10a633cef Mon Sep 17 00:00:00 2001 From: kbe Date: Tue, 19 Aug 2025 17:17:09 +0200 Subject: [PATCH] seo improvement with titles h1/h4 --- hugo.toml | 21 +++-- layouts/_default/list.html | 105 +++++++++++-------------- layouts/_default/single.html | 2 +- layouts/categories/list.html | 4 +- layouts/index.html | 38 +++------ layouts/pages/list.html | 4 +- layouts/partials/categories-first.html | 13 +++ layouts/partials/footer.html | 2 +- layouts/partials/header.html | 2 +- 9 files changed, 88 insertions(+), 103 deletions(-) create mode 100644 layouts/partials/categories-first.html diff --git a/hugo.toml b/hugo.toml index 498abd9..3e3dcb8 100644 --- a/hugo.toml +++ b/hugo.toml @@ -38,9 +38,8 @@ ignoreLogs = ["warning-goldmark-raw-html"] site = "@mistergeekfrance" creator = "@mistergeekfrance" - # Facebook - facebook_page = "mistergeek.fr" - youtube_channel = "UCXXXXXXXXXXXXXXXXXXX" + facebook_page = "mistergeekfrance" + # youtube_channel = "UCXXXXXXXXXXXXXXXXXXX" # Search Engine Verification # google_verification = "your-google-verification-code" @@ -48,14 +47,14 @@ ignoreLogs = ["warning-goldmark-raw-html"] # yandex_verification = "your-yandex-verification-code" # Local SEO - [params.seo.local] - enabled = true - country = "FR" - language = "fr" - region = "Île-de-France" - city = "Paris" - latitude = "48.8566" - longitude = "2.3522" + # [params.seo.local] + # enabled = true + # country = "FR" + # language = "fr" + # region = "Île-de-France" + # city = "Paris" + # latitude = "48.8566" + # longitude = "2.3522" # Rich snippets enable_search_box = true diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 6bf95d7..7c02800 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,73 +1,62 @@ {{ define "main" }} +

{{ .Site.Title }}

-

{{ .Site.Params.seo.description }}

-
-
-
- {{ $paginationLimit := 10 }} - {{ if .Site.Params.paginationLimit }}{{ $paginationLimit = .Site.Params.paginationLimit }}{{ end }} - {{ $paginator := .Paginator $paginationLimit }} - {{ range $paginator.Pages }} - -
- -
-
-
- {{ if .Params.categories }} - {{ range $index, $category := .Params.categories }} - {{ if $index }}, {{ end }} - {{ if and (eq (printf "%T" $category) "string") }} - {{ $category }} - {{ else if and (eq (printf "%T" $category) "map") }} - {{ if $category.name }} - {{ $category.name }} - {{ end }} - {{ end }} - {{ end }} +
+
+
+ {{ $paginationLimit := 10 }} + {{ if .Site.Params.paginationLimit }}{{ $paginationLimit = .Site.Params.paginationLimit }}{{ end }} + {{ $paginator := .Paginator $paginationLimit }} + {{ range $paginator.Pages }} + +
+ +
+
+ + {{ partial "categories-first.html" . }} + +
+ {{ .Date.Format "02/07/2006" }} +
+
+

{{ .Title }}

+ {{ if .Params.excerpt }} +

{{ .Params.excerpt }}

+ {{ else if .Summary }} +

{{ .Summary }}

+ {{ else }} +

{{ truncate 200 .Content }}

+ {{ end }} + +
+
+ {{ end }} -
-
- {{ .Date.Format "02/07/2006" }} -
+ + + {{ partial "pagination.html" (dict "Paginator" .Paginator "Page" .) }}
-

{{ .Title }}

- {{ if .Params.excerpt }} -

{{ .Params.excerpt }}

- {{ else if .Summary }} -

{{ .Summary }}

- {{ else }} -

{{ truncate 200 .Content }}

- {{ end }} - -
-
- - {{ end }} - - - {{ partial "pagination.html" (dict "Paginator" .Paginator "Page" .) }} -
-
-
+
+
{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index f1a2f4f..3132165 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -10,7 +10,7 @@ {{ end }} {{ with .Params.categories }} {{ range . }} -
  • dans {{ . }}
  • +
  • dans {{ . }}
  • {{ end }} {{ end }}
  • le {{ .Date.Format "02/01/2006" }}
  • diff --git a/layouts/categories/list.html b/layouts/categories/list.html index a5c072f..0b60a0c 100644 --- a/layouts/categories/list.html +++ b/layouts/categories/list.html @@ -4,7 +4,7 @@
    -

    {{ .Title }}

    +

    {{ .Title }}

    Cette page répertorie toutes les catégories de notre site, offrant une vue d'ensemble structurée de notre contenu.

    @@ -17,7 +17,7 @@ {{ range $.Site.Data.wordpress.categories }}
    -

    {{ .name }}

    +

    {{ .name }}

    {{ .description | safeHTML }}

    Voir la catégorie diff --git a/layouts/index.html b/layouts/index.html index fad9e78..7e940df 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,10 +1,11 @@ {{ define "main" }} -{{ $defaultCategory := "General" }} -{{ if .Site.Params.defaultCategory }}{{ $defaultCategory = .Site.Params.defaultCategory }}{{ end }} + +
    -
    -

    {{ .Site.Title }} blog.

    -
    +
    +

    {{ .Site.Title }}

    +

    {{ .Site.Params.seo.description }}

    +
    @@ -27,31 +28,14 @@
    -
    - {{ if .Params.categories }} - {{ range $index, $category := .Params.categories }} - {{ if $index }}, {{ end }} - {{ if and (eq (printf "%T" $category) "string") }} - {{ $category }} - {{ else if and (eq (printf "%T" $category) "map") }} - {{ if $category.name }} - {{ $category.name }} - {{ else }} - {{ $defaultCategory }} - {{ end }} - {{ else }} - {{ $defaultCategory }} - {{ end }} - {{ end }} - {{ else }} - {{ $defaultCategory }} - {{ end }} -
    + + {{ partial "categories-first.html" . }} +
    {{ .Date.Format "02/07/2006" }}
    -

    {{ .Title }}

    +

    {{ .Title }}

    {{ if .Params.excerpt }}

    {{ .Params.excerpt }}

    {{ else if .Summary }} @@ -74,4 +58,4 @@
    -{{ end }} \ No newline at end of file +{{ end }} diff --git a/layouts/pages/list.html b/layouts/pages/list.html index f39c1f8..669dad1 100644 --- a/layouts/pages/list.html +++ b/layouts/pages/list.html @@ -5,7 +5,7 @@
    -

    {{ .Title }}

    +

    {{ .Title }}

    Retrouvez toutes les pages utiles du site ici.

    @@ -24,7 +24,7 @@
    -

    {{ .Title }}

    +

    {{ .Title }}

    {{ if .Params.excerpt }}

    {{ .Params.excerpt }}

    {{ else if .Summary }} diff --git a/layouts/partials/categories-first.html b/layouts/partials/categories-first.html new file mode 100644 index 0000000..61754a2 --- /dev/null +++ b/layouts/partials/categories-first.html @@ -0,0 +1,13 @@ +
    + {{ if .Params.categories }} + {{ with index .Params.categories 0 }} + {{ if and (eq (printf "%T" .) "string") }} + {{ . }} + {{ else if and (eq (printf "%T" .) "map") }} + {{ if .name }} + {{ .name }} + {{ end }} + {{ end }} + {{ end }} + {{ end }} +
    diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 7bbae7b..4d3d7b5 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -13,7 +13,7 @@ {{ if .Site.Data.wordpress }} {{ range $index, $element := .Site.Data.wordpress.navigation }}
  • - {{ $element.title }} + {{ $element.title }}
  • {{ end }} {{ end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 7e2a4ac..6dad062 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -18,7 +18,7 @@ {{ continue }} {{ else if lt $count 5 }} {{ $count = add $count 1 }} {{ else }}