From 53f60bc6624bd262a5062101f24d9fa837fb047e Mon Sep 17 00:00:00 2001 From: Brandon Harvey <8107750+bharvey88@users.noreply.github.com> Date: Fri, 21 Aug 2026 20:44:51 -0500 Subject: [PATCH] Fill in the missing link embed metadata (#1090) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three gaps left over from the social card work, all visible whenever someone posts a wiki link in Discord. 97 pages carried no description at all. They have no `description` in their front matter, and `site_description` was never set, so the fallback resolved to nothing and the embed printed a bare title. That was survivable when the card was a full-width banner with its own text. Now that the image is a small generic mark, the description carries the page, so add a site-wide sentence for those pages to fall back to. Add `og:site_name`, so the small provider line above the title reads "Apollo Docs" instead of the raw wiki.apolloautomation.com. With that in place the " - Apollo Docs" suffix on every title repeats the line directly above it, so drop the suffix and give the title the full width before it truncates. The homepage still resolves to "Apollo Docs" once. Add a `theme-color` tag, which Discord uses to tint the stripe down the left edge of an embed and which Android uses to tint browser chrome. The stripe is drawn on every embed regardless; without this tag it is Discord's default grey. Material emits no such tag here because the palette uses a custom primary rather than a named color. It has to be `name=` rather than `property=`, so it cannot come from the card layout, which hardcodes `property=` for everything. It goes in overrides/main.html instead. Material's stock main.html is a bare `{% extends "base.html" %}`, so overriding it drops nothing. Verified by building all three page shapes and reading the emitted tags: a page with its own description keeps it, a page without one picks up the new fallback, and the homepage title does not double or empty out. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- layouts/apollo.yml | 12 +++++++----- mkdocs.yml | 1 + overrides/main.html | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 overrides/main.html diff --git a/layouts/apollo.yml b/layouts/apollo.yml index ae44111f27..8118fe57fe 100644 --- a/layouts/apollo.yml +++ b/layouts/apollo.yml @@ -54,10 +54,11 @@ definitions: - &site_name >- {{ config.site_name }} - # Page title with site name - - &page_title_with_site_name >- + # Page title. No site name suffix: `og:site_name` already prints "Apollo + # Docs" on its own line directly above the title in an embed. + - &page_title >- {%- if not page.is_homepage -%} - {{ page.meta.get("title", page.title) }} - {{ config.site_name }} + {{ page.meta.get("title", page.title) }} {%- else -%} {{ config.site_name }} {%- endif -%} @@ -83,7 +84,8 @@ tags: # Open Graph og:type: website - og:title: *page_title_with_site_name + og:site_name: *site_name + og:title: *page_title og:description: *page_description og:image: "{{ image.url }}" og:image:type: "{{ image.type }}" @@ -93,7 +95,7 @@ tags: # Twitter twitter:card: summary - twitter:title: *page_title_with_site_name + twitter:title: *page_title twitter:description: *page_description twitter:image: "{{ image.url }}" diff --git a/mkdocs.yml b/mkdocs.yml index 032e6955d2..450a34051c 100755 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -8,6 +8,7 @@ extra_css: - stylesheets/osano.css - stylesheets/pmm.css site_name: Apollo Docs +site_description: Setup guides, troubleshooting, and firmware documentation for Apollo Automation sensors. #site_url: https://apolloautomation.github.io/ site_url: https://wiki.apolloautomation.com repo_url: https://github.com/ApolloAutomation/docs diff --git a/overrides/main.html b/overrides/main.html new file mode 100644 index 0000000000..95c9a6f1a6 --- /dev/null +++ b/overrides/main.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} + +{% block extrahead %} + {{ super() }} + + {#- + Discord tints the vertical stripe on the left edge of a link embed with + this tag. Material does not emit one, because the palette here uses a + custom primary rather than a named color. It must be `name=` rather than + `property=`, so it cannot come from the social card layout, which emits + `property=` for everything. + -#} + +{% endblock %}