Skip to content

Home: Person structured data for personal sites - #647

Merged
compscidr merged 1 commit into
mainfrom
feature/person-structured-data
Oct 3, 2026
Merged

compscidr merged 1 commit into
mainfrom
feature/person-structured-data

Conversation

@compscidr

Copy link
Copy Markdown
Collaborator

Why

A personal site's home page only declared a WebSite. Nothing told a search engine that the site belongs to a person, or that the LinkedIn/GitHub/etc. profiles linked in the footer are the same person, which matters when someone else with the same name outranks you.

Changes

  • New site_is_person setting (Site tab, checkbox, default off). Seeded on existing sites by the migration.
  • With it on, the home page head adds a schema.org Person: name (site title), url, description, image (site image), and sameAs listing the Social Icons plugin's links (.plugins.socialicons.links). Without the plugin, sameAs is empty.
  • Only the home page carries it. Off by default so a project or organisation site (goblog.live) is not described as a person.

Testing

TestHeadMetadata covers: absent by default; with the setting on, the block parses as JSON with the expected name, URL, image and two sameAs entries from a stand-in socialicons plugin; not repeated on other pages. go test ./... passes. Not checked against a live site with the real wasm plugin, or in a structured-data validator.

🤖 Generated with Claude Code

With the new site_is_person setting on, the home page carries a
schema.org Person: the site title as the name, the site URL, description
and image, and sameAs listing the profiles the Social Icons plugin holds.
That is how a search engine ties those profiles to the site. Off by
default, so a project or organisation site is not described as a person.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The change is small, off by default, consistent with existing JSON-LD/settings patterns, well covered by tests, and the external Social Icons links[].URL shape it depends on was verified to match.

Review effort: Balanced
Findings: None

What changed in this PR

This PR adds optional schema.org Person structured data to the home page of personal goblog sites. Previously the home page only declared a WebSite, giving search engines no signal that the site belongs to a person or that the linked social profiles are the same person. The feature is gated behind a new site_is_person checkbox setting (off by default) so project/organisation sites are unaffected. When enabled, the home <head> emits a Person block (name, url, description, image) with sameAs populated from the Social Icons plugin's links, correctly handling the plugin's absence (empty sameAs).

Changes:

  • Add site_is_person checkbox setting (seeded via migration with FirstOrCreate, so existing sites are backfilled; surfaced in the Site settings tab with help text).
  • Emit a home-page-only JSON-LD Person block in templates/shared/_head.html, gated on is_home and site_is_person == "true", reading sameAs from .plugins.socialicons.links[].URL.
  • Extend TestHeadMetadata with a socialicons stand-in plugin to assert JSON validity, expected fields, sameAs entries, default-off behavior, and that only the home page carries it.
File Description
tools/​migrate.go Seeds the new site_is_person checkbox setting (default "false"), backfilled to existing sites.
templates/​shared/​_head.html Adds the home-page Person JSON-LD block, gated behind the setting, with sameAs from the Social Icons plugin.
admin/​settings.go Adds label/help for site_is_person in the Site settings tab.
blog/​blog_test.go Adds a socialicons stand-in plugin and assertions covering the new structured data.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Oct 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@compscidr
compscidr merged commit 2b8e52c into main Oct 3, 2026
3 of 4 checks passed
@compscidr
compscidr deleted the feature/person-structured-data branch October 3, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants