Skip to content

Commit a8f2908

Browse files
Zach LasiukZach Lasiuk
authored andcommitted
updated coveo metadata to align with new site expectaitons
1 parent da2eee6 commit a8f2908

File tree

1 file changed

+24
-17
lines changed

1 file changed

+24
-17
lines changed

themes/arm-design-system-hugo-theme/layouts/_default/index.coveo.xml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
xmlns:xhtml="http://www.w3.org/1999/xhtml"
44
xmlns:coveo="http://www.coveo.com/schemas/metadata">
55

6+
{{- $itemidcounter := 1 -}}
7+
8+
69

710
{{- range where .Site.Pages "Params.sitemap_exclude" "ne" true -}}
811
{{- $pathParts := split .RelPermalink "/" -}}
@@ -172,24 +175,28 @@
172175
{{ end }}
173176
{{- end -}}
174177

178+
179+
180+
181+
175182
{{- if and (.File) (in .File.Path "learning-paths") -}}
176-
<foldingcollection>
177-
{{- if .IsSection -}}
178-
{{- with .Title -}}
179-
{{ . }}
180-
{{- else -}}
181-
Unknown Section Title
182-
{{- end -}}
183-
{{- else -}}
184-
{{- with .Parent.Title -}}
185-
{{ . }}
186-
{{- else -}}
187-
Unknown Parent Title
188-
{{- end -}}
189-
{{- end -}}
190-
</foldingcollection>
191-
<parentitem>1</parentitem>
192-
<itemid>{{.Params.weight -}}</itemid>
183+
184+
185+
{{/* Ensure a unique ID for each learning path */}}
186+
{{- $itemidcounter = add $itemidcounter 1 -}}
187+
188+
189+
190+
<foldingcollection>
191+
{{- if .IsSection -}}{{ .Title }}
192+
{{- else -}}{{ .Parent.Title }}
193+
{{- end -}}
194+
</foldingcollection>
195+
<itemid>{{ md5 .RelPermalink }}</itemid>
196+
{{- if and .Parent (not .IsSection) (not .Parent.IsPage) (or .Parent.IsSection) }}
197+
<parentitem>{{ md5 .Parent.RelPermalink }}</parentitem>
198+
{{- end -}}
199+
193200
{{- end -}}
194201
</coveo:metadata>
195202
</url>

0 commit comments

Comments
 (0)