From 67049b98c95eceffe85206f547e05d0a51c1f7d5 Mon Sep 17 00:00:00 2001 From: Elijah Seed-Arita Date: Wed, 8 Oct 2025 10:29:44 -0700 Subject: [PATCH] fix: show both DisplayName and Handle in google structured data (or only Handle if DisplayName not set) --- bskyweb/templates/post.html | 6 +++++- bskyweb/templates/profile.html | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bskyweb/templates/post.html b/bskyweb/templates/post.html index ff21aaca14..85e2a526ec 100644 --- a/bskyweb/templates/post.html +++ b/bskyweb/templates/post.html @@ -62,7 +62,11 @@ "@type": "DiscussionForumPosting", "author": { "@type": "Person", - "name": "{{ postView.Author.DisplayName }}", + {%- if postView.Author.DisplayName %} + "name": "{{ postView.Author.DisplayName }} (@{{ postView.Author.Handle }})", + {% else %} + "name": "@{{ postView.Author.Handle }}", + {% endif -%} "url": "https://bsky.app/profile/{{ postView.Author.Handle }}" }, {%- if postText %} diff --git a/bskyweb/templates/profile.html b/bskyweb/templates/profile.html index bb552ef47d..6f015e5fce 100644 --- a/bskyweb/templates/profile.html +++ b/bskyweb/templates/profile.html @@ -59,7 +59,11 @@ "dateCreated": "{{ profileView.CreatedAt }}", "mainEntity": { "@type": "Person", - "name": "{{ profileView.DisplayName }}", + {%- if postView.Author.DisplayName %} + "name": "{{ postView.Author.DisplayName }} (@{{ postView.Author.Handle }})", + {% else %} + "name": "@{{ postView.Author.Handle }}", + {% endif -%} "alternateName": "@{{ profileView.Handle }}", "identifier": "{{ profileView.Did }}", "description": "{{ profileView.Description }}",