@@ -110,7 +110,9 @@ export async function getBuilder() {
110110 const html = await renderHTML (
111111 absolutizePath ( template , rootDir ) ,
112112 ( options ?. getTemplateRenderer ?? getDefaultTemplateRenderer ) (
113- // TODO: Fix type error
113+ // This should be fine as long as 'T' is set when using a custom
114+ // renderer and left to the default 'LiquidOptions' when using the
115+ // default renderer.
114116 // @ts -expect-error
115117 options ?. templateOptions
116118 ) ,
@@ -142,6 +144,16 @@ export async function getBuilder() {
142144 } ;
143145}
144146
147+ /**
148+ * @param {import("liquidjs/dist/liquid-options").LiquidOptions } [options]
149+ * @returns {import("./index").RenderTemplate }
150+ */
151+ function getDefaultTemplateRenderer ( options ) {
152+ const liquid = new Liquid ( options ) ;
153+
154+ return ( template , data ) => liquid . parseAndRender ( template , data ) ;
155+ }
156+
145157/** @type {import("./index").getData } */
146158export async function getData ( path ) {
147159 if ( typeof path !== "string" ) {
@@ -210,13 +222,6 @@ export async function renderHTML(path, render, data) {
210222 return render ( await fs . readFile ( path , "utf-8" ) , data ) ;
211223}
212224
213- /** @type {import("./index").getDefaultTemplateRenderer } */
214- export function getDefaultTemplateRenderer ( options ) {
215- const liquid = new Liquid ( options ) ;
216-
217- return ( template , data ) => liquid . parseAndRender ( template , data ) ;
218- }
219-
220225/** @type {import("./index").encodeHTML } */
221226export function encodeHTML ( html ) {
222227 if ( typeof html !== "string" ) {
0 commit comments