From c8ff5c1d688d7bd3866f32784613521ca3d5a8b3 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Thu, 12 Mar 2026 11:07:10 +0700 Subject: [PATCH] Add SEO improvements: canonical, hreflang, schema fixes, robots.txt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix breadcrumb schema position bug (3 → 2) for Google Rich Results - Override article/post schemas to use post image instead of site logo - Fix og:type to emit "article" on post pages with published/modified times - Add canonical link and hreflang alternate tags (incl. x-default) for bilingual site - Add organizationName/organizationLogo params for valid Organization schema - Add robots.txt with sitemap pointer - Add preconnect hint for analytics host --- config.yml | 3 ++ layouts/partials/head_custom.html | 8 ++++ layouts/partials/header.html | 17 +++---- layouts/partials/seo/opengraph.html | 21 +++++++++ layouts/partials/seo/structured/article.html | 28 +++++++++++ .../partials/seo/structured/breadcrumb.html | 21 +++++++++ layouts/partials/seo/structured/post.html | 47 +++++++++++++++++++ static/css/custom.css | 35 +++++++++----- static/robots.txt | 4 ++ 9 files changed, 164 insertions(+), 20 deletions(-) create mode 100644 layouts/partials/seo/opengraph.html create mode 100644 layouts/partials/seo/structured/article.html create mode 100644 layouts/partials/seo/structured/breadcrumb.html create mode 100644 layouts/partials/seo/structured/post.html create mode 100644 static/robots.txt diff --git a/config.yml b/config.yml index 87e0710..5bdc1b5 100644 --- a/config.yml +++ b/config.yml @@ -28,6 +28,9 @@ params: desc: "My school: Épita." link: "http://epita.fr/" + organizationName: "nemunaire's blog" + organizationLogo: "https://www.nemunai.re/img/mug.jpg" + author: name: "nemunaire" email: "blog@nemunai.re" diff --git a/layouts/partials/head_custom.html b/layouts/partials/head_custom.html index 00a1aa9..8c964c1 100644 --- a/layouts/partials/head_custom.html +++ b/layouts/partials/head_custom.html @@ -1,3 +1,11 @@ + + {{ if .IsTranslated }} + {{ range .AllTranslations }} + + {{ end }} + {{ range .AllTranslations }}{{ if eq .Lang "en" }}{{ end }}{{ end }} + {{ end }} +