Skip to content

Comments

feat: Enhance SEO/SMO with dynamic Open Graph tags#426

Open
Divyapahuja31 wants to merge 2 commits intoapache:masterfrom
Divyapahuja31:feature/enhance-seo-smo
Open

feat: Enhance SEO/SMO with dynamic Open Graph tags#426
Divyapahuja31 wants to merge 2 commits intoapache:masterfrom
Divyapahuja31:feature/enhance-seo-smo

Conversation

@Divyapahuja31
Copy link

Description

This PR significantly improves the website's SEO (Search Engine Optimization) and SMO (Social Media Optimization) by implementing dynamic Open Graph meta tags.

The Problem

Previously, the og:url and og:image tags were hardcoded or static. This meant that when users shared specific blog posts or documentation pages on platforms like Twitter, LinkedIn, or Slack, the preview often displayed generic information or the wrong image, leading to poor user engagement.

The Solution

I have updated RenderSiteTask.groovy and BlogTask.groovy to dynamically generate metadata:

  1. Dynamic og:url: Each specific page now reports its permalink instead of the site root, ensuring social platforms point users to the correct destination.
  2. Smart og:image:
    • Blog Posts: If a post defines a custom image, it is now correctly used for the preview.
    • Videos: YouTube video posts now automatically fetch and use the high-quality video thumbnail.
    • Fallback: Pages without specific media gracefully fall back to the default Grails logo.
  3. Cleanup: Removed hardcoded og:image:width and og:image:height tags (300x300), which were causing distortion for non-square images.

Impact

These changes ensure that all shared links from the Grails website look professional, relevant, and visually appealing, directly improving the brand's presence on social media.

Checklist

  • Verified og:url points to the correct permalink on blog posts and pages.
  • Verified og:image correctly picks up blog post images.
  • Verified fallback to default Grails logo for pages without images.
  • Removed incorrect fixed image dimensions.

DIVYA PAHUJA added 2 commits February 7, 2026 23:33
Added dynamic og:url and og:image generation for better social media previews.
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