wip: better config

This commit is contained in:
swrup 2025-10-13 00:29:33 +02:00
parent be2e590e93
commit aaae59ced0
6 changed files with 40 additions and 34 deletions

View file

@ -13,16 +13,16 @@ type t =
| Privacy
let etag = function
| Terms -> Config.terms_etag
| Privacy -> Config.privacy_etag
| Terms -> Config_mte.terms_etag
| Privacy -> Config_mte.privacy_etag
let legal_version = function
| Terms -> Config.terms_legal_version
| Privacy -> Config.privacy_legal_version
| Terms -> Config_mte.terms_legal_version
| Privacy -> Config_mte.privacy_legal_version
let base_dir = function
| Terms -> Config.terms_dir
| Privacy -> Config.privacy_dir
| Terms -> Config_mte.terms_dir
| Privacy -> Config_mte.privacy_dir
(* TODO
better use of Fmt to have error prefix or smthing
@ -55,8 +55,9 @@ let supported_lang_arr, supported_ext_arr =
let () =
if List.is_empty lang_l then Fmt.failwith "no language supported";
if List.is_empty ext_l then Fmt.failwith "no mimetype supported";
if not @@ List.mem Config.default_lang lang_l then
Fmt.failwith "default language `%s` files not found" Config.default_lang;
if not @@ List.mem Config_mte.default_lang lang_l then
Fmt.failwith "default language `%s` files not found"
Config_mte.default_lang;
if not @@ List.mem ".txt" ext_l then
Fmt.failwith "plain text file not found";
if not @@ List.mem ".md" ext_l then Fmt.failwith "markdown file not found";