From 56dea0b11717a6277d9349495bb55390f32aca97 Mon Sep 17 00:00:00 2001 From: Thomas Parisot Date: Fri, 17 Jan 2020 13:19:26 +0100 Subject: [PATCH] Replace Swig tests with nunjucks --- test/scripts/console/generate.js | 4 +- test/scripts/extend/renderer.js | 8 ++-- test/scripts/helpers/partial.js | 16 ++++---- test/scripts/hexo/hexo.js | 22 +++++----- test/scripts/hexo/post.js | 10 ++--- test/scripts/hexo/render.js | 16 ++++---- test/scripts/processors/asset.js | 22 +++++----- test/scripts/theme/theme.js | 30 +++++++------- test/scripts/theme/view.js | 54 ++++++++++++------------- test/scripts/theme_processors/source.js | 1 + test/scripts/theme_processors/view.js | 20 ++++----- 11 files changed, 103 insertions(+), 100 deletions(-) diff --git a/test/scripts/console/generate.js b/test/scripts/console/generate.js index 80f5d47823..1ae7f21770 100644 --- a/test/scripts/console/generate.js +++ b/test/scripts/console/generate.js @@ -183,14 +183,14 @@ describe('generate', () => { // Add some source files writeFile(join(hexo.theme_dir, 'source', 'a.txt'), 'a'), writeFile(join(hexo.theme_dir, 'source', 'b.txt'), 'b'), - writeFile(join(hexo.theme_dir, 'source', 'c.swig'), 'c') + writeFile(join(hexo.theme_dir, 'source', 'c.njk'), 'c') ]); await generate(); // Update source file await Promise.all([ writeFile(join(hexo.theme_dir, 'source', 'b.txt'), 'bb'), - writeFile(join(hexo.theme_dir, 'source', 'c.swig'), 'cc') + writeFile(join(hexo.theme_dir, 'source', 'c.njk'), 'cc') ]); // Generate again diff --git a/test/scripts/extend/renderer.js b/test/scripts/extend/renderer.js index 42072dfd0b..7b01dfddde 100644 --- a/test/scripts/extend/renderer.js +++ b/test/scripts/extend/renderer.js @@ -108,11 +108,11 @@ describe('Renderer', () => { r.isRenderableSync('yaml').should.be.false; - r.register('swig', 'html', () => {}, true); + r.register('njk', 'html', () => {}, true); - r.isRenderableSync('swig').should.be.true; - r.isRenderableSync('.swig').should.be.true; - r.isRenderableSync('layout.swig').should.be.true; + r.isRenderableSync('njk').should.be.true; + r.isRenderableSync('.njk').should.be.true; + r.isRenderableSync('layout.njk').should.be.true; r.isRenderableSync('foo.html').should.be.false; }); diff --git a/test/scripts/helpers/partial.js b/test/scripts/helpers/partial.js index 04dc7f5738..fbff4f8b19 100644 --- a/test/scripts/helpers/partial.js +++ b/test/scripts/helpers/partial.js @@ -10,7 +10,7 @@ describe('partial', () => { const hexo = new Hexo(pathFn.join(__dirname, 'partial_test'), {silent: true}); const themeDir = pathFn.join(hexo.base_dir, 'themes', 'test'); const viewDir = pathFn.join(themeDir, 'layout') + pathFn.sep; - const viewName = 'article.swig'; + const viewName = 'article.njk'; const ctx = { site: hexo.locals, @@ -33,7 +33,7 @@ describe('partial', () => { fs.writeFile(hexo.config_path, 'theme: test') ]); await hexo.init(); - hexo.theme.setView('widget/tag.swig', 'tag widget'); + hexo.theme.setView('widget/tag.njk', 'tag widget'); }); after(() => fs.rmdir(hexo.base_dir)); @@ -57,28 +57,28 @@ describe('partial', () => { }); it('locals', () => { - hexo.theme.setView('test.swig', '{{ foo }}'); + hexo.theme.setView('test.njk', '{{ foo }}'); partial('test', {foo: 'bar'}).should.eql('bar'); }); it('cache', () => { - hexo.theme.setView('test.swig', '{{ foo }}'); + hexo.theme.setView('test.njk', '{{ foo }}'); partial('test', {foo: 'bar'}, {cache: true}).should.eql('bar'); partial('test', {}, {cache: true}).should.eql('bar'); }); it('only', () => { - hexo.theme.setView('test.swig', '{{ foo }}{{ bar }}'); + hexo.theme.setView('test.njk', '{{ foo }}{{ bar }}'); partial('test', {bar: 'bar'}, {only: true}).should.eql('bar'); }); it('a partial in another partial', () => { - hexo.theme.setView('partial/a.swig', '{{ partial("b") }}'); - hexo.theme.setView('partial/b.swig', '{{ partial("c") }}'); - hexo.theme.setView('partial/c.swig', 'c'); + hexo.theme.setView('partial/a.njk', '{{ partial("b") }}'); + hexo.theme.setView('partial/b.njk', '{{ partial("c") }}'); + hexo.theme.setView('partial/c.njk', 'c'); partial('partial/a').should.eql('c'); }); diff --git a/test/scripts/hexo/hexo.js b/test/scripts/hexo/hexo.js index dd960b2d8c..cd87efd362 100644 --- a/test/scripts/hexo/hexo.js +++ b/test/scripts/hexo/hexo.js @@ -354,7 +354,7 @@ describe('Hexo', () => { }); it('_generate() - layout', () => { - hexo.theme.setView('test.swig', [ + hexo.theme.setView('test.njk', [ '{{ config.title }}', '{{ page.foo }}', '{{ layout }}', @@ -381,7 +381,7 @@ describe('Hexo', () => { }); it('_generate() - layout array', () => { - hexo.theme.setView('baz.swig', 'baz'); + hexo.theme.setView('baz.njk', 'baz'); hexo.extend.generator.register('test', () => ({ path: 'test', @@ -421,7 +421,7 @@ describe('Hexo', () => { it('_generate() - after_route_render filter', () => { const hook = sinon.spy(result => result.replace('foo', 'bar')); hexo.extend.filter.register('after_route_render', hook); - hexo.theme.setView('test.swig', 'foo'); + hexo.theme.setView('test.njk', 'foo'); hexo.extend.generator.register('test', () => ({ path: 'test', layout: 'test' @@ -445,7 +445,7 @@ describe('Hexo', () => { }); it('_generate() - validate locals', () => { - hexo.theme.setView('test.swig', [ + hexo.theme.setView('test.njk', [ '{{ path }}', '{{ url }}', '{{ view_dir }}' @@ -467,7 +467,7 @@ describe('Hexo', () => { const path = 'bár'; hexo.config.url = 'http://fôo.com'; - hexo.theme.setView('test.swig', '{{ url }}'); + hexo.theme.setView('test.njk', '{{ url }}'); hexo.extend.generator.register('test', () => ({ path, @@ -491,7 +491,7 @@ describe('Hexo', () => { it('_generate() - reset cache for new route', () => { let count = 0; - hexo.theme.setView('test.swig', '{{ page.count() }}'); + hexo.theme.setView('test.njk', '{{ page.count() }}'); hexo.extend.generator.register('test', () => ({ path: 'test', @@ -511,7 +511,7 @@ describe('Hexo', () => { it('_generate() - cache disabled and use new route', () => { let count = 0; - hexo.theme.setView('test.swig', '{{ page.count() }}'); + hexo.theme.setView('test.njk', '{{ page.count() }}'); hexo.extend.generator.register('test', () => ({ path: 'test', @@ -529,7 +529,7 @@ describe('Hexo', () => { }); it('_generate() - cache disabled & update template', () => { - hexo.theme.setView('test.swig', '0'); + hexo.theme.setView('test.njk', '0'); hexo.extend.generator.register('test', () => ({ path: 'test', @@ -538,12 +538,12 @@ describe('Hexo', () => { return hexo._generate({cache: false}) .then(() => checkStream(route.get('test'), '0')) - .then(() => hexo.theme.setView('test.swig', '1')) + .then(() => hexo.theme.setView('test.njk', '1')) .then(() => checkStream(route.get('test'), '1')); }); it('_generate() - cache enabled & update template', () => { - hexo.theme.setView('test.swig', '0'); + hexo.theme.setView('test.njk', '0'); hexo.extend.generator.register('test', () => ({ path: 'test', @@ -552,7 +552,7 @@ describe('Hexo', () => { return hexo._generate({cache: true}) .then(() => checkStream(route.get('test'), '0')) - .then(() => hexo.theme.setView('test.swig', '1')) + .then(() => hexo.theme.setView('test.njk', '1')) .then(() => checkStream(route.get('test'), '0')); // should return cached result }); diff --git a/test/scripts/hexo/post.js b/test/scripts/hexo/post.js index adfc6f96dd..6a60235a2f 100644 --- a/test/scripts/hexo/post.js +++ b/test/scripts/hexo/post.js @@ -600,7 +600,7 @@ describe('Post', () => { }); }); - it('render() - skip render phase if it\'s swig file', () => { + it('render() - skip render phase if it\'s nunjucks file', () => { const content = [ '{% quote Hello World %}', 'quote content', @@ -609,7 +609,7 @@ describe('Post', () => { return post.render(null, { content, - engine: 'swig' + engine: 'njk' }).then(data => { data.content.trim().should.eql([ '

quote content

\n', @@ -618,7 +618,7 @@ describe('Post', () => { }); }); - it('render() - escaping swig blocks with similar names', () => { + it('render() - escaping nunjucks blocks with similar names', () => { const code = 'alert("Hello world")'; const highlighted = util.highlight(code); @@ -643,7 +643,7 @@ describe('Post', () => { }); }); - it('render() - recover escaped swig blocks which is html escaped', () => { + it('render() - recover escaped nunjucks blocks which is html escaped', () => { const content = '`{% raw %}{{ test }}{% endraw %}`'; return post.render(null, { @@ -654,7 +654,7 @@ describe('Post', () => { }); }); - it('render() - recover escaped swig blocks which is html escaped before post_render', () => { + it('render() - recover escaped nunjucks blocks which is html escaped before post_render', () => { const content = '`{% raw %}{{ test }}{% endraw %}`'; const filter = sinon.spy(result => { diff --git a/test/scripts/hexo/render.js b/test/scripts/hexo/render.js index 0c29203314..d00e1c9919 100644 --- a/test/scripts/hexo/render.js +++ b/test/scripts/hexo/render.js @@ -38,7 +38,8 @@ describe('Render', () => { hexo.render.isRenderable('test.html').should.be.true; // swig - hexo.render.isRenderable('test.swig').should.be.true; + hexo.render.isRenderable('test.swig').should.be.false; + hexo.render.isRenderable('test.njk').should.be.true; // yaml hexo.render.isRenderable('test.yml').should.be.true; @@ -53,7 +54,8 @@ describe('Render', () => { hexo.render.isRenderableSync('test.html').should.be.true; // swig - hexo.render.isRenderableSync('test.swig').should.be.true; + hexo.render.isRenderableSync('test.swig').should.be.false; + hexo.render.isRenderableSync('test.njk').should.be.true; // yaml hexo.render.isRenderableSync('test.yml').should.be.true; @@ -68,7 +70,7 @@ describe('Render', () => { hexo.render.getOutput('test.html').should.eql('html'); // swig - hexo.render.getOutput('test.swig').should.eql('html'); + hexo.render.getOutput('test.njk').should.eql('html'); // yaml hexo.render.getOutput('test.yml').should.eql('json'); @@ -102,7 +104,7 @@ describe('Render', () => { '{{ title }}', '{{ content }}' ].join('\n'), - engine: 'swig' + engine: 'njk' }, { title: 'Hello world', content: 'foobar' @@ -134,7 +136,7 @@ describe('Render', () => { it('render() - after_render filter', () => { const data = { text: ' 123456 ', - engine: 'swig' + engine: 'njk' }; const filter = sinon.spy((result, obj) => { @@ -226,7 +228,7 @@ describe('Render', () => { '{{ title }}', '{{ content }}' ].join('\n'), - engine: 'swig' + engine: 'njk' }, { title: 'Hello world', content: 'foobar' @@ -263,7 +265,7 @@ describe('Render', () => { it('renderSync() - after_render filter', () => { const data = { text: ' 123456 ', - engine: 'swig' + engine: 'njk' }; const filter = sinon.spy((result, obj) => { diff --git a/test/scripts/processors/asset.js b/test/scripts/processors/asset.js index 470e208924..53a1a5120c 100644 --- a/test/scripts/processors/asset.js +++ b/test/scripts/processors/asset.js @@ -185,7 +185,7 @@ describe('asset', () => { ].join('\n'); const file = newFile({ - path: 'hello.swig', + path: 'hello.njk', type: 'create', renderable: true }); @@ -216,7 +216,7 @@ describe('asset', () => { ].join('\n'); const file = newFile({ - path: 'hello.swig', + path: 'hello.njk', type: 'update', renderable: true }); @@ -244,7 +244,7 @@ describe('asset', () => { it('page - type: delete', () => { const file = newFile({ - path: 'hello.swig', + path: 'hello.njk', type: 'delete', renderable: true }); @@ -259,7 +259,7 @@ describe('asset', () => { it('page - use the status of the source file if date not set', () => { const file = newFile({ - path: 'hello.swig', + path: 'hello.njk', type: 'create', renderable: true }); @@ -282,7 +282,7 @@ describe('asset', () => { it('page - use the date for updated if use_date_for_updated is set', () => { const file = newFile({ - path: 'hello.swig', + path: 'hello.njk', type: 'create', renderable: true }); @@ -315,7 +315,7 @@ describe('asset', () => { ].join('\n'); const file = newFile({ - path: 'hello.swig', + path: 'hello.njk', type: 'create', renderable: true }); @@ -340,7 +340,7 @@ describe('asset', () => { ].join('\n'); const file = newFile({ - path: 'hello.swig', + path: 'hello.njk', type: 'create', renderable: true }); @@ -365,7 +365,7 @@ describe('asset', () => { ].join('\n'); const file = newFile({ - path: 'hello.swig', + path: 'hello.njk', type: 'create', renderable: true }); @@ -437,7 +437,7 @@ describe('asset', () => { ].join('\n'); const file = newFile({ - path: 'hello.swig', + path: 'hello.njk', type: 'create', renderable: true }); @@ -464,7 +464,7 @@ describe('asset', () => { ].join('\n'); const file = newFile({ - path: 'hello.swig', + path: 'hello.njk', type: 'create', renderable: true }); @@ -515,7 +515,7 @@ describe('asset', () => { ].join('\n'); const file = newFile({ - path: 'hello.swig', + path: 'hello.njk', type: 'create', renderable: true }); diff --git a/test/scripts/theme/theme.js b/test/scripts/theme/theme.js index 5b6d07ba3d..5ac61bffd1 100644 --- a/test/scripts/theme/theme.js +++ b/test/scripts/theme/theme.js @@ -19,41 +19,41 @@ describe('Theme', () => { after(() => rmdir(hexo.base_dir)); it('getView()', () => { - hexo.theme.setView('test.swig', ''); + hexo.theme.setView('test.njk', ''); // With extension name - hexo.theme.getView('test.swig').should.have.property('path', 'test.swig'); + hexo.theme.getView('test.njk').should.have.property('path', 'test.njk'); // Without extension name - hexo.theme.getView('test').should.have.property('path', 'test.swig'); + hexo.theme.getView('test').should.have.property('path', 'test.njk'); // not exist - should.not.exist(hexo.theme.getView('abc.swig')); + should.not.exist(hexo.theme.getView('abc.njk')); - hexo.theme.removeView('test.swig'); + hexo.theme.removeView('test.njk'); }); it('getView() - escape backslashes', () => { - hexo.theme.setView('foo/bar.swig', ''); + hexo.theme.setView('foo/bar.njk', ''); - hexo.theme.getView('foo\\bar.swig').should.have.property('path', 'foo/bar.swig'); + hexo.theme.getView('foo\\bar.njk').should.have.property('path', 'foo/bar.njk'); - hexo.theme.removeView('foo/bar.swig'); + hexo.theme.removeView('foo/bar.njk'); }); it('setView()', () => { - hexo.theme.setView('test.swig', ''); + hexo.theme.setView('test.njk', ''); - const view = hexo.theme.getView('test.swig'); - view.path.should.eql('test.swig'); + const view = hexo.theme.getView('test.njk'); + view.path.should.eql('test.njk'); - hexo.theme.removeView('test.swig'); + hexo.theme.removeView('test.njk'); }); it('removeView()', () => { - hexo.theme.setView('test.swig', ''); - hexo.theme.removeView('test.swig'); + hexo.theme.setView('test.njk', ''); + hexo.theme.removeView('test.njk'); - should.not.exist(hexo.theme.getView('test.swig')); + should.not.exist(hexo.theme.getView('test.njk')); }); }); diff --git a/test/scripts/theme/view.js b/test/scripts/theme/view.js index 10c63a0992..ceb9061257 100644 --- a/test/scripts/theme/view.js +++ b/test/scripts/theme/view.js @@ -9,7 +9,7 @@ describe('View', () => { const Hexo = require('../../../lib/hexo'); const hexo = new Hexo(join(__dirname, 'theme_test')); const themeDir = join(hexo.base_dir, 'themes', 'test'); - const { compile } = Object.assign({}, hexo.extend.renderer.store.swig); + const { compile } = Object.assign({}, hexo.extend.renderer.store.njk); hexo.env.init = true; @@ -24,7 +24,7 @@ describe('View', () => { ]); await hexo.init(); // Setup layout - hexo.theme.setView('layout.swig', [ + hexo.theme.setView('layout.njk', [ 'pre', '{{ body }}', 'post' @@ -33,7 +33,7 @@ describe('View', () => { beforeEach(() => { // Restore compile function - hexo.extend.renderer.store.swig.compile = compile; + hexo.extend.renderer.store.njk.compile = compile; }); after(() => rmdir(hexo.base_dir)); @@ -42,10 +42,10 @@ describe('View', () => { const data = { _content: '' }; - const view = newView('index.swig', data); + const view = newView('index.njk', data); - view.path.should.eql('index.swig'); - view.source.should.eql(join(themeDir, 'layout', 'index.swig')); + view.path.should.eql('index.njk'); + view.source.should.eql(join(themeDir, 'layout', 'index.njk')); view.data.should.eql(data); }); @@ -56,7 +56,7 @@ describe('View', () => { 'content' ].join('\n'); - const view = newView('index.swig', body); + const view = newView('index.njk', body); view.data.should.eql({ layout: false, @@ -66,7 +66,7 @@ describe('View', () => { it('precompile view if possible', async () => { const body = 'Hello {{ name }}'; - const view = newView('index.swig', body); + const view = newView('index.njk', body); view._compiledSync({ name: 'Hexo' @@ -80,10 +80,10 @@ describe('View', () => { it('generate precompiled function even if renderer does not provide compile function', async () => { // Remove compile function - delete hexo.extend.renderer.store.swig.compile; + delete hexo.extend.renderer.store.njk.compile; const body = 'Hello {{ name }}'; - const view = newView('index.swig', body); + const view = newView('index.njk', body); view._compiledSync({ name: 'Hexo' @@ -100,7 +100,7 @@ describe('View', () => { '{{ test }}' ].join('\n'); - const view = newView('index.swig', body); + const view = newView('index.njk', body); const content = await view.render({ test: 'foo' @@ -117,7 +117,7 @@ describe('View', () => { '{{ test }}' ].join('\n'); - const view = newView('index.swig', body); + const view = newView('index.njk', body); const content = await view.render({ foo: 'foo', @@ -131,7 +131,7 @@ describe('View', () => { '{{ date() }}' ].join('\n'); - const view = newView('index.swig', body); + const view = newView('index.njk', body); const content = await view.render({ config: hexo.config, @@ -142,7 +142,7 @@ describe('View', () => { it('render() - layout', async () => { const body = 'content'; - const view = newView('index.swig', body); + const view = newView('index.njk', body); const content = await view.render({ layout: 'layout' @@ -152,7 +152,7 @@ describe('View', () => { it('render() - layout not found', async () => { const body = 'content'; - const view = newView('index.swig', body); + const view = newView('index.njk', body); const content = await view.render({ layout: 'wtf' @@ -165,7 +165,7 @@ describe('View', () => { '{{ test }}' ].join('\n'); - const view = newView('index.swig', body); + const view = newView('index.njk', body); view.render({ test: 'foo' @@ -183,7 +183,7 @@ describe('View', () => { '{{ test }}' ].join('\n'); - const view = newView('index.swig', body); + const view = newView('index.njk', body); view.render((err, content) => { should.not.exist(err); @@ -197,7 +197,7 @@ describe('View', () => { '{{ test }}' ].join('\n'); - const view = newView('index.swig', body); + const view = newView('index.njk', body); const filter = spy(result => { result.should.eql('foo'); @@ -219,7 +219,7 @@ describe('View', () => { '{{ test }}' ].join('\n'); - const view = newView('index.swig', body); + const view = newView('index.njk', body); view.renderSync({test: 'foo'}).should.eql('foo'); }); @@ -232,7 +232,7 @@ describe('View', () => { '{{ test }}' ].join('\n'); - const view = newView('index.swig', body); + const view = newView('index.njk', body); view.renderSync({ foo: 'foo', @@ -245,7 +245,7 @@ describe('View', () => { '{{ date() }}' ].join('\n'); - const view = newView('index.swig', body); + const view = newView('index.njk', body); view.renderSync({ config: hexo.config, @@ -255,7 +255,7 @@ describe('View', () => { it('renderSync() - layout', () => { const body = 'content'; - const view = newView('index.swig', body); + const view = newView('index.njk', body); view.renderSync({ layout: 'layout' @@ -264,7 +264,7 @@ describe('View', () => { it('renderSync() - layout not found', () => { const body = 'content'; - const view = newView('index.swig', body); + const view = newView('index.njk', body); view.renderSync({ layout: 'wtf' @@ -276,7 +276,7 @@ describe('View', () => { '{{ test }}' ].join('\n'); - const view = newView('index.swig', body); + const view = newView('index.njk', body); const filter = spy(result => { result.should.eql('foo'); @@ -289,13 +289,13 @@ describe('View', () => { }); it('_resolveLayout()', () => { - const view = newView('partials/header.swig', 'header'); + const view = newView('partials/header.njk', 'header'); // Relative path - view._resolveLayout('../layout').should.have.property('path', 'layout.swig'); + view._resolveLayout('../layout').should.have.property('path', 'layout.njk'); // Absolute path - view._resolveLayout('layout').should.have.property('path', 'layout.swig'); + view._resolveLayout('layout').should.have.property('path', 'layout.njk'); // Can't be itself should.not.exist(view._resolveLayout('header')); diff --git a/test/scripts/theme_processors/source.js b/test/scripts/theme_processors/source.js index 0608029365..4166abe1a1 100644 --- a/test/scripts/theme_processors/source.js +++ b/test/scripts/theme_processors/source.js @@ -41,6 +41,7 @@ describe('source', () => { pattern.match('source/foo.jpg~').should.be.false; pattern.match('source/foo.jpg%').should.be.false; pattern.match('layout/foo.swig').should.be.false; + pattern.match('layout/foo.njk').should.be.false; pattern.match('package.json').should.be.false; pattern.match('node_modules/test/test.js').should.be.false; pattern.match('source/node_modules/test/test.js').should.be.false; diff --git a/test/scripts/theme_processors/view.js b/test/scripts/theme_processors/view.js index 790913fe0a..f6171e5e33 100644 --- a/test/scripts/theme_processors/view.js +++ b/test/scripts/theme_processors/view.js @@ -36,9 +36,9 @@ describe('view', () => { it('pattern', () => { const { pattern } = processor; - pattern.match('layout/index.swig').path.should.eql('index.swig'); - should.not.exist(pattern.match('index.swig')); - should.not.exist(pattern.match('view/index.swig')); + pattern.match('layout/index.njk').path.should.eql('index.njk'); + should.not.exist(pattern.match('index.njk')); + should.not.exist(pattern.match('view/index.njk')); }); it('type: create', async () => { @@ -49,31 +49,31 @@ describe('view', () => { ].join('\n'); const file = newFile({ - path: 'index.swig', + path: 'index.njk', type: 'create' }); await writeFile(file.source, body); await process(file); - const view = hexo.theme.getView('index.swig'); + const view = hexo.theme.getView('index.njk'); - view.path.should.eql('index.swig'); - view.source.should.eql(join(themeDir, 'layout', 'index.swig')); + view.path.should.eql('index.njk'); + view.source.should.eql(join(themeDir, 'layout', 'index.njk')); view.data.should.eql({ foo: 'bar', _content: 'test' }); - hexo.theme.removeView('index.swig'); + hexo.theme.removeView('index.njk'); unlink(file.source); }); it('type: delete', async () => { const file = newFile({ - path: 'index.swig', + path: 'index.njk', type: 'delete' }); await process(file); - should.not.exist(hexo.theme.getView('index.swig')); + should.not.exist(hexo.theme.getView('index.njk')); }); });