From b4bff1e36dde13ee6fe2a3dd19887ed3e217a79e Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Fri, 4 Jul 2025 15:50:38 -0500 Subject: [PATCH] Use content view to customize on author's page --- layouts/_partials/head.html | 6 +----- layouts/authors/term.head_title.html | 1 + layouts/head_title.html | 1 + layouts/home.head_title.html | 1 + 4 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 layouts/authors/term.head_title.html create mode 100644 layouts/head_title.html create mode 100644 layouts/home.head_title.html diff --git a/layouts/_partials/head.html b/layouts/_partials/head.html index b76a791..456c5b1 100644 --- a/layouts/_partials/head.html +++ b/layouts/_partials/head.html @@ -24,11 +24,7 @@ <link rel="apple-touch-icon" href="{{ . | absURL }}" /> {{ end }} - {{ if .IsHome }} - <title>{{ .Site.Title | plainify }} - {{ else }} - {{ (print .Title " | " .Site.Title) | plainify }} - {{ end }} + {{ .Render "head_title" }} {{ partial "seo-tags/opengraph.html" . }} {{ partial "seo-tags/twitter-cards.html" . }} diff --git a/layouts/authors/term.head_title.html b/layouts/authors/term.head_title.html new file mode 100644 index 0000000..10e7573 --- /dev/null +++ b/layouts/authors/term.head_title.html @@ -0,0 +1 @@ +{{ (print .Title "'s Posts | " .Site.Title) | plainify }} diff --git a/layouts/head_title.html b/layouts/head_title.html new file mode 100644 index 0000000..4d28117 --- /dev/null +++ b/layouts/head_title.html @@ -0,0 +1 @@ +{{ (print .Title " | " .Site.Title) | plainify }} diff --git a/layouts/home.head_title.html b/layouts/home.head_title.html new file mode 100644 index 0000000..84f94b0 --- /dev/null +++ b/layouts/home.head_title.html @@ -0,0 +1 @@ +{{ .Site.Title | plainify }}