Skip to content

Conversation

@NebraskaCoder
Copy link
Member

Summary

  • Add Open Graph protocol meta tags to /news listing and /news/[slug] article pages for better social media sharing
  • Add JSON-LD structured data (NewsArticle schema) to article pages for improved Google Search indexing
  • Include sanitized JSON-LD utility function to prevent XSS from malicious PR contributions

Test plan

  • Verify OG tags render correctly in page source on news listing page
  • Verify OG tags render correctly in page source on individual article pages
  • Validate JSON-LD with Google Rich Results Test
  • Test social sharing preview with OpenGraph.xyz

🤖 Generated with Claude Code

NebraskaCoder and others added 2 commits December 4, 2025 02:47
Add OG protocol tags to improve social media sharing for news content:
- /news listing: og:title, og:description, og:url, og:site_name, og:locale, og:type
- /news/[slug] articles: article-specific tags including published_time and authors

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

Co-Authored-By: Claude <[email protected]>
Add NewsArticle schema.org structured data for better Google Search indexing.
Includes sanitized JSON-LD output utility to prevent XSS in PR contributions.

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

Co-Authored-By: Claude <[email protected]>
Copilot AI review requested due to automatic review settings December 4, 2025 08:58
@NebraskaCoder NebraskaCoder self-assigned this Dec 4, 2025
@vercel
Copy link

vercel bot commented Dec 4, 2025

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

Project Deployment Preview Comments Updated (UTC)
rockylinux-org Ready Ready Preview Comment Dec 4, 2025 9:09am

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Open Graph protocol metadata and JSON-LD structured data to news pages to improve social media sharing and search engine indexing. The implementation includes a security-focused utility function to sanitize JSON-LD output and prevent XSS attacks from potentially malicious content.

Key Changes

  • Added Open Graph meta tags to /news listing and /news/[slug] article pages with title, description, URL, and article-specific metadata
  • Implemented JSON-LD structured data using the NewsArticle schema for individual articles
  • Created safeJsonLdStringify utility function to escape potentially dangerous characters in JSON-LD script tags

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.

File Description
utils/jsonLd.ts New utility function for safely stringifying JSON-LD data with XSS protection via character escaping
app/[locale]/news/page.tsx Added Open Graph metadata to news listing page, including typed return for generateMetadata
app/[locale]/news/[slug]/page.tsx Added Open Graph metadata and JSON-LD NewsArticle schema to individual article pages, with proper use of sanitization utility

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Reduces auto-generated excerpt from 200 to 150 characters to meet
Open Graph description guidelines (110-160 characters optimal).

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

Co-Authored-By: Claude <[email protected]>
- Add & -> \u0026 escaping for comprehensive XSS protection
- Add unit tests covering script injection, HTML entities, nested objects, and arrays

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

Co-Authored-By: Claude <[email protected]>
@NebraskaCoder NebraskaCoder merged commit aede232 into develop Dec 4, 2025
4 checks passed
@NebraskaCoder NebraskaCoder deleted the feature/news-open-graph-metadata branch December 4, 2025 09:13
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.

2 participants