Repository navigation
Give each colour link its own title and preview - #16
Merged
Merged
Conversation
Link previews don't run JavaScript, so every shared colour unfurled as the home page. The build now writes an HTML page per link (4,680 of them) with that colour's title, description, canonical URL and og tags, all from src/picker/page-head.ts. The app's <title> comes from the same module. Vercel serves them through cleanUrls. ADR-0006 has the reasoning. The home copy now leads with "Dial in your colour" and mentions HSV, since that's what a lot of people search for. The share card says "Dial it in." Also adds robots.txt, a sitemap of home and the 72 hues, a canonical link, og:locale and WebApplication JSON-LD.
The value scaled with the card's width alone, so a wide value like 255,255,128 pushed Copy onto the next line on cards under about 450px. Its size now leaves room for Copy and the widest value.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
With cleanUrls, Vercel no longer serves /index.html by that name, so the catch-all rewrite returned 404 and paths like /red never reached the app's redirect to hue 60.
This branch was successfully 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.
Summary
Shared colour links used to unfurl as the home page, because link previews don't run JavaScript. The build now writes a page per link, each with that colour's head.
src/picker/page-head.tsdecides each page's title, description and canonical link. The plugin invite.config.tsand the<title>inPickerboth use it. ADR-0006 explains why it's done at build time and why picks stay out of the sitemap.Also in here:
robots.txt,rel=canonical,og:localeand WebApplication JSON-LD.255,255,128used to push Copy onto the next line.Evidence
curl /200/62/75 | grep titlegave<title>Huebo</title>, the same for every link.After:
page-head.test.ts: given a pick, the title leads with the hex. Ifindex.htmlloses a tag thatwithHeadfills, it throws. The sitemap has 73 URLs and no picks.255,255,128, Copy dropped to the next line at 1100, 1024 and 960 wide.After: Copy stays beside the value at every size from 600 to 1440 wide. At 960 wide the font is 26px.
pnpm checkpasses, 126 tests.Merge Danger
Door: two-way
Reverting removes the generated pages. The only lasting effect is anything crawlers or chat apps have already cached.
Blast Radius: routing
cleanUrlschanges how Vercel resolves paths. Once the preview deploy is up, check that/200/62/75serves its own page and that unknown paths still fall through to the app. The value is a little smaller on narrow roomy cards.