Repository navigation
Fix og:url and og:image tags in base.html - #528
Open
astra-intelligence wants to merge 1 commit into
Open
astra-intelligence wants to merge 1 commit into
astra-intelligence wants to merge 1 commit into
Conversation
og:url referenced the undefined 'site' variable (template uses current_site) and produced a relative URL; page.full_url emits the absolute URL. og:image was emitted as name= instead of property= so OG consumers missed it. Closes wagtail#513.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix og:url and og:image tags in base.html
Closes #513
Fixes both Open Graph bugs reported in the SEO audit:
og:urlwas relative — it used{{ site.root_url }}{{ page.url }}, butsiteis not defined in this template (the correct variable iscurrent_site), so the tag rendered as just the page path (e.g./en/). Usingpage.full_urlemits the full absolute URL, which is what OG consumers expect.og:imageusedname=instead ofproperty=—<meta name="og:image">is not picked up by Open Graph consumers that look forproperty="og:image". Changed toproperty=to match the other og tags on the page.Verified:
page.full_urlis the same pattern already asserted inapps/core/tests/test_structured_data.py— the change is a two-line template edit, minimal surface.