Skip to content

Update Open Graph metadata and improve document readability#48

Merged
olamide226 merged 2 commits intomainfrom
fix/og-image
Mar 31, 2026
Merged

Update Open Graph metadata and improve document readability#48
olamide226 merged 2 commits intomainfrom
fix/og-image

Conversation

@olamide226
Copy link
Copy Markdown
Contributor

@olamide226 olamide226 commented Mar 31, 2026

This pull request enhances the site's SEO and social sharing capabilities by improving how Open Graph and Twitter meta tags are generated in the astro.config.mjs file. It also makes minor documentation updates by removing the Authors field from two spec markdown files.

Improvements to meta tags and SEO:

  • Refactored docs/astro.config.mjs to define siteUrl, ogImagePath, ogImageUrl, and ogImageAlt as constants for reuse and consistency.
  • Updated Open Graph meta tags to use the new constants and added additional tags for og:image:secure_url, og:image:type, og:image:width, og:image:height, and og:image:alt to improve link previews on social platforms.
  • Enhanced Twitter meta tags by using the new constants and adding twitter:image:alt, as well as including a link tag for image_src to further improve social sharing.

Documentation updates:

  • Removed the Authors field from spec/INTEGRATION-GUIDE.md for consistency and privacy.
  • Removed the Authors field from spec/SECURITY-MODEL.md for consistency and privacy.

Copilot AI review requested due to automatic review settings March 31, 2026 12:21
@olamide226 olamide226 merged commit 097b9ea into main Mar 31, 2026
1 of 2 checks passed
@olamide226 olamide226 deleted the fix/og-image branch March 31, 2026 12:22
Copy link
Copy Markdown
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 improves SEO/social sharing previews by refactoring Open Graph/Twitter metadata generation in the Astro docs site config and removes author attribution lines from two spec documents for consistency/privacy.

Changes:

  • Centralized site + OG image URL/alt text as constants and expanded Open Graph image metadata.
  • Improved Twitter card metadata with image alt text and an additional image_src link.
  • Removed Authors fields from spec/INTEGRATION-GUIDE.md and spec/SECURITY-MODEL.md.

Reviewed changes

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

File Description
docs/astro.config.mjs Refactors and expands OG/Twitter meta tags with shared constants for consistent previews.
spec/SECURITY-MODEL.md Removes Authors line from the document header block.
spec/INTEGRATION-GUIDE.md Removes Authors line from the document header block.

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


const siteUrl = 'https://rep-protocol.dev';
const ogImagePath = '/og-image.png';
const ogImageUrl = `${siteUrl}${ogImagePath}`;
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

Constructing URLs via string concatenation is brittle if siteUrl ever gains a trailing slash or ogImagePath changes (can lead to double slashes or missing slashes). Prefer constructing the URL via the URL constructor (e.g., new URL(ogImagePath, siteUrl).toString()) to make this resilient to future edits.

Suggested change
const ogImageUrl = `${siteUrl}${ogImagePath}`;
const ogImageUrl = new URL(ogImagePath, siteUrl).toString();

Copilot uses AI. Check for mistakes.
Comment on lines +115 to 121
tag: 'link',
attrs: {
rel: 'image_src',
href: ogImageUrl,
},
},
{
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

The link[rel=\"image_src\"] hint is non-standard/deprecated and is ignored by most modern crawlers in favor of Open Graph/Twitter tags. Consider removing it (or documenting why it’s needed) to avoid validator/linter warnings and reduce head noise.

Suggested change
tag: 'link',
attrs: {
rel: 'image_src',
href: ogImageUrl,
},
},
{

Copilot uses AI. Check for mistakes.
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