Skip to content

Commit cf7c884

Browse files
Tweak meta description handling to better trim whitespace.
1 parent 53cf489 commit cf7c884

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

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

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@
2727
<title>{{ $title }}</title>
2828

2929
{{/* Meta description */}}
30-
{{- $d := .Params.description | default "" | plainify | htmlEscape | strings.TrimSpace -}}
30+
{{- $d := .Params.description
31+
| default ""
32+
| plainify
33+
| replaceRE `(?s)^\s+|\s+$` ""
34+
| htmlEscape
35+
-}}
3136
{{- if gt (len $d) 0 -}}
3237
<meta name="description" content="{{ $d }}">
3338
{{- end -}}

0 commit comments

Comments
 (0)