From 32c61fff429b3e1e672e5076cb2bebfffa064d32 Mon Sep 17 00:00:00 2001 From: ztimson Date: Sat, 6 Dec 2025 21:34:21 -0500 Subject: [PATCH] Fixed templates --- package.json | 2 +- src/template.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 05080e7..cc24de1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ztimson/utils", - "version": "0.27.17", + "version": "0.27.18", "description": "Utility library", "author": "Zak Timson", "license": "MIT", diff --git a/src/template.ts b/src/template.ts index 8759fc1..8d3c8ae 100644 --- a/src/template.ts +++ b/src/template.ts @@ -71,7 +71,7 @@ export async function renderTemplate(template: string, data: any, fetch?: (file: // Extends: `{{ > file.html:property }} CONTENT {{ /> }}` while(!!(found = /\{\{\s*?>\s*?(.+?):(.+?)\s*?}}([\s\S]*?)\{\{\s*?\/>\s*?}}/g.exec(content))) { - content = content.replace(found[0], await renderTemplate(await fetch(found[1].trim), { + content = content.replace(found[0], await renderTemplate(await fetch(found[1].trim()), { ...data, [found[2].trim()]: found[3], }, fetch));