Skip to content

Add comprehensive OpenGraph metadata system#6

Merged
plx merged 1 commit intomainfrom
add-opengraph-metadata
Aug 20, 2025
Merged

Add comprehensive OpenGraph metadata system#6
plx merged 1 commit intomainfrom
add-opengraph-metadata

Conversation

@plx
Copy link
Copy Markdown
Owner

@plx plx commented Aug 19, 2025

Summary

This PR implements a comprehensive OpenGraph metadata system for the Astro site, enabling proper social media sharing with dynamic image generation.

Changes Made

Core Infrastructure

  • Added astro-seo package for structured OpenGraph and Twitter Card support
  • Created OpenGraphMeta component - wrapper around astro-seo with proper TypeScript integration
  • Built opengraph.ts utility library with helper functions for different content types
  • Integrated Tailgraph service for dynamic OG image generation

Content Schema Updates

  • Extended all content collections (blog, briefs, projects) with OpenGraph override fields:
    • ogTitle - custom OpenGraph title
    • ogDescription - custom OpenGraph description
    • ogImage - custom image URL
    • ogImageAlt - custom image alt text
    • noOgImage - disable automatic image generation
    • modifiedDate - article modification date

Page-Level Integration

  • Blog posts: Article type with author, publish date, section metadata
  • Briefs: Article type with category information and custom subtitles
  • Projects: Website type with project-specific styling
  • List pages: Dynamic counts (e.g., "12 posts", "8 briefs")
  • Home page: Site overview with branded styling

Dynamic Image Generation

  • Tailgraph integration for automatic OG image creation
  • Consistent branding with site logo and dark theme
  • Content-aware subtitles (dates for posts, categories for briefs, counts for lists)
  • Fallback support for custom images when provided

Technical Details

OpenGraph Types

  • Articles (blog/briefs): Include published_time, modified_time, author, section
  • Website (projects/lists/home): Standard website metadata
  • Twitter Cards: Large image format for all content types

Image Strategy

  • Dynamic generation via Tailgraph API for consistent branding
  • Override capability through frontmatter ogImage field
  • Opt-out option via noOgImage flag
  • Proper alt text with meaningful descriptions

Performance & SEO

  • Structured metadata improves social media preview quality
  • Dynamic images ensure consistent visual branding across shares
  • Proper schema validation prevents metadata errors
  • Twitter creator attribution (@PLXGitHub) for engagement tracking

Testing

  • Linting passes - no ESLint errors
  • Build succeeds - Astro compilation works correctly
  • HTML validation - proper meta tags generated in output
  • Schema validation - content collections accept new fields
  • Image generation - Tailgraph URLs work correctly

Impact

  • Enhanced social sharing with rich previews on Twitter, Facebook, LinkedIn
  • Professional branding through consistent OG image styling
  • SEO improvements via structured metadata
  • Content flexibility through override options
  • Future-proof architecture easily extensible for new content types

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown
Contributor

PR Validation ✅

All checks passed! Ready for review.

Checks Performed:

  • ✓ Linting
  • ✓ Type checking
  • ✓ Build verification
  • ✓ Internal link validation

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

PR Validation ✅

All checks passed! Ready for review.

Checks Performed:

  • ✓ Linting
  • ✓ Type checking
  • ✓ Build verification
  • ✓ Internal link validation

- Add astro-seo package for structured OpenGraph support
- Create OpenGraphMeta component with Twitter Card integration
- Add opengraph utility library with Tailgraph dynamic image generation
- Update content schemas with OG override fields (ogTitle, ogDescription, ogImage, etc.)
- Integrate OpenGraph metadata across all page types:
  - Blog posts (article type with author, publish date)
  - Briefs (article type with categories)
  - Projects (website type)
  - List pages (with item counts)
  - Home page
- All pages now have proper social media sharing with dynamic images

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@plx plx force-pushed the add-opengraph-metadata branch from bda4574 to 96fec27 Compare August 20, 2025 10:46
@github-actions
Copy link
Copy Markdown
Contributor

PR Validation ✅

All checks passed! Ready for review.

Checks Performed:

  • ✓ Linting
  • ✓ Type checking
  • ✓ Build verification
  • ✓ Internal link validation

@plx plx merged commit 39a1f4f into main Aug 20, 2025
1 check passed
@plx plx deleted the add-opengraph-metadata branch August 20, 2025 10:49
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.

1 participant