allow to use multiple directories in html and txt templates

remove from the config:
templates_dir, templates_dir_default, txt_templates_dir, txt_templates_dir_default

add to the config:
html_templates_dirs - a list of directories with html templates
txt_templates_dirs - a list of directories with txt templates

We search from the last directory to the first one.
This commit is contained in:
2026-06-21 01:59:32 +02:00
parent 9e1a3e336b
commit d35854691c
6 changed files with 33 additions and 26 deletions
+7 -6
View File
@@ -4,8 +4,8 @@
* Author: Tomasz Sowa <t.sowa@ttmath.org>
*/
/*
* Copyright (c) 2008-2022, Tomasz Sowa
/*
* Copyright (c) 2008-2026, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -180,10 +180,9 @@ void Config::AssignValues()
image_quality = Int(L"image_quality", 92);
convert_cmd = Text(L"convert_cmd", L"/usr/local/bin/convert");
templates_dir = Text(L"templates_dir");
templates_dir_default = Text(L"templates_dir_default");
txt_templates_dir = Text(L"txt_templates_dir");
txt_templates_dir_default = Text(L"txt_templates_dir_default");
ListText(L"html_templates_dirs", html_templates_dirs);
ListText(L"txt_templates_dirs", txt_templates_dirs);
templates_fun_prefix = Text(L"templates_fun_prefix", L"fun_");
templates_fun_postfix = Text(L"templates_fun_postfix", L".html");
templates_index = Text(L"templates_index", L"index.html");
@@ -523,6 +522,8 @@ bool Config::ListText(const std::wstring & name, std::vector<std::wstring> & lis
return space.to_list(name, list);
}
bool Config::HasValue(const wchar_t * name, const wchar_t * value)
{
return space.has_value(name, value);