You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by "jamesfredley (via GitHub)" <gi...@apache.org> on 2026/06/01 17:18:48 UTC
[PR] Fix Open Graph URL for generated guides pages [grails-static-website]
jamesfredley opened a new pull request, #516:
URL: https://github.com/apache/grails-static-website/pull/516
## What
Fixes a pre-existing bug in the Open Graph URL (`og:url`) of the **generated guides pages** (the guides index and the per-tag, per-category, and - since #515 - per-version pages).
`RenderSiteTask.renderPages` computed `ogurl = siteMeta['url'] + page.path` and merged it **last**, overriding any page-provided value. Those generated `Page` objects carry only a bare leaf filename as their path (e.g. `8.html`), so the tag rendered as:
```
<meta property='og:url' content='https://grails.apache.org8.html'/>
```
instead of the real URL. Disk-parsed main-site pages were unaffected because their path is already root-relative (e.g. `/faq.html`).
## Fix
- `RenderSiteTask.renderPages` now applies the computed default `ogurl` **only when the page metadata does not already provide one**, so a page can set its own.
- `GuidesTask` sets the correct absolute `ogurl` in the front-matter of each generated page.
## Before / after
| Page | Before | After |
|------|--------|-------|
| `/guides/index.html` | `https://grails.apache.orgindex.html` | `https://grails.apache.org/guides/index.html` |
| `/guides/versions/8.html` | `https://grails.apache.org8.html` | `https://grails.apache.org/guides/versions/8.html` |
| `/guides/tags/htmx.html` | `https://grails.apache.orghtmx.html` | `https://grails.apache.org/guides/tags/htmx.html` |
| `/guides/categories/gorm.html` | `https://grails.apache.orggorm.html` | `https://grails.apache.org/guides/categories/gorm.html` |
## Testing
- `./gradlew genGuides` - all four generated `og:url` values now resolve correctly (verified in the built HTML).
- `./gradlew build` - main-site pages are unchanged (`https://grails.apache.org/community.html`, `/faq.html`, `/index.html`), confirming the shared `renderPages` change is behavior-preserving for disk-parsed pages (none of which set `ogurl`).
## Notes
This was flagged during the review of #515 as a pre-existing issue that the new version pages inherited; fixing it here in a focused, separate PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix Open Graph URL for generated guides pages [grails-static-website]
Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley merged PR #516:
URL: https://github.com/apache/grails-static-website/pull/516
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org