Skip to content

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

Merged
sbglasius merged 1 commit intoapache:masterfrom
Divyapahuja31:feature/enhance-seo-smo
Mar 5, 2026
Merged

feat: Enhance SEO/SMO with dynamic Open Graph tags#426
sbglasius merged 1 commit intoapache:masterfrom
Divyapahuja31:feature/enhance-seo-smo

Conversation

@Divyapahuja31
Copy link
Contributor

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.

Copy link
Contributor

@sbglasius sbglasius left a comment

Choose a reason for hiding this comment

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

@Divyapahuja31 If you rebase this PR then I will approve it.

@Divyapahuja31
Copy link
Contributor Author

@Divyapahuja31 If you rebase this PR then I will approve it.

sure

@Divyapahuja31 Divyapahuja31 force-pushed the feature/enhance-seo-smo branch from 98dfc39 to de26993 Compare March 3, 2026 22:49
Copy link
Contributor

@jdaugherty jdaugherty left a comment

Choose a reason for hiding this comment

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

Can you please restore the original spacing to the document.html, etc? These changes are separate from the PR and should not be included.

@Divyapahuja31 Divyapahuja31 force-pushed the feature/enhance-seo-smo branch from de26993 to f56ebb2 Compare March 4, 2026 19:17
@Divyapahuja31
Copy link
Contributor Author

Can you please restore the original spacing to the document.html, etc? These changes are separate from the PR and should not be included.

Done! I have restored the original spacing in document.html and removed the unrelated lazy-loading changes. The PR now focus strictly on the dynamic Open Graph tags as originally intended. Thanks for catching that!

Copy link
Contributor

@jdaugherty jdaugherty left a comment

Choose a reason for hiding this comment

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

@sbglasius if you're good, i'm ok to merge this.

@sbglasius sbglasius merged commit 78394ce into apache:master Mar 5, 2026
1 check passed
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.

3 participants