From d29c9d1a2ff82234ad1810abc6a57199340e7fd5 Mon Sep 17 00:00:00 2001 From: Koni Marti Date: Wed, 26 Jul 2023 11:18:24 +0200 Subject: templates: attach directly from templates Attach a file from templates. Add a split template function. {{- .Attach "LICENSE" -}} or {{range (exec "find ./doc -type f -name *.scd" "" | split "\n") -}} {{with . }} {{- $.Attach . -}} {{- end}} {{- end}} Fixes: https://todo.sr.ht/~rjarry/aerc/109 Signed-off-by: Koni Marti Acked-by: Robin Jarry --- models/templates.go | 1 + 1 file changed, 1 insertion(+) (limited to 'models') diff --git a/models/templates.go b/models/templates.go index 686687cc..0c684e86 100644 --- a/models/templates.go +++ b/models/templates.go @@ -29,6 +29,7 @@ type TemplateData interface { Flags() []string IsReplied() bool HasAttachment() bool + Attach(string) string IsFlagged() bool IsRecent() bool IsUnread() bool -- cgit