Skip to content

Commit 4850d18

Browse files
committed
Assign all versions to non-versioned content so that we get search results even if a facet filters is applied
1 parent d10ef07 commit 4850d18

File tree

1 file changed

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

1 file changed

+12
-2
lines changed

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,18 @@
1515
{{- end }}
1616
{{- $versionShort := .Page.Store.Get "versionShort" }}
1717
{{- $versionAlias := .Page.Store.Get "alias" }}
18-
{{- if $versionShort }}
19-
<meta name="docsearch:version" content="{{ $versionShort }}{{ if ne $versionShort $versionAlias }},{{ $versionAlias }}{{ end }}">
18+
{{- if $versionShort -}}
19+
<meta name="docsearch:version" content="{{ $versionShort }}{{ if ne $versionShort $versionAlias }},{{ $versionAlias }}{{ end }}">
20+
{{- else }}
21+
{{- $shortVersions := slice }}
22+
{{- $versions := index site.Data.versions "/arangodb/" }}
23+
{{- range $version := $versions }}
24+
{{- $shortVersions = $shortVersions | append $version.name }}
25+
{{- if ne $version.name $version.alias }}
26+
{{- $shortVersions = $shortVersions | append $version.alias }}
27+
{{- end }}
28+
{{- end -}}
29+
<meta name="docsearch:version" content="{{ delimit $shortVersions "," }}">
2030
{{- end }}
2131
{{- if (hasPrefix .Path "/arangodb/") }}
2232
{{- if or (.Page.Store.Get "deprecated") (.Page.Store.Get "inDevelopment") }}<meta name="robots" content="noindex">{{ end }}

0 commit comments

Comments
 (0)