From 6d34db5f21dbf5f281a48b2c8bf6a4e5f4e88c30 Mon Sep 17 00:00:00 2001 From: tdro Date: Tue, 6 Feb 2024 15:43:46 -0500 Subject: assets/templates/markdown-feed: Tighten this up --- assets/templates/markdown-feed.yaml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'assets') diff --git a/assets/templates/markdown-feed.yaml b/assets/templates/markdown-feed.yaml index fbe763b..ff0aae5 100644 --- a/assets/templates/markdown-feed.yaml +++ b/assets/templates/markdown-feed.yaml @@ -21,12 +21,19 @@ feed: {{ end -}} --- -{{ $content := .content | replaceRE "{" "{" | replaceRE "}" "}" -}} +{{ $content := .content }} + +{{- $content = replace $content "{" "{" -}} +{{- $content = replace $content "}" "}" -}} +{{- $content = replace $content "[" "[" -}} +{{- $content = replace $content "]" "]" -}} + {{ $content }} -{{- $enclosureDescription := "Image/Picture" -}} +{{- $caption := "Image/Picture" -}} + {{- with $content -}} - {{ $enclosureDescription = $content | truncate 80 "" }} + {{ $caption = $content | truncate 80 "" }} {{- end }} {{ with .enclosure -}} @@ -43,8 +50,8 @@ feed: (in . ".svg") (in . ".webp") -}} -![{{ $enclosureDescription }}]({{ . }} " - {{ $enclosureDescription }}" +![{{ $caption }}]({{ . }} " + {{ $caption }}" ) {{- end -}} {{- end }} -- cgit v1.2.3