From de0dd46ed589385d9fe591d1e489d7cee7b2e08d Mon Sep 17 00:00:00 2001
From: Simon Hollingshead <me@simonhollingshead.com>
Date: Thu, 26 Sep 2024 22:19:49 +0000
Subject: [PATCH] Hide fediverse creator when unused, and allow a globally-set value. (#931)

---
 docs/configurations.md               |    1 +
 layouts/partials/head/meta-tags.html |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/docs/configurations.md b/docs/configurations.md
index 37a1a34..b09c312 100644
--- a/docs/configurations.md
+++ b/docs/configurations.md
@@ -121,6 +121,7 @@
 | keywords                      | string | Yes      | Site keywords.                                   |                                  | `"blog,developer,personal"`                      |
 | avatarURL                     | string | No       | Photo of the author.                             |                                  | `"images/avatar.jpg"`                            |
 | gravatar                      | string | No       | Gravatar photo of the author                     |                                  | `"john.doe@example.com"`                         |
+| fediverseCreator              | string | No       | The author's fediverse handle.                   |                                  | `"@johndoe@example.com"`                         |
 | faviconSVG                    | string | No       | Custom path to a SCG favicon.                    | `"/img/favicon.svg"`             | `"/img/favicon.svg"`                             |
 | favicon_32                    | string | No       | Custom path to a 32x32 favicon.                  | `"/img/favicon-32x32.png"`       | `"/img/favicon-32x32.png"`                       |
 | favicon_16                    | string | No       | Custom path to a 16x16 favicon.                  | `"/img/favicon-16x16.png"`       | `"/img/favicon-16x16.png"`                       |
diff --git a/layouts/partials/head/meta-tags.html b/layouts/partials/head/meta-tags.html
index cab9043..d137948 100644
--- a/layouts/partials/head/meta-tags.html
+++ b/layouts/partials/head/meta-tags.html
@@ -10,7 +10,7 @@
 <meta name="author" content="{{ . }}">{{ end }}
 <meta name="description" content="{{ .Description | default (.Summary | default .Site.Params.description ) }}">
 <meta name="keywords" content="{{ (delimit .Keywords ", ") | default .Site.Params.keywords }}">
-<meta name="fediverse:creator" content="{{ .Params.fediverseCreator }}" />
+{{ if or .Params.fediverseCreator .Site.Params.fediverseCreator }}<meta name="fediverse:creator" content="{{ .Params.fediverseCreator | default .Site.Params.fediverseCreator }}" />{{end}}
 
 {{ template "_internal/twitter_cards.html" . }}
 {{ template "_internal/opengraph.html" . }}

--
Gitblit v1.10.0