Skip to content

Commit

Permalink
docs: tag latest docs for search
Browse files Browse the repository at this point in the history
This PR adds to our templates to inject a "latest" version metadata if
the doc is indeed our latest version. This will be coupled with an algolia
facet filter to only return "latest" version results in a separate PR
after I kick a recrawl of the site once this is merged.

Signed-off-by: Spencer Smith <[email protected]>
  • Loading branch information
rsmitty committed Mar 24, 2022
1 parent a254254 commit 0497d5f
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions website/layouts/partials/hooks/body-end.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
{{ $currentVersionDir := index (split .Page.File.Dir "/" ) 0 | printf "/%s"}}
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3"></script>

<script>
docsearch({
appId: "D72DGJBSSA",
apiKey: "49ca9541d72f7814b88a3a9204988360",
indexName: "talos",
container: '#algolia-search',
debug: true
});
docsearch({
appId: "D72DGJBSSA",
apiKey: "49ca9541d72f7814b88a3a9204988360",
indexName: "talos",
container: '#algolia-search',
debug: true,
});
</script>


{{ if eq $currentVersionDir site.Params.url_latest_version }}
<meta name="docsearch:version" content="latest" />
{{ end }}

0 comments on commit 0497d5f

Please sign in to comment.