Skip to content

feat(seo): implement dynamic excerpt and keyword generation for words - #321

Merged
babblebey merged 6 commits into
mainfrom
seo
Nov 18, 2026
Merged

babblebey merged 6 commits into
mainfrom
seo

Conversation

@babblebey

Copy link
Copy Markdown
Member

Description

This pull request improves the handling of meta information for pages and open graph images, and enhances keyword and excerpt extraction for SEO and social sharing. It introduces new utility functions for generating plain-text excerpts and keyword lists, refactors their usage across the codebase, and adds comprehensive unit tests.

Meta Information and SEO Improvements

  • The site URL is now dynamically set based on the Vercel deployment environment in astro.config.mjs, ensuring correct canonical URLs for preview deployments.
  • The layout now uses a new SITE_META_SUBTITLE constant for consistent page subtitles, and canonical URLs are generated more robustly (using Astro.site or the current origin). Open Graph and Twitter meta tags use these canonical URLs and improved image URLs.

Excerpt and Keyword Extraction Utilities

  • Added getExcerpt and getKeywords utility functions to src/lib/utils/index.js for extracting a plain-text summary and a deduplicated keyword list from dictionary entries.
  • Updated src/layouts/word.astro to use these utilities for setting the page description, keywords, and og:image URL, improving SEO and social sharing content.

Open Graph Image Generation Refactor

  • Refactored the open graph image API route to use the shared getExcerpt utility, removing a duplicate implementation.

Testing

  • Added and expanded unit tests for getExcerpt and getKeywords to ensure correct extraction and edge case handling.

Related Issue

Fixes #79

Screenshots/Screencasts

NA

Notes to Reviewer

NA

@vercel

vercel Bot commented Nov 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
jargons-dev Ready Ready Preview Nov 18, 2026 7:09pm UTC

@babblebey
babblebey merged commit 7aa8f12 into main Nov 18, 2026
6 checks passed
@babblebey
babblebey deleted the seo branch November 18, 2026 19:14

This branch was successfully deployed

1 active deployment
Preview — 547c3274 Deployed Nov 18, 2026 by vercel[bot]
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.

Implement Excerpt Generator for Word Content and Use in SEO Meta Description

1 participant