Skip to main content
Module

x/lume/tests/__snapshots__/nunjucks.test.ts.snap

πŸ”₯ Static site generator for Deno πŸ¦•
Very Popular
Go to Latest
File
export const snapshot = {};
snapshot[`build a site with nunjucks 1`] = `7`;
snapshot[`build a site with nunjucks 2`] = `{ formats: [ { engines: 1, ext: ".tmpl.ts", pageLoader: [AsyncFunction: module], }, { engines: 1, ext: ".tmpl.js", pageLoader: [AsyncFunction: module], }, { engines: undefined, ext: ".tmpl.json", pageLoader: [AsyncFunction: json], }, { dataLoader: [AsyncFunction: json], engines: undefined, ext: ".json", }, { engines: 1, ext: ".md", pageLoader: [AsyncFunction: text], }, { componentLoader: [AsyncFunction: module], dataLoader: [AsyncFunction: module], engines: 1, ext: ".js", }, { componentLoader: [AsyncFunction: module], dataLoader: [AsyncFunction: module], engines: 1, ext: ".ts", }, { componentLoader: [AsyncFunction: text], engines: 1, ext: ".njk", includesPath: "_includes", pageLoader: [AsyncFunction: text], }, { dataLoader: [AsyncFunction: yaml], engines: undefined, ext: ".yaml", pageLoader: [AsyncFunction: yaml], }, { dataLoader: [AsyncFunction: yaml], engines: undefined, ext: ".yml", pageLoader: [AsyncFunction: yaml], }, ],}`;
snapshot[`build a site with nunjucks 3`] = `[]`;
snapshot[`build a site with nunjucks 4`] = `{ content: "button { background-color: blue;}
icon { width: 48px; height: 48px;}", data: { content: "button { background-color: blue;}
icon { width: 48px; height: 48px;}", page: undefined, tags: [ ], url: "/components.css", }, dest: { ext: ".css", path: "/components", }, src: { path: "", remote: undefined, },}`;
snapshot[`build a site with nunjucks 5`] = `{ content: 'document.querySelectorAll("button").forEach(button => { button.addEventListener("click", () => { alert("Hello world!"); });});
console.log("Hello world, from the icon/User component");', data: { content: 'document.querySelectorAll("button").forEach(button => { button.addEventListener("click", () => { alert("Hello world!"); });});
console.log("Hello world, from the icon/User component");', page: undefined, tags: [ ], url: "/components.js", }, dest: { ext: ".js", path: "/components", }, src: { path: "", remote: undefined, },}`;
snapshot[`build a site with nunjucks 6`] = `{ content: '<!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <title></title> </head> <body> <main><button class="" type="button"> button without arguments</button><button class="" type="button">button content</button><icon name="John"> this is John</icon>
<button class="my-button" type="button"> button content <icon name="John"> this is John </icon></button></main> </body></html>', data: { comp: {}, content: '{% comp "Button" %} button without arguments{% endcomp %}
{{ comp.Button({ content: "button content" }) | safe }}{{ comp.icon.User({ content: "this is John", name:"John" }) | safe }}
{% comp "Button", className="my-button" %} button content {% comp "icon.user", name="John" %} this is John {% endcomp %}{% endcomp %}', date: 1970-01-01T00:00:00.000Z, layout: "basic.njk", page: undefined, paginate: [Function: paginate], search: Search {}, tags: [ ], url: "/components/", }, dest: { ext: ".html", path: "/components/index", }, src: { ext: ".njk", path: "/components", remote: undefined, },}`;
snapshot[`build a site with nunjucks 7`] = `{ content: '["red","green","blue"]', data: { colors: [ "red", "green", "blue", ], comp: {}, content: "{{ colors | dump | safe }}", date: 1970-01-01T00:00:00.000Z, layout: null, page: undefined, paginate: [Function: paginate], search: Search {}, tags: [ ], url: "/data.json", }, dest: { ext: ".json", path: "/data", }, src: { ext: ".njk", path: "/data.json", remote: undefined, },}`;
snapshot[`build a site with nunjucks 8`] = `{ content: '<!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <title>Hello World</title> </head> <body> <main><h1>Hello World</h1></main> </body></html>', data: { comp: {}, content: "<h1>{{ title }}</h1>", date: 1970-01-01T00:00:00.000Z, layout: "./_includes/basic.njk", page: undefined, paginate: [Function: paginate], search: Search {}, tags: [ ], title: "Hello World", url: "/", }, dest: { ext: ".html", path: "/index", }, src: { ext: ".njk", path: "/index", remote: undefined, },}`;
snapshot[`build a site with nunjucks 9`] = `{ content: '<!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <title>njk filter example</title> </head> <body> <main><h1>NJK FILTER EXAMPLE</h1></main> </body></html>', data: { comp: {}, content: undefined, date: 1970-01-01T00:00:00.000Z, layout: "basic.njk", page: undefined, paginate: [Function: paginate], search: Search {}, tags: [ ], title: "njk filter example", url: "/njk-filter/", }, dest: { ext: ".html", path: "/njk-filter/index", }, src: { ext: ".tmpl.js", path: "/njk-filter", remote: undefined, },}`;
snapshot[`build a site with nunjucks 10`] = `{ content: '<!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <title>The title</title> </head> <body> <main><p><strong>THE TITLE</strong></p><p><strong>THE TITLE</strong></p><p><strong>THE TITLE</strong></p><p><strong>THE TITLE</strong></p><p><strong>THE TITLE</strong></p><p><strong>THE TITLE</strong></p><p><strong>THE TITLE</strong></p><p><strong>THE TITLE</strong></p><div>hello (async)</div><ul> <li>This is a partial</li> <li>async helper in a partial (async)</li></ul><ul> <li>This is a partial</li> <li>async helper in a partial (async)</li></ul></main> </body></html>', data: { comp: {}, content: '<p>{% upperCase title %}</p><p>{% upperCase "The title" %}</p><p>{% upperCaseAsync title %}</p><p>{% upperCaseAsync "The title" %}</p><p>{% upperCaseBody %}The title{% endupperCaseBody %}</p><p>{% upperCaseBody %}{{ title }}{% endupperCaseBody %}</p><p>{% upperCaseBodyAsync %}The title{% endupperCaseBodyAsync %}</p><p>{% upperCaseBodyAsync %}{{ title }}{% endupperCaseBodyAsync %}</p><div>{{ "hello" | returnAsync }}</div>{% include "partial.njk" %}{% include "./_includes/partial.njk" %}', date: 1970-01-01T00:00:00.000Z, layout: "basic.njk", page: undefined, paginate: [Function: paginate], search: Search {}, tags: [ ], title: "The title", url: "/with-helpers/", }, dest: { ext: ".html", path: "/with-helpers/index", }, src: { ext: ".njk", path: "/with-helpers", remote: undefined, },}`;