From 8ef9bd2550ea72bed4489d011288668f8c238799 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Sat, 23 Mar 2024 13:01:07 -0600 Subject: [PATCH] Make it so that I can specifically code some aliases for handlebar partials --- module/handlebars.mjs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/module/handlebars.mjs b/module/handlebars.mjs index f39fb06..d2ccd2a 100644 --- a/module/handlebars.mjs +++ b/module/handlebars.mjs @@ -30,6 +30,10 @@ export const partials = [ `actors/char-sheet/v2/partials/inventory/items/untyped.v2.pc.hbs`, ]; +export const preAliasedPartials = { + "dotdungeon.pc.v2.foil": "actors/char-sheet/v2/partials/inventory/items/untyped.v2.pc.hbs", +}; + export const icons = [ `caret-right.svg`, `caret-down.svg`, @@ -59,6 +63,10 @@ export async function preloadHandlebarsTemplates() { const paths = {}; + for (const alias in preAliasedPartials) { + paths[alias] = `${pathPrefix}${preAliasedPartials[alias]}`; + }; + for ( const partial of partials ) { console.debug(`Loading partial: ${partial}`); const path = `${pathPrefix}${partial}`;