From 4bed2db37174863283fe92d4274bdde669e0d092 Mon Sep 17 00:00:00 2001 From: Jan-Lukas Else Date: Sat, 21 Mar 2020 00:25:37 +0100 Subject: [PATCH] Use partial to clean content --- layouts/_default/single.activity.ajson | 2 +- layouts/partial/cleanedContent.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 layouts/partial/cleanedContent.json diff --git a/layouts/_default/single.activity.ajson b/layouts/_default/single.activity.ajson index e90a8fe..4e0a1e3 100644 --- a/layouts/_default/single.activity.ajson +++ b/layouts/_default/single.activity.ajson @@ -12,7 +12,7 @@ {{- else -}} "type": "Note", {{ end -}} - "content": {{ ((htmlUnescape .Content | safeHTML) | replaceRE "href=\"/([^\"]*)\"" ( printf "href=\"%s$1\"" ( "" | absURL ) ) ) | jsonify }}, + "content": {{ partial "cleanedContent.json" . }}, {{- if .Params.images }} "attachment": [ {{ $delimiter := "" -}} diff --git a/layouts/partial/cleanedContent.json b/layouts/partial/cleanedContent.json new file mode 100644 index 0000000..8653b9a --- /dev/null +++ b/layouts/partial/cleanedContent.json @@ -0,0 +1 @@ +{{ (( htmlUnescape .Content | safeHTML ) | replaceRE "href=\"/([^\"]*)\"" ( printf "href=\"%s$1\"" ( "" | absURL ) ) ) | jsonify }} \ No newline at end of file