Skip to content

Commit

Permalink
Add prometheus-version docsearch meta tag to pages (#1636)
Browse files Browse the repository at this point in the history
* Add prometheus-version docsearch meta tag to pages

I hope this will cause the Aloglia indexing engine to add a
"prometheus-version" indexing facet to our pages, so that when adding
Algolia search to the site in a subsequent step (I can already test it
locally), we can use this to search only for pages that are either the
latest Prometheus version (otherwise we get 10x the same-looking
result), or have no Prometheus version at all (the doc pages outside of
the versioned Prometheus sub-tree). I need to explicitly add "none" as a
version for the non-versioned pages, as Algolia search doesn't allow
facet filtering on null / undefined values.

Signed-off-by: Julius Volz <[email protected]>

* Fix "unversioned" -> "none"

Signed-off-by: Julius Volz <[email protected]>
  • Loading branch information
juliusv authored May 19, 2020
1 parent cef6590 commit 0d6c0a2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions layouts/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
<link rel="icon" type="image/png" href="/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="/assets/favicons/android-chrome-manifest.json">
<% if (c = @item[:repo_docs]) && c[:canonical] %><link rel="canonical" href="<%= @item.path.sub(c[:items_root], c[:canonical]) %>" /><% end %>
<!-- Meta tag for indexing that enables faceted search in Algolia,
see https://docsearch.algolia.com/docs/required-configuration/#introduce-global-information-as-meta-tags -->
<meta name="docsearch:prometheus-version" content="<%= @item[:repo_docs] && @item[:repo_docs][:name] || 'none' %>" />
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="/assets/favicons/mstile-144x144.png">
<meta name="theme-color" content="#ffffff">
Expand Down

0 comments on commit 0d6c0a2

Please sign in to comment.