From db3cad909e93b5799fbcd131f7c4cc8dabf16cd6 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Thu, 24 Jul 2025 20:23:42 -0600 Subject: [PATCH] Add a systemFilePath handlebars helper for better file path referencing --- module/handlebarsHelpers/_index.mjs | 5 +++++ module/hooks/init.mjs | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 module/handlebarsHelpers/_index.mjs diff --git a/module/handlebarsHelpers/_index.mjs b/module/handlebarsHelpers/_index.mjs new file mode 100644 index 0000000..d0923e8 --- /dev/null +++ b/module/handlebarsHelpers/_index.mjs @@ -0,0 +1,5 @@ +import { filePath } from "../consts.mjs"; + +export default { + systemFilePath: filePath, +}; diff --git a/module/hooks/init.mjs b/module/hooks/init.mjs index 6f1c54e..e57a6c6 100644 --- a/module/hooks/init.mjs +++ b/module/hooks/init.mjs @@ -13,6 +13,7 @@ import { registerWorldSettings } from "../settings/world.mjs"; // Utils import { __ID__ } from "../consts.mjs"; +import helpers from "../handlebarsHelpers/_index.mjs"; import { Logger } from "../utils/Logger.mjs"; import { registerCustomComponents } from "../apps/elements/_index.mjs"; @@ -33,6 +34,8 @@ Hooks.on(`init`, () => { }, ); - registerCustomComponents(); registerWorldSettings(); + + registerCustomComponents(); + Handlebars.registerHelper(helpers); });