Skip to content

Commit 4194ee4

Browse files
committed
Only set the docsearch facet based on the URL version
Together with the Algolia ignoreCanonicalTo setting set to true, this might allow to get hits with the version the user is on instead of the alias
1 parent d79eb5f commit 4194ee4

File tree

1 file changed

+4
-4
lines changed
  • site/themes/arangodb-docs-theme/layouts/partials

1 file changed

+4
-4
lines changed

site/themes/arangodb-docs-theme/layouts/partials/meta.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
{{- with .Site.Params.author }}
1414
<meta name="author" content="{{ . }}">
1515
{{- end }}
16-
{{- $versionShort := .Page.Store.Get "versionShort" }}
17-
{{- $versionAlias := .Page.Store.Get "alias" }}
18-
{{- if $versionShort -}}
19-
<meta name="docsearch:version" content="{{ $versionShort }}{{ if ne $versionShort $versionAlias }},{{ $versionAlias }}{{ end }}">
16+
{{- $splitPath := split .Path "/" }}
17+
{{- if and (hasPrefix .Path "/arangodb/") (ge ($splitPath | len) 3) }}
18+
{{- $coreVersion := index $splitPath 2 }}
19+
<meta name="docsearch:version" content="{{ $coreVersion }}">
2020
{{- else }}
2121
{{- $shortVersions := slice }}
2222
{{- $versions := index site.Data.versions "/arangodb/" }}

0 commit comments

Comments
 (0)