Skip to content

Commit 53cf489

Browse files
Refactor meta description handling in head.html for clarity and consistency
1 parent f90ce49 commit 53cf489

1 file changed

Lines changed: 4 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: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,10 @@
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 | default "" | plainify | htmlEscape | strings.TrimSpace -}}
31+
{{- if gt (len $d) 0 -}}
32+
<meta name="description" content="{{ $d }}">
3633
{{- end -}}
3734

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

0 commit comments

Comments
 (0)