Skip to content

Commit

Permalink
updated deps, added more options for Vento
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed Sep 25, 2023
1 parent 17a4fbe commit 0e449e3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion deps/nunjucks.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// @deno-types="npm:@types/[email protected].3"
// @deno-types="npm:@types/[email protected].4"
export { default } from "npm:[email protected]";
2 changes: 1 addition & 1 deletion deps/pug.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// @deno-types="npm:@types/[email protected].6"
// @deno-types="npm:@types/[email protected].7"
export * from "npm:[email protected]";
8 changes: 4 additions & 4 deletions deps/vento.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export { default as engine } from "https://deno.land/x/vento@v0.8.1/mod.ts";
export { FileLoader } from "https://deno.land/x/vento@v0.8.1/src/loader.ts";
export { default as engine } from "https://deno.land/x/vento@v0.9.0/mod.ts";
export { FileLoader } from "https://deno.land/x/vento@v0.9.0/src/loader.ts";

export type { Environment } from "https://deno.land/x/vento@v0.8.1/src/environment.ts";
export type { Token } from "https://deno.land/x/vento@v0.8.1/src/tokenizer.ts";
export type { Environment } from "https://deno.land/x/vento@v0.9.0/src/environment.ts";
export type { Token } from "https://deno.land/x/vento@v0.9.0/src/tokenizer.ts";
12 changes: 10 additions & 2 deletions plugins/vento.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ export interface Options {

/**
* The options for the Vento engine
* @see https://vento.js.org/get-started/configuration/
* @see https://vento.js.org/configuration/
*/
options: {
/** The name of the variable to access to the data in the templates */
dataVarname?: string;

/** Make data available on the global object instead of varName */
useWith?: boolean;

/** Whether or not to automatically XML-escape interpolations. */
autoescape?: boolean;
};
}

Expand All @@ -31,6 +37,8 @@ export const defaults: Options = {
includes: "",
options: {
dataVarname: "it",
useWith: true,
autoescape: false,
},
};

Expand Down Expand Up @@ -99,7 +107,7 @@ export default function (userOptions?: Partial<Options>) {

const vento = engine({
includes: new LumeLoader(normalizePath(options.includes), site.fs),
dataVarname: options.options.dataVarname,
...options.options,
});

vento.tags.push(compTag);
Expand Down

0 comments on commit 0e449e3

Please sign in to comment.