Skip to content

Commit 83a77f7

Browse files
Merge pull request #2068 from zachlasiuk/main
TEMPLATE: Updated COVEO metadata to align with site expectations
2 parents da2eee6 + bbd2d36 commit 83a77f7

File tree

1 file changed

+29
-18
lines changed

1 file changed

+29
-18
lines changed

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

Lines changed: 29 additions & 18 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 "/" -}}
@@ -31,7 +34,11 @@
3134
<coveo:metadata>
3235
<contenttype>Learning Path</contenttype>
3336
<title>
34-
{{- .Params.title -}}
37+
{{- if and (.File) (in .File.Path "install-guides") -}}
38+
{{ .Params.title}} - Install Guide
39+
{{- else -}}
40+
{{- .Params.title -}}
41+
{{- end -}}
3542
</title>
3643
<description>
3744
{{- if and (.File) (in .File.Path "learning-paths") -}}
@@ -172,24 +179,28 @@
172179
{{ end }}
173180
{{- end -}}
174181

182+
183+
184+
185+
175186
{{- 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>
187+
188+
189+
{{/* Ensure a unique ID for each learning path */}}
190+
{{- $itemidcounter = add $itemidcounter 1 -}}
191+
192+
193+
194+
<foldingcollection>
195+
{{- if .IsSection -}}{{ .Title }}
196+
{{- else -}}{{ .Parent.Title }}
197+
{{- end -}}
198+
</foldingcollection>
199+
<itemid>{{ md5 .RelPermalink }}</itemid>
200+
{{- if and .Parent (not .IsSection) (not .Parent.IsPage) (or .Parent.IsSection) }}
201+
<parentitem>{{ md5 .Parent.RelPermalink }}</parentitem>
202+
{{- end -}}
203+
193204
{{- end -}}
194205
</coveo:metadata>
195206
</url>

0 commit comments

Comments
 (0)