Merge pull request #9167 from internet-development/elijaharita/structured-data-name-fallback

fix: show both DisplayName and Handle in google structured data (or only Handle if DisplayName not set)
This commit is contained in:
jim
2025-10-08 14:38:07 -07:00
committed by GitHub
2 changed files with 9 additions and 0 deletions
+5
View File
@@ -62,7 +62,12 @@
"@type": "DiscussionForumPosting",
"author": {
"@type": "Person",
{%- if postView.Author.DisplayName %}
"name": "{{ postView.Author.DisplayName }}",
"alternateName": "@{{ postView.Author.Handle }}",
{% else %}
"name": "@{{ postView.Author.Handle }}",
{% endif -%}
"url": "https://bsky.app/profile/{{ postView.Author.Handle }}"
},
{%- if postText %}
+4
View File
@@ -59,8 +59,12 @@
"dateCreated": "{{ profileView.CreatedAt }}",
"mainEntity": {
"@type": "Person",
{%- if profileView.DisplayName %}
"name": "{{ profileView.DisplayName }}",
"alternateName": "@{{ profileView.Handle }}",
{% else %}
"name": "@{{ profileView.Handle }}",
{% endif -%}
"identifier": "{{ profileView.Did }}",
"description": "{{ profileView.Description }}",
"image": "{{ profileView.Avatar }}",