Skip to content

Commit 8976bf0

Browse files
authored
Merge pull request #800 from mpourismaiel/fix/subitems/multilingual
Update subitems helper to fix multilingual issue
2 parents df44b2b + ec73670 commit 8976bf0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

layouts/partials/helpers/subitems.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
{{- $name := .Name -}}
44
{{- $site := .Site -}}
55
{{- $page_scratch := .page_scratch -}}
6-
{{- $items := where ($page.Resources.Match (printf "%s/*.md" $name)) ".Name" "ne" $self.Name -}}
6+
{{ $default_lang := .root.Site.Params.DefaultContentLanguage | default .root.Site.Language.Lang }}
7+
8+
{{- $items := where ($page.Resources.Match (printf "%s/*.md" (strings.TrimSuffix (cond (ne $default_lang $page.Language.Lang) (printf "/index.%s" $page.Language.Lang) "") $name))) ".Name" "ne" $self.Name -}}
79

810
{{- if eq (len $items) 0 -}}
911
{{- range $directory := ($page_scratch.Get "fragment_directories") -}}

0 commit comments

Comments
 (0)