diff --git a/en/docs/index.md b/en/docs/index.md index 524034e8..970b9154 100755 --- a/en/docs/index.md +++ b/en/docs/index.md @@ -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/ --- diff --git a/en/mkdocs.yml b/en/mkdocs.yml index c4ed3760..5c140373 100644 --- a/en/mkdocs.yml +++ b/en/mkdocs.yml @@ -15,7 +15,7 @@ # under the License. # Project information -site_name: "" +site_name: "Devant Documentation" site_description: Devant Learning Portal site_author: WSO2 site_url: https://wso2.com/devant/docs diff --git a/en/theme/material/assets/images/og-devant.png b/en/theme/material/assets/images/og-devant.png new file mode 100644 index 00000000..39b84930 Binary files /dev/null and b/en/theme/material/assets/images/og-devant.png differ diff --git a/en/theme/material/base.html b/en/theme/material/base.html index ebf8ba8c..137e0117 100644 --- a/en/theme/material/base.html +++ b/en/theme/material/base.html @@ -30,6 +30,42 @@ {% endif %} + + {# Open Graph tags #} + {# og:title - match the 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 %} + + {# 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 %}