Skip to content

Improve SEO by adding proper titles and og:tags#152

Open
sm1990 wants to merge 1 commit intowso2:mainfrom
sm1990:seo
Open

Improve SEO by adding proper titles and og:tags#152
sm1990 wants to merge 1 commit intowso2:mainfrom
sm1990:seo

Conversation

@sm1990
Copy link
Contributor

@sm1990 sm1990 commented Feb 6, 2026

Purpose

$subject
#150

Goals

Describe the solutions that this feature/fix will introduce to resolve the problems described above

Approach

Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email documentation@wso2.com to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here.

User stories

Summary of user stories addressed by this change>

Release note

Brief description of the new feature or bug fix as it will appear in the release notes

Documentation

Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter “N/A” plus brief explanation of why there’s no doc impact

Training

Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable

Certification

Type “Sent” when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to certification@wso2.com and NOT pasted in this PR. If there is no impact on certification exams, type “N/A” and explain why.

Marketing

Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable

Automation tests

  • Unit tests

    Code coverage information

  • Integration tests

    Details about the test cases and coverage

Security checks

Samples

Provide high-level details about the samples related to this feature

Related PRs

List any other related PRs

Migrations (if applicable)

Describe migration steps and platforms on which migration has been tested

Test environment

List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested

Learning

Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem.

Summary by CodeRabbit

Release Notes

  • New Features

    • Implemented Open Graph meta tags to enhance social media sharing with customizable preview information including titles, descriptions, images, and URLs. Features intelligent fallback logic to automatically populate missing metadata values from page and site configuration.
  • Chores

    • Configured the documentation site name and established metadata infrastructure to improve SEO and social integration capabilities.

@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

Walkthrough

Updates documentation site to support Open Graph metadata, including front matter configuration in the index page, site name definition in the MkDocs configuration, and conditional meta tag rendering in the theme template with fallback logic.

Changes

Cohort / File(s) Summary
Documentation Metadata
en/docs/index.md
Added front matter with title, description, template fields and Open Graph metadata (og:title, og:description, og:image, og:type, og:url).
Site Configuration
en/mkdocs.yml
Updated site_name from empty string to "Devant Documentation".
Theme Template
en/theme/material/base.html
Added comprehensive Open Graph meta tag block with conditional fallback logic for og:title, og:description, og:image, og:type, and og:url based on page metadata and site configuration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Whiskers twitching with delight,
Meta tags now shine so bright,
Open Graph takes its rightful place,
Social sharing finds its grace!
From docs to cards, content will flow, 🌐✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The description follows the template structure with all required sections present as headings, but most sections contain only placeholder text or the template boilerplate without concrete details filled in by the author. Fill in the Goals, Approach, User stories, Release note, and other key sections with specific details about how the SEO improvements were implemented and their impact, rather than leaving placeholder text.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding proper titles and Open Graph tags for SEO improvements, which directly aligns with the modifications to en/docs/index.md, en/mkdocs.yml, and en/theme/material/base.html.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
en/theme/material/base.html (2)

9-9: ⚠️ Potential issue | 🔴 Critical

noindex robots directive contradicts the SEO improvement goal of this PR.

Line 9 contains <meta name="robots" content="noindex">, which instructs search engines to not index any page on the site. This completely undermines the OG tags and title improvements being added for SEO. If this is intentional for a staging/preview environment, it should be conditionally applied; otherwise, it should be removed for production.


72-72: ⚠️ Potential issue | 🟡 Minor

Remove style attribute from <title> tag.

The <title> element is not a visible element — it only sets the browser tab/window title and is used by search engines. An inline style="color: blue;" has no effect here and looks like a debug artifact.

Proposed fix
-        <title style="color: blue;">{{ page.meta.title }} - {{ config.site_name }}</title>
+        <title>{{ page.meta.title }} - {{ config.site_name }}</title>
🤖 Fix all issues with AI agents
In `@en/theme/material/base.html`:
- Around line 47-61: The template currently gates all OG fallbacks on the
presence of page.meta.extra, causing missing tags when extra is present but
partial; update the base.html template to render each meta property
independently by checking page.meta.extra['og:description'],
page.meta.extra['og:image'], and page.meta.extra['og:type'] individually and
using config.site_description, the default image URL, and "website" respectively
when each key is absent (i.e., change the single if/else that wraps all three
tags into three separate conditional expressions that fall back per-property).

