diff --git a/themes/arm-design-system-hugo-theme/layouts/partials/head/head.html b/themes/arm-design-system-hugo-theme/layouts/partials/head/head.html index b1d49bd052..78b6750da7 100644 --- a/themes/arm-design-system-hugo-theme/layouts/partials/head/head.html +++ b/themes/arm-design-system-hugo-theme/layouts/partials/head/head.html @@ -26,13 +26,15 @@ {{ $title }} -{{/* Meta description: short, task-oriented summary for SERP and AI selection. - This is intentionally distinct from the JSON-LD description. */}} -{{- with .Params.description -}} - {{- $d := . | plainify | htmlEscape | trim " \t\r\n" -}} - {{- if gt (len $d) 0 -}} - - {{- end -}} +{{/* Meta description */}} +{{- $d := .Params.description + | default "" + | plainify + | replaceRE `(?s)^\s+|\s+$` "" + | htmlEscape +-}} +{{- if gt (len $d) 0 -}} + {{- end -}} {{ partial "head/jsonld.html" . }}