Skip to content

[19.0][ADD] website_blog_schema_org: Inject BlogPosting JSON-LD into blog posts - #1213

Open
nachoserra-domatix wants to merge 1 commit into
OCA:19.0from
Domatix:19.0-add-website_blog_schema_org
Open

nachoserra-domatix wants to merge 1 commit into
OCA:19.0from
Domatix:19.0-add-website_blog_schema_org

Conversation

@nachoserra-domatix

Copy link
Copy Markdown

This module injects a schema.org BlogPosting JSON-LD block into every
published blog post, so search engines can surface article rich results
(headline, author, dates, publisher and image).

The block is built from the post record (name, author, post date, modification
date, publisher and OpenGraph image) and injected before the main post section.
Only the blog post page is affected.

Tests cover the JSON-LD generation with and without an HTTP request.

@OCA-git-bot OCA-git-bot added series:19.0 mod:website_blog_schema_org Module website_blog_schema_org labels Aug 18, 2026
@nachoserra-domatix
nachoserra-domatix force-pushed the 19.0-add-website_blog_schema_org branch from 75fbe2e to 729a87b Compare August 18, 2026 11:53

@tarteo tarteo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM only some nitpicking

website = self.website_id or self.env["website"].get_current_website()
base_url = website.get_base_url()
slug = self.env["ir.http"]._slug
url = f"{base_url}/blog/{slug(self.blog_id)}/{slug(self)}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You could use field website_url here to make it simpler.

data = {
"@context": "https://schema.org",
"@type": "BlogPosting",
"headline": self.name or "",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

name is required, thus the fallback value is unnecesarry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:website_blog_schema_org Module website_blog_schema_org series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants