From bb0f1801402e98266d2554a5f002dc8ce0419808 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Sat, 19 Feb 2022 14:06:57 +0100 Subject: 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 --- lib/templates/template.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/templates/template.go') 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 +} -- cgit