theme: generalize indention #683

This commit is contained in:
Sören Weber 2023-10-10 23:40:34 +02:00
parent c19cef1976
commit 06ab152752
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
2 changed files with 4 additions and 1 deletions

View file

@ -0,0 +1,3 @@
{{- $content := .content }}
{{- $indention := .indention }}
{{- replaceRE "(\\r\\n|\\r|\\n)" (printf "$1%s" $indention) (replaceRE "^" $indention (trim $content " \n\r")) | safeHTML }}

View file

@ -17,4 +17,4 @@
{{- with .Site.Params.author }}
<meta name="author" content="{{ . }}">
{{- end }}
{{ replace (trim (partial "social.html" .) " \n\r") "<meta " " <meta "| safeHTML }}
{{ partial "indent.html" (dict "content" (partial "social.html" .) "indention" " ") }}