Skip to content

Commit

Permalink
replace nunjucks with vento
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed Nov 3, 2023
1 parent 1349fad commit f0aa33d
Show file tree
Hide file tree
Showing 113 changed files with 801 additions and 414 deletions.
6 changes: 3 additions & 3 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import url, { Options as UrlOptions } from "./plugins/url.ts";
import json, { Options as JsonOptions } from "./plugins/json.ts";
import markdown, { Options as MarkdownOptions } from "./plugins/markdown.ts";
import modules, { Options as ModulesOptions } from "./plugins/modules.ts";
import nunjucks, { Options as NunjucksOptions } from "./plugins/nunjucks.ts";
import vento, { Options as VentoOptions } from "./plugins/vento.ts";
import search, { Options as SearchOptions } from "./plugins/search.ts";
import paginate, { Options as PaginateOptions } from "./plugins/paginate.ts";
import toml, { Options as TomlOptions } from "./plugins/toml.ts";
Expand All @@ -19,7 +19,7 @@ export interface PluginOptions {
json?: Partial<JsonOptions>;
markdown?: Partial<MarkdownOptions>;
modules?: Partial<ModulesOptions>;
nunjucks?: Partial<NunjucksOptions>;
vento?: Partial<VentoOptions>;
search?: Partial<SearchOptions>;
paginate?: Partial<PaginateOptions>;
toml?: Partial<TomlOptions>;
Expand Down Expand Up @@ -53,7 +53,7 @@ export default function lume(
.use(json(pluginOptions.json))
.use(markdown(pluginOptions.markdown))
.use(modules(pluginOptions.modules))
.use(nunjucks(pluginOptions.nunjucks))
.use(vento(pluginOptions.vento))
.use(paginate(pluginOptions.paginate))
.use(search(pluginOptions.search))
.use(toml(pluginOptions.toml))
Expand Down
12 changes: 9 additions & 3 deletions tests/__snapshots__/base_path.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ snapshot[`base_path plugin 1`] = `
},
{
engines: 1,
ext: ".njk",
ext: ".vento",
loader: [AsyncFunction: text],
pageType: "page",
},
{
engines: 1,
ext: ".vto",
loader: [AsyncFunction: text],
pageType: "page",
},
Expand Down Expand Up @@ -93,7 +99,7 @@ snapshot[`base_path plugin 1`] = `
],
src: [
"/",
"/index.njk",
"/index.vto",
],
}
`;
Expand Down Expand Up @@ -193,7 +199,7 @@ snapshot[`base_path plugin 3`] = `
},
src: {
asset: false,
ext: ".njk",
ext: ".vto",
path: "/index",
remote: undefined,
slug: "index",
Expand Down
10 changes: 8 additions & 2 deletions tests/__snapshots__/build.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ snapshot[`build a simple site 1`] = `
},
{
engines: 1,
ext: ".njk",
ext: ".vento",
loader: [AsyncFunction: text],
pageType: "page",
},
{
engines: 1,
ext: ".vto",
loader: [AsyncFunction: text],
pageType: "page",
},
Expand Down Expand Up @@ -122,7 +128,7 @@ Content of Page 1",
paginate: "paginate",
search: [],
tags: "Array(0)",
templateEngine: "njk",
templateEngine: "vto",
title: "Page 1",
url: "/dynamic.html",
},
Expand Down
12 changes: 9 additions & 3 deletions tests/__snapshots__/code_highlight.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ snapshot[`code_hightlight plugin 1`] = `
},
{
engines: 1,
ext: ".njk",
ext: ".vento",
loader: [AsyncFunction: text],
pageType: "page",
},
{
engines: 1,
ext: ".vto",
loader: [AsyncFunction: text],
pageType: "page",
},
Expand Down Expand Up @@ -94,7 +100,7 @@ snapshot[`code_hightlight plugin 1`] = `
src: [
"/",
"/index.md",
"/other.njk",
"/other.vto",
],
}
`;
Expand Down Expand Up @@ -204,7 +210,7 @@ p {
},
src: {
asset: false,
ext: ".njk",
ext: ".vto",
path: "/other",
remote: undefined,
slug: "other",
Expand Down
8 changes: 7 additions & 1 deletion tests/__snapshots__/decap_cms.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ snapshot[`Decap CMS plugin 1`] = `
},
{
engines: 1,
ext: ".njk",
ext: ".vento",
loader: [AsyncFunction: text],
pageType: "page",
},
{
engines: 1,
ext: ".vto",
loader: [AsyncFunction: text],
pageType: "page",
},
Expand Down
24 changes: 18 additions & 6 deletions tests/__snapshots__/esbuild.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ snapshot[`esbuild plugin 1`] = `
},
{
engines: 1,
ext: ".njk",
ext: ".vento",
loader: [AsyncFunction: text],
pageType: "page",
},
{
engines: 1,
ext: ".vto",
loader: [AsyncFunction: text],
pageType: "page",
},
Expand Down Expand Up @@ -100,8 +106,8 @@ snapshot[`esbuild plugin 1`] = `
"/_includes",
"/_includes/layout.js",
"/data.json",
"/main.njk",
"/main.ts",
"/main.vto",
"/modules",
"/modules/to_uppercase.ts",
"/other.ts",
Expand Down Expand Up @@ -188,7 +194,7 @@ document.querySelectorAll("h1")?.forEach((h1) => {
},
src: {
asset: false,
ext: ".njk",
ext: ".vto",
path: "/main",
remote: undefined,
slug: "main",
Expand Down Expand Up @@ -298,7 +304,13 @@ snapshot[`esbuild plugin with splitting as true 1`] = `
},
{
engines: 1,
ext: ".njk",
ext: ".vento",
loader: [AsyncFunction: text],
pageType: "page",
},
{
engines: 1,
ext: ".vto",
loader: [AsyncFunction: text],
pageType: "page",
},
Expand Down Expand Up @@ -329,8 +341,8 @@ snapshot[`esbuild plugin with splitting as true 1`] = `
"/_includes",
"/_includes/layout.js",
"/data.json",
"/main.njk",
"/main.ts",
"/main.vto",
"/modules",
"/modules/to_uppercase.ts",
"/other.ts",
Expand Down Expand Up @@ -436,7 +448,7 @@ document.querySelectorAll("h1")?.forEach((h1) => {
},
src: {
asset: false,
ext: ".njk",
ext: ".vto",
path: "/main",
remote: undefined,
slug: "main",
Expand Down
8 changes: 7 additions & 1 deletion tests/__snapshots__/eta.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ snapshot[`build a site with eta 1`] = `
},
{
engines: 1,
ext: ".njk",
ext: ".vento",
loader: [AsyncFunction: text],
pageType: "page",
},
{
engines: 1,
ext: ".vto",
loader: [AsyncFunction: text],
pageType: "page",
},
Expand Down
12 changes: 9 additions & 3 deletions tests/__snapshots__/favicon.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ snapshot[`favicon plugin 1`] = `
},
{
engines: 1,
ext: ".njk",
ext: ".vento",
loader: [AsyncFunction: text],
pageType: "page",
},
{
engines: 1,
ext: ".vto",
loader: [AsyncFunction: text],
pageType: "page",
},
Expand Down Expand Up @@ -100,7 +106,7 @@ snapshot[`favicon plugin 1`] = `
src: [
"/",
"/favicon.svg",
"/index.njk",
"/index.vto",
],
}
`;
Expand Down Expand Up @@ -223,7 +229,7 @@ snapshot[`favicon plugin 3`] = `
},
src: {
asset: false,
ext: ".njk",
ext: ".vto",
path: "/index",
remote: undefined,
slug: "index",
Expand Down
8 changes: 7 additions & 1 deletion tests/__snapshots__/feed.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ snapshot[`RSS plugin 1`] = `
},
{
engines: 1,
ext: ".njk",
ext: ".vento",
loader: [AsyncFunction: text],
pageType: "page",
},
{
engines: 1,
ext: ".vto",
loader: [AsyncFunction: text],
pageType: "page",
},
Expand Down
16 changes: 14 additions & 2 deletions tests/__snapshots__/filter_pages.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ snapshot[`Filter pages (allow all) 1`] = `
},
{
engines: 1,
ext: ".njk",
ext: ".vento",
loader: [AsyncFunction: text],
pageType: "page",
},
{
engines: 1,
ext: ".vto",
loader: [AsyncFunction: text],
pageType: "page",
},
Expand Down Expand Up @@ -432,7 +438,13 @@ snapshot[`Filter pages (allow only /multiple/*) 1`] = `
},
{
engines: 1,
ext: ".njk",
ext: ".vento",
loader: [AsyncFunction: text],
pageType: "page",
},
{
engines: 1,
ext: ".vto",
loader: [AsyncFunction: text],
pageType: "page",
},
Expand Down
8 changes: 7 additions & 1 deletion tests/__snapshots__/imagick.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ snapshot[`imagick plugin 1`] = `
},
{
engines: 1,
ext: ".njk",
ext: ".vento",
loader: [AsyncFunction: text],
pageType: "page",
},
{
engines: 1,
ext: ".vto",
loader: [AsyncFunction: text],
pageType: "page",
},
Expand Down
16 changes: 11 additions & 5 deletions tests/__snapshots__/inline.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ snapshot[`inline plugin 1`] = `
},
{
engines: 1,
ext: ".njk",
ext: ".vento",
loader: [AsyncFunction: text],
pageType: "page",
},
{
engines: 1,
ext: ".vto",
loader: [AsyncFunction: text],
pageType: "page",
},
Expand Down Expand Up @@ -108,10 +114,10 @@ snapshot[`inline plugin 1`] = `
src: [
"/",
"/favicon.svg",
"/index.njk",
"/index.vto",
"/other favicon.png",
"/script.js",
"/styles.njk",
"/styles.vto",
],
}
`;
Expand Down Expand Up @@ -292,7 +298,7 @@ const a = 1, _b = 1 < a, _c = a > 4;
},
src: {
asset: false,
ext: ".njk",
ext: ".vto",
path: "/index",
remote: undefined,
slug: "index",
Expand Down Expand Up @@ -377,7 +383,7 @@ const a = 1, _b = 1 < a, _c = a > 4;
},
src: {
asset: false,
ext: ".njk",
ext: ".vto",
path: "/styles",
remote: undefined,
slug: "styles",
Expand Down
12 changes: 9 additions & 3 deletions tests/__snapshots__/json.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ snapshot[`JSON plugin 1`] = `
},
{
engines: 1,
ext: ".njk",
ext: ".vento",
loader: [AsyncFunction: text],
pageType: "page",
},
{
engines: 1,
ext: ".vto",
loader: [AsyncFunction: text],
pageType: "page",
},
Expand Down Expand Up @@ -95,7 +101,7 @@ snapshot[`JSON plugin 1`] = `
"/",
"/_data.jsonc",
"/_includes",
"/_includes/layout.njk",
"/_includes/layout.vto",
"/index.page.json",
"/page1.md",
],
Expand Down Expand Up @@ -124,7 +130,7 @@ snapshot[`JSON plugin 3`] = `
children: "Content of the index",
content: "Content of the index",
date: [],
layout: "layout.njk",
layout: "layout.vto",
mergedKeys: [
"tags",
],
Expand Down
Loading

0 comments on commit f0aa33d

Please sign in to comment.