From 06ab1527525597c19c72225af2bc35fe86ccdcd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Tue, 10 Oct 2023 23:40:34 +0200 Subject: [PATCH] theme: generalize indention #683 --- layouts/partials/indent.html | 3 +++ layouts/partials/meta.html | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 layouts/partials/indent.html diff --git a/layouts/partials/indent.html b/layouts/partials/indent.html new file mode 100644 index 0000000000..e2e7ec0263 --- /dev/null +++ b/layouts/partials/indent.html @@ -0,0 +1,3 @@ +{{- $content := .content }} +{{- $indention := .indention }} +{{- replaceRE "(\\r\\n|\\r|\\n)" (printf "$1%s" $indention) (replaceRE "^" $indention (trim $content " \n\r")) | safeHTML }} \ No newline at end of file diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html index 5ae0d88664..de45332fda 100644 --- a/layouts/partials/meta.html +++ b/layouts/partials/meta.html @@ -17,4 +17,4 @@ {{- with .Site.Params.author }} {{- end }} -{{ replace (trim (partial "social.html" .) " \n\r") "