Skip to content

Commit 7cfd72c

Browse files
authored
Merge pull request #2794 from madeline-underwood/meta_fix
Meta description field fix
2 parents f446545 + cf7c884 commit 7cfd72c

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

  • themes/arm-design-system-hugo-theme/layouts/partials/head

themes/arm-design-system-hugo-theme/layouts/partials/head/head.html

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@
2626
<link rel="canonical" href="https://learn.arm.com{{ .Permalink }}" />
2727
<title>{{ $title }}</title>
2828

29-
{{/* Meta description: short, task-oriented summary for SERP and AI selection.
30-
This is intentionally distinct from the JSON-LD description. */}}
31-
{{- with .Params.description -}}
32-
{{- $d := . | plainify | htmlEscape | trim " \t\r\n" -}}
33-
{{- if gt (len $d) 0 -}}
34-
<meta name="description" content="{{ $d }}">
35-
{{- end -}}
29+
{{/* Meta description */}}
30+
{{- $d := .Params.description
31+
| default ""
32+
| plainify
33+
| replaceRE `(?s)^\s+|\s+$` ""
34+
| htmlEscape
35+
-}}
36+
{{- if gt (len $d) 0 -}}
37+
<meta name="description" content="{{ $d }}">
3638
{{- end -}}
3739

3840
{{ partial "head/jsonld.html" . }}

0 commit comments

Comments
 (0)