You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sedona.apache.org by "jiayuasu (via GitHub)" <gi...@apache.org> on 2026/10/22 07:07:04 UTC

Re: [PR] [GH-1328] Add Open Graph and Twitter Card meta tags [sedona]

jiayuasu commented on code in PR #3392:
URL: https://github.com/apache/sedona/pull/3392#discussion_r4345465696


##########
docs-overrides/main.html:
##########
@@ -25,6 +25,33 @@
 <meta name="msapplication-config" content="{{ 'favicons/browserconfig.xml' | url }}">
 <meta name="msapplication-TileColor" content="#ca463a">
 <meta name="theme-color" content="#ca463a">
+{# Open Graph / Twitter cards. Social crawlers need an absolute image URL (GH-1328). #}
+{%- set og_title = config.site_name -%}
+{%- if page and page.meta and page.meta.title -%}
+  {%- set og_title = page.meta.title -%}
+{%- elif page and page.title and not page.is_homepage -%}
+  {%- set og_title = page.title | striptags -%}
+{%- endif -%}
+{%- set og_description = config.site_description or '' -%}
+{%- if page and page.meta and page.meta.description -%}
+  {%- set og_description = page.meta.description -%}
+{%- endif -%}
+{%- set og_url = page.canonical_url if page and page.canonical_url else config.site_url -%}
+{%- set og_image = config.site_url.rstrip('/') ~ '/latest/image/sedona-ecosystem.png' -%}

Review Comment:
   Blocking: Mike already adds `/latest` to `config.site_url` during deployment because we set `canonical_version: latest`. I built this with `MIKE_DOCS_VERSION=latest-snapshot` and both image tags point to `https://sedona.apache.org/latest/latest/image/sedona-ecosystem.png`, so previews still won't have an image. Please avoid adding `/latest` twice.



##########
docs-overrides/main.html:
##########
@@ -25,6 +25,33 @@
 <meta name="msapplication-config" content="{{ 'favicons/browserconfig.xml' | url }}">
 <meta name="msapplication-TileColor" content="#ca463a">
 <meta name="theme-color" content="#ca463a">
+{# Open Graph / Twitter cards. Social crawlers need an absolute image URL (GH-1328). #}
+{%- set og_title = config.site_name -%}
+{%- if page and page.meta and page.meta.title -%}
+  {%- set og_title = page.meta.title -%}
+{%- elif page and page.title and not page.is_homepage -%}
+  {%- set og_title = page.title | striptags -%}
+{%- endif -%}
+{%- set og_description = config.site_description or '' -%}
+{%- if page and page.meta and page.meta.description -%}
+  {%- set og_description = page.meta.description -%}
+{%- endif -%}
+{%- set og_url = page.canonical_url if page and page.canonical_url else config.site_url -%}
+{%- set og_image = config.site_url.rstrip('/') ~ '/latest/image/sedona-ecosystem.png' -%}
+<meta property="og:type" content="website">
+<meta property="og:title" content="{{ og_title }}">
+<meta property="og:description" content="{{ og_description }}">

Review Comment:
   Non-blocking: please add `|e` to these values and the Twitter equivalents. MkDocs doesn't enable Jinja autoescaping here. I tested a title of `Using "quoted" SQL`, and the parsed meta value was just `Using `. Descriptions have the same problem. None of the current titles or descriptions contain double quotes, so this can be a follow-up.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org