feat: write real meta descriptions and shorten the homepage title - #269
Merged
Conversation
meta description was a copy of <title>, so recipe pages advertised
themselves with 1-4 words ("Colored Toasts"). Google discards
descriptions that thin and writes its own snippet instead.
- head.html: description is its own param, used by meta description,
og:description and twitter:description
- generate-recipe-html.mjs: a description per recipe, written from what
each recipe's source actually demonstrates
- recipe <title> gets a " - SweetAlert2" suffix, skipped where the title
already says SweetAlert2 (no "SweetAlert2 + React - SweetAlert2").
Breadcrumb names keep the unsuffixed title.
- index.html: title cut from 118 to 58 chars so it stops being truncated
in results; the full tagline moves to the description, where 139 chars
fits comfortably
- 404.html: its own description
Every page now has a distinct description of 66-139 chars and a title of
19-65 chars.
Closes #254
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Aug 6, 2026
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.
Closes #254 — the remaining, non-mechanical half. (#266 did the Open Graph tags.)
Problem
meta descriptionwas a copy of<title>, so recipe pages described themselves in 1–4 words:Google discards descriptions that thin and writes its own snippet from page text — and there is no page text, since the site is CSR (#253). The homepage had the opposite problem: a 118-character title, truncated at ~60 in results, duplicated verbatim as its description.
Changes
partials/head.html—descriptionis now its own param, feedingmeta description,og:descriptionandtwitter:description.tools/generate-recipe-html.mjs— a description per recipe. I wrote each from the recipe's actual source rather than from its title, so they name the real technique:Swal.mixin(),iconColorand a timer progress bar.allowOutsideClickand animate.css.swal2-shownis active.(The full set is in the diff.) Reading the sources changed some of these — the blurred-backdrop recipe uses a plain
filteron the page content, notbackdrop-filter, which is what I'd have written from the name alone.Recipe titles get a
" - SweetAlert2"suffix, skipped where the title already says SweetAlert2, so there's no"SweetAlert2 + React - SweetAlert2". Breadcrumb names deliberately keep the unsuffixed title.index.html— title cut 118 → 58 chars; the full tagline moves into the description, where 139 chars fits comfortably.404.html— its own description.Verification
Programmatic check across all 23 pages:
{=$...}placeholders'Colored Toasts'), confirming the suffix didn't leak into structured databun run lintandbun run buildpassThe one thing to look at
The homepage title change is a judgment call, not a mechanical fix. It goes from:
to:
It keeps the brand first and the terms people search for, and stops the tail being cut off mid-phrase. But the homepage title is a ranking-relevant asset, so if you'd rather keep the original wording, that's a one-line revert and the rest of the PR stands on its own.
🤖 Generated with Claude Code