Repository navigation
docs: add social images and better search metadata - #1383
Merged
Merged
Conversation
Links to the website showed no image in social networks and chats: the pages had no og:image. Every page now gets one with its title and description, generated at build time with astro-og-canvas and the Inter font from npm, so the build fetches nothing.
The component and example pages had titles such as "Line" and descriptions such as "Description of Line component from react-chartjs-2.". They get titles with the words people search for, such as "React Line Chart Example", and descriptions of what each page shows. The overview pages and the older docs pages get better descriptions too.
npm search ranks packages by their keywords and description, which named neither React nor the chart types.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1383 +/- ##
=======================================
Coverage 93.97% 93.97%
=======================================
Files 3 3
Lines 83 83
Branches 20 20
=======================================
Hits 78 78
Misses 3 3
Partials 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Changes
og:image. Every page now gets a 1200×630 image with the logo, its title and its description:/og/<page id>.png(src/pages/og/[...slug].png.ts);src/routeData.ts, a Starlight route middleware, adds theog:imagetag to every page except the 404 page of Starlight, which is not in the collection;@fontsource/inter, so the build downloads nothing;src/assets/og-logo.pngis the logo rasterized at the size the image shows it.<title>with the words people search for, such as "React Line Chart Example | react-chartjs-2". It is set throughheadin the frontmatter, as on the home page, so the headings and the sidebar stay the same;Checked locally
og:imagethat points to a generated image. The 404 page and the redirect pages have none, and the sitemap lists no images.astro devserves the images at the same URLs.🤖 Generated with Claude Code