Comment on lines +47 to +61
{% if page.meta and page.meta.extra %}
{% if page.meta.extra['og:description'] %}
<meta property="og:description" content="{{ page.meta.extra['og:description'] }}">
{% endif %}
{% if page.meta.extra['og:image'] %}
<meta property="og:image" content="{{ page.meta.extra['og:image'] }}">
{% endif %}
{% if page.meta.extra['og:type'] %}
<meta property="og:type" content="{{ page.meta.extra['og:type'] }}">
{% endif %}
{% else %}
<meta property="og:description" content="{{ config.site_description }}">
<meta property="og:type" content="website">
<meta property="og:image" content="https://wso2.com/devant/docs/assets/images/og-devant.png">
{% endif %}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Partial extra metadata causes missing OG fallbacks for og:description, og:image, and og:type.

When page.meta.extra exists but only defines some OG keys (e.g., only og:title), the {% else %} branch on line 57 is skipped entirely, so og:description, og:image, and og:type won't be emitted at all. Currently index.md defines all keys so it works, but any future page with partial extra metadata will silently lose these tags.

Each OG property should independently fall back to a default rather than being gated by the existence of the extra object.

Proposed fix — independent fallbacks per property
       {# Other Open Graph tags #}
-      {% if page.meta and page.meta.extra %}
-        {% if page.meta.extra['og:description'] %}
-          <meta property="og:description" content="{{ page.meta.extra['og:description'] }}">
-        {% endif %}
-        {% if page.meta.extra['og:image'] %}
-          <meta property="og:image" content="{{ page.meta.extra['og:image'] }}">
-        {% endif %}
-        {% if page.meta.extra['og:type'] %}
-          <meta property="og:type" content="{{ page.meta.extra['og:type'] }}">
-        {% endif %}
-      {% else %}
-        <meta property="og:description" content="{{ config.site_description }}">
-        <meta property="og:type" content="website">
-        <meta property="og:image" content="https://wso2.com/devant/docs/assets/images/og-devant.png">
-      {% endif %}
+      {% if page.meta and page.meta.extra and page.meta.extra['og:description'] %}
+        <meta property="og:description" content="{{ page.meta.extra['og:description'] }}">
+      {% elif config.site_description %}
+        <meta property="og:description" content="{{ config.site_description }}">
+      {% endif %}
+
+      {% if page.meta and page.meta.extra and page.meta.extra['og:image'] %}
+        <meta property="og:image" content="{{ page.meta.extra['og:image'] }}">
+      {% else %}
+        <meta property="og:image" content="https://wso2.com/devant/docs/assets/images/og-devant.png">
+      {% endif %}
+
+      {% if page.meta and page.meta.extra and page.meta.extra['og:type'] %}
+        <meta property="og:type" content="{{ page.meta.extra['og:type'] }}">
+      {% else %}
+        <meta property="og:type" content="website">
+      {% endif %}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{% if page.meta and page.meta.extra %}
{% if page.meta.extra['og:description'] %}
<meta property="og:description" content="{{ page.meta.extra['og:description'] }}">
{% endif %}
{% if page.meta.extra['og:image'] %}
<meta property="og:image" content="{{ page.meta.extra['og:image'] }}">
{% endif %}
{% if page.meta.extra['og:type'] %}
<meta property="og:type" content="{{ page.meta.extra['og:type'] }}">
{% endif %}
{% else %}
<meta property="og:description" content="{{ config.site_description }}">
<meta property="og:type" content="website">
<meta property="og:image" content="https://wso2.com/devant/docs/assets/images/og-devant.png">
{% endif %}
{% if page.meta and page.meta.extra and page.meta.extra['og:description'] %}
<meta property="og:description" content="{{ page.meta.extra['og:description'] }}">
{% elif config.site_description %}
<meta property="og:description" content="{{ config.site_description }}">
{% endif %}
{% if page.meta and page.meta.extra and page.meta.extra['og:image'] %}
<meta property="og:image" content="{{ page.meta.extra['og:image'] }}">
{% else %}
<meta property="og:image" content="https://wso2.com/devant/docs/assets/images/og-devant.png">
{% endif %}
{% if page.meta and page.meta.extra and page.meta.extra['og:type'] %}
<meta property="og:type" content="{{ page.meta.extra['og:type'] }}">
{% else %}
<meta property="og:type" content="website">
{% endif %}
🤖 Prompt for AI Agents
In `@en/theme/material/base.html` around lines 47 - 61, The template currently
gates all OG fallbacks on the presence of page.meta.extra, causing missing tags
when extra is present but partial; update the base.html template to render each
meta property independently by checking page.meta.extra['og:description'],
page.meta.extra['og:image'], and page.meta.extra['og:type'] individually and
using config.site_description, the default image URL, and "website" respectively
when each key is absent (i.e., change the single if/else that wraps all three
tags into three separate conditional expressions that fall back per-property).

@@ -1,3 +1,11 @@
---
title: Devant Documentation
description: Devant Documentation - Build, deploy, and manage integrations in the cloud
Copy link
Contributor

Choose a reason for hiding this comment

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

Should say develop too

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.

2 participants

Comments