diff options
author | Koni Marti <koni.marti@gmail.com> | 2023-07-26 11:18:24 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-08-03 22:31:34 +0200 |
commit | d29c9d1a2ff82234ad1810abc6a57199340e7fd5 (patch) | |
tree | 5d87ff8313f12c288bc41466453b0ed139a20c8b /config/templates.go | |
parent | 0e09c05937913a938bc4987db2b6d193ed0501bd (diff) | |
download | aerc-d29c9d1a2ff82234ad1810abc6a57199340e7fd5.tar.gz |
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 <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'config/templates.go')
-rw-r--r-- | config/templates.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/config/templates.go b/config/templates.go index ef304ae2..3f0249df 100644 --- a/config/templates.go +++ b/config/templates.go @@ -80,6 +80,7 @@ func (d *dummyData) ThreadCount() int { return 0 } func (d *dummyData) ThreadFolded() bool { return false } func (d *dummyData) Subject() string { return "Re: [PATCH] hey" } func (d *dummyData) SubjectBase() string { return "[PATCH] hey" } +func (d *dummyData) Attach(string) string { return "" } func (d *dummyData) Number() int { return 0 } func (d *dummyData) Labels() []string { return nil } func (d *dummyData) Flags() []string { return nil } |