From 6397146ab2df4e456b28d84b1c1a53e171898357 Mon Sep 17 00:00:00 2001
From: Arnaud Levy <contact@arnaudlevy.com>
Date: Wed, 19 Apr 2023 08:45:21 +0200
Subject: [PATCH] custom title separator

---
 config.yaml                    | 3 +++
 layouts/partials/head/seo.html | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/config.yaml b/config.yaml
index fffbfed6..1f3e4c12 100644
--- a/config.yaml
+++ b/config.yaml
@@ -33,6 +33,9 @@ params:
     footer: "/assets/images/logo.svg"
   organizations:
     dark_logo_background: false
+  seo:
+    title:
+      separator: "|"
   image_sizes:
     design_system:
       lightbox:
diff --git a/layouts/partials/head/seo.html b/layouts/partials/head/seo.html
index 93ad3f2e..25a18d98 100644
--- a/layouts/partials/head/seo.html
+++ b/layouts/partials/head/seo.html
@@ -1,6 +1,8 @@
+{{- $title := chomp (htmlUnescape .Title) -}}
 {{- $seoTitle := htmlUnescape site.Title -}}
+{{- $seoTitleSeparator := htmlUnescape site.Params.seo.title.separator -}}
 {{- if .Title -}}
-  {{- $seoTitle = printf "%s | %s" (chomp (htmlUnescape .Title)) $seoTitle -}}
+  {{- $seoTitle = printf "%s %s %s" $title $seoTitleSeparator $seoTitle -}}
 {{- end -}}
 {{- $seoDescription := "" -}}
 {{- if .Params.meta_description -}}
-- 
GitLab