diff options
author | Robin Jarry <robin@jarry.cc> | 2022-02-19 14:06:57 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-02-19 15:24:55 +0100 |
commit | bb0f1801402e98266d2554a5f002dc8ce0419808 (patch) | |
tree | f1100f9abb31293895b58ce7522ebe73e5262073 /lib/templates | |
parent | 05ad96a30cb8ea17970c84ea7c72f8f3def5afa5 (diff) | |
download | aerc-bb0f1801402e98266d2554a5f002dc8ce0419808.tar.gz |
config: do not hardcode sharedir
Instead of using a static SHAREDIR at compile time, use a list of
standard paths to use at runtime for templates, config files and
stylesets.
This implies removing all default filters in the default configuration.
Replace them with basic commands. New users can configure the filters as
they wish.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib/templates')
-rw-r--r-- | lib/templates/template.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/templates/template.go b/lib/templates/template.go index 6d66d8eb..9c71c463 100644 --- a/lib/templates/template.go +++ b/lib/templates/template.go @@ -227,3 +227,11 @@ func ParseTemplateFromFile(templateName string, templateDirs []string, data inte } return &body, nil } + +func CheckTemplate(templateName string, templateDirs []string) error { + if templateName != "" { + _, err := ParseTemplateFromFile(templateName, templateDirs, DummyData()) + return err + } + return nil +} |