Skip to content

Add sitemap, fix canonical domain, add Person structured data - #8

Merged
thdxg merged 1 commit into
v4from
seo-sitemap-structured-data
Sep 7, 2026
Merged

thdxg merged 1 commit into
v4from
seo-sitemap-structured-data

Conversation

@thdxg

@thdxg thdxg commented Sep 7, 2026

Copy link
Copy Markdown
Owner

What changed

  • New /sitemap.xml — a prerendered SvelteKit endpoint listing the homepage and /resume, served with a one-hour cache header. The page list is a single array at the top of the file, so adding a route is a one-line change.
  • robots.txt now advertises the sitemap via a Sitemap: line.
  • Canonical domain corrected from taehoonlee.dev to thdxg.dev in the Open Graph URL, Open Graph image, and Twitter image meta tags.
  • Person JSON-LD added to the app shell, declaring the GitHub and LinkedIn profiles as belonging to the same person.

Why

The site had no sitemap, so crawlers had to discover routes by following links. Separately, three meta tags still pointed at the old domain, which would have sent Open Graph and Twitter card scrapers to the wrong host for the preview image.

The structured data answers a related question that a sitemap cannot. The sitemaps protocol requires every <loc> to share the sitemap's own host, and Google discards cross-domain entries, so external profile URLs have no valid place there. A sameAs array on a Person node is the mechanism that actually associates those profiles with the site's owner.

Notes for review

  • The JSON-LD lives in src/app.html rather than the homepage component. Every other SEO tag is already hardcoded there, and embedding it in Svelte markup requires a literal </script> inside an expression, which breaks both the Svelte compiler and the ESLint Svelte parser. The workaround needs {@html} plus a svelte/no-at-html-tags suppression, which is not worth it for two URLs that rarely change.
  • The domain is hardcoded rather than read from the request, so the output stays correct behind the cluster's ingress proxy.
  • Claims in the structured data are drawn from content already on the page. Carnegie Mellon is affiliation since it is in progress, while Emory is alumniOf.

Verification

  • svelte-check passes with 0 errors.
  • bun run lint reports the same 2 pre-existing errors as the base branch, with none added.
  • Production build succeeds and emits build/prerendered/sitemap.xml.
  • Against the dev server, the JSON-LD parses in the browser as exactly one valid block, and it is present in the server-rendered HTML that crawlers read.

Search engines had no index of the site's routes and no way to connect
the off-site profiles to their owner.

- Add a prerendered /sitemap.xml endpoint listing the homepage and
  /resume. Routes live in one array so adding a page is a one-line
  change.
- Point robots.txt at the sitemap.
- Correct the canonical domain from taehoonlee.dev to thdxg.dev in the
  Open Graph URL, Open Graph image, and Twitter image meta tags.
- Add Person JSON-LD to the app shell. A sitemap may only list URLs on
  its own host, so sameAs is what actually declares the GitHub and
  LinkedIn profiles as the same person.
@thdxg
thdxg merged commit 881947d into v4 Sep 7, 2026
1 check passed
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.

1 participant