Repository navigation
Conversation
Add both as Next.js metadata routes: - `sitemap.ts` enumerates the home page, the download page and every docs page, reusing the same loaders the docs route uses so that a new `.mdx` file is listed automatically with no second list to maintain. - `robots.ts` allows everything and points at the sitemap in production, and disallows everything otherwise, mirroring the `X-Robots-Tag: noindex` header already set for non-production builds so that a preview deployment cannot compete with ghostty.org for the same content. - `site.ts` holds the canonical origin, which was previously hardcoded twice in `layout.tsx`, so that page metadata and the sitemap cannot disagree about what the canonical host is. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LvxCwouvubuJLt4KwBzarW
`<lastmod>` lets a crawler tell a page that changed last week from one that has not moved in a year, and decide what to re-fetch. The sitemap had none, because the timestamps available at build time are file mtimes and a fresh CI checkout gives every file the same one. Read the dates from `git log` instead, taking the commit date of the most recent commit to touch each page's source. Docs pages are dated from their MDX file; the home and download pages from the sources listed alongside them. This requires a full clone of the project so `VERCEL_DEEP_CLONE=true` will need to be set before it starts working as Vercel only does a shallow clone by default. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LvxCwouvubuJLt4KwBzarW
|
@jcollie is attempting to deploy a commit to the Ghostty Team on Vercel. A member of the Team first needs to authorize it. |
`openGraph.url` was hardcoded to `https://ghostty.org` in the root layout and never overridden, so every page on the site -- all 102 docs pages included -- announced the home page as its Open Graph URL. Every shared link previewed as the home page, and every consumer reading OG data as a canonical hint was told that the whole site is one page. There was no `<link rel="canonical">` at all. Add `canonicalMetadata`, which returns both for a site-relative path, and spread it into the home page, the download page and the docs route, where the path comes from the same catch-all segments the route already resolves. `openGraph` cannot simply be inherited from the layout here, because Next.js replaces it rather than merging it: a segment that declares `openGraph` to set its own `url` drops the parent's `type`, `siteName` and `images` with it. Confirmed by building without the spread, which leaves every docs page with an `og:url` and no preview image at all. The shared fields are therefore defined once in `metadata.ts` and spread into both the per-page object and the layout's fallback. The layout's fallback names no `url`, so a route that does not call `canonicalMetadata` emits neither it nor a canonical link. That is the right failure: a missing canonical URL leaves a crawler to work it out, whereas a wrong one actively claims the page is a duplicate of somewhere else. The not-found page is the one route that takes this path, and it is already `noindex`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LvxCwouvubuJLt4KwBzarW
Contributor
|
@jcollie I'm wondering if this can't be split into two PR's? And then we can build upon that in a follow up for the other git-history + SEO + priority stuff? |
Member
Author
|
I don't think it makes sense to separate the sitemap generation from the date/priority because the whole point of the sitemap is to expose that information to the search engines. |
Contributor
|
I don't think search engines even respect the priority values these days when they are scraping the pages. |
Contributor
|
At least google doesn't. Any apparently never has, according to the intrawebs. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds robots.txt and sitemap.xml to help improve site searchability.
AI disclosure: Claude Code was used to prepare this PR but the author has thoroughly reviewed and edited the commit logs and this PR description.