Skip to content

feat(website): Add Open Graph and Twitter Card meta tags for social sharing#815

Merged
aaronpowell merged 1 commit intostagedfrom
social-cards
Feb 25, 2026
Merged

feat(website): Add Open Graph and Twitter Card meta tags for social sharing#815
aaronpowell merged 1 commit intostagedfrom
social-cards

Conversation

@aaronpowell
Copy link
Contributor

Summary

Adds Open Graph and Twitter Card meta tags to the website layout so pages render rich previews when shared on social media (Facebook, Twitter/X, LinkedIn, Discord, etc.).

Changes

website/src/layouts/BaseLayout.astro

  • Added og:type, og:url, og:title, og:description, og:image, og:site_name meta tags
  • Added twitter:card (summary_large_image), twitter:title, twitter:description, twitter:image meta tags
  • Added canonical URL <link> element
  • Changed title separator from - to | (e.g. Agents | Awesome GitHub Copilot)
  • Uses new social-image.png from public/images/

website/src/scripts/modal.ts

  • document.title updates dynamically when a modal opens to reflect the resource being viewed (e.g. Accessibility Expert | Awesome GitHub Copilot)
  • Titles are resolved from JSON data files (agents.json, skills.json, etc.) using the resource's title property rather than the raw filename
  • Handles skill/hook folder-path mismatches for correct title lookup
  • Original page title is restored when the modal closes

website/public/images/social-image.png

  • New social preview image for og:image / twitter:image tags

Testing

  • npm run build and npx astro build both pass
  • Verified OG tags appear correctly in built HTML output
  • Line endings normalized

…haring

- Add og:type, og:url, og:title, og:description, og:image, og:site_name meta tags
- Add twitter:card, twitter:title, twitter:description, twitter:image meta tags
- Add canonical URL link element
- Use social-image.png for social preview image
- Update document.title dynamically when modal opens/closes
- Resolve resource titles from JSON data files instead of raw filenames
- Handle skill/hook folder path mismatches for title lookup
- Change title separator from '-' to '|' for consistency

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 25, 2026 08:28
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

Adds social-sharing metadata (Open Graph + Twitter Card) to the Astro base layout and improves modal title handling so the browser tab title reflects the currently opened resource.

Changes:

  • Added canonical link plus Open Graph and Twitter Card meta tags in the base layout (including a new social preview image URL).
  • Updated the file modal to set/restore document.title and resolve human-friendly titles from generated JSON metadata.
  • Added a new social-image.png under website/public/images/ for rich link previews.

Reviewed changes

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

File Description
website/src/layouts/BaseLayout.astro Adds canonical + OG/Twitter meta tags and updates the page title format to use `
website/src/scripts/modal.ts Dynamically updates/restores document.title and resolves modal titles from JSON metadata.
website/public/images/social-image.png Adds a social preview image referenced by OG/Twitter meta tags.

Comment on lines +43 to +45
plugin: "plugins.json",
};

Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

RESOURCE_TYPE_TO_JSON maps plugin -> plugins.json, but plugins.json items (generated by eng/generate-website-data.mjs) use name rather than title. As a result, resolveResourceTitle() can return undefined for plugins and briefly set title.textContent / document.title to undefined | Awesome GitHub Copilot when opening a plugin modal. Consider removing plugin from this lookup map (since openPluginModal() already sets the title), or special-casing plugins to read name (and updating the typed interface accordingly), or using a JSON source that actually contains a title field for plugins.

Suggested change
plugin: "plugins.json",
};
};

Copilot uses AI. Check for mistakes.
@aaronpowell aaronpowell merged commit 3de857c into staged Feb 25, 2026
6 checks passed
@aaronpowell aaronpowell deleted the social-cards branch February 25, 2026 08:33
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