-
Notifications
You must be signed in to change notification settings - Fork 19
Improve SEO by adding proper titles and og:tags #152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,11 @@ | ||
| --- | ||
| title: Devant Documentation | ||
| description: Devant Documentation - Build, deploy, and manage integrations in the cloud | ||
| template: templates/home-page-2.html | ||
| extra: | ||
| og:title: Devant Documentation | ||
| og:description: Devant Documentation - Build, deploy, and manage integrations in the cloud | ||
| og:image: https://wso2.com/devant/docs/assets/images/og-devant.png | ||
| og:type: website | ||
| og:url: https://wso2.com/devant/docs/ | ||
| --- | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -30,6 +30,42 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {% endif %} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <link rel="icon" href="{{ config.theme.favicon | url }}"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <meta name="generator" content="mkdocs-{{ mkdocs_version }}, mkdocs-material-9.1.2"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {# Open Graph tags #} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {# og:title - match the <title> tag logic #} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {% if page.meta and page.meta.extra and page.meta.extra['og:title'] %} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <meta property="og:title" content="{{ page.meta.extra['og:title'] }}"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {% elif page.meta and page.meta.title %} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <meta property="og:title" content="{{ page.meta.title }} - {{ config.site_name }}"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {% elif page.title and not page.is_homepage %} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <meta property="og:title" content="{{ page.title | striptags }} - {{ config.site_name }}"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {% else %} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <meta property="og:title" content="{{ config.site_name }}"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {% endif %} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {# 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 %} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+47
to
+61
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Partial When Each OG property should independently fall back to a default rather than being gated by the existence of the 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
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {# og:url - use page canonical URL if available, otherwise custom URL from metadata #} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {% if page.meta and page.meta.extra and page.meta.extra['og:url'] %} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <meta property="og:url" content="{{ page.meta.extra['og:url'] }}"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {% elif page.canonical_url %} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <meta property="og:url" content="{{ page.canonical_url }}"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {% endif %} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {% endblock %} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {% block htmltitle %} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {% if page.meta and page.meta.title %} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should say develop too