From 646c0a8d4003be36739956aa49b97b01277265d8 Mon Sep 17 00:00:00 2001 From: Steve Smith Date: Tue, 7 Jul 2026 11:23:05 +0100 Subject: [PATCH] Badge external website results in docs search Records indexed from www.cloudmailin.com already carry external: true; show a small cloudmailin.com pill next to those results so it's clear they navigate away from the docs. --- content/assets/javascripts/search.js | 3 ++- content/assets/stylesheets/docs_new.scss | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/content/assets/javascripts/search.js b/content/assets/javascripts/search.js index 9a78b74..54405a1 100644 --- a/content/assets/javascripts/search.js +++ b/content/assets/javascripts/search.js @@ -38,7 +38,8 @@ autocomplete({ }, item({ item, components, html }) { return html` -

${item.title}

+

${item.title}${item.external + ? html`cloudmailin.com` : ''}

${components.Highlight({ hit: item, attribute: 'description' })}

`; } diff --git a/content/assets/stylesheets/docs_new.scss b/content/assets/stylesheets/docs_new.scss index eff9331..a9c1772 100644 --- a/content/assets/stylesheets/docs_new.scss +++ b/content/assets/stylesheets/docs_new.scss @@ -150,6 +150,23 @@ a.search-result, a.search-result:hover { color: var(--search-result-prevew-color); margin-bottom: 0px; } + + .search-badge { + display: inline-block; + margin-left: 6px; + padding: 0px 6px; + border: 1px solid currentColor; + border-radius: 8px; + font-size: x-small; + font-weight: normal; + vertical-align: middle; + color: var(--search-result-prevew-color); + + &::after { + // north-east arrow, forced text presentation (no emoji rendering) + content: ' \2197\FE0E'; + } + } } #middle {