diff options
author | Alan Pearce | 2017-06-18 18:23:28 +0200 |
---|---|---|
committer | Alan Pearce | 2017-06-18 18:23:28 +0200 |
commit | e13c5726846a89df4196f6abc9fc98d99d48305b (patch) | |
tree | 700b4942398c36113425793242a820ce4a8a6b52 | |
parent | 33171a749162685e42650f82041cd2af0136718d (diff) | |
download | homestead-e13c5726846a89df4196f6abc9fc98d99d48305b.tar.lz homestead-e13c5726846a89df4196f6abc9fc98d99d48305b.tar.zst homestead-e13c5726846a89df4196f6abc9fc98d99d48305b.zip |
Rename templates to njk
It's specified in the nunjucks documentation. Using it allows editors to understand the syntax better
-rw-r--r-- | src/index.js | 6 | ||||
-rw-r--r-- | src/views/index.njk (renamed from src/views/index.html) | 0 | ||||
-rw-r--r-- | src/views/post.njk (renamed from src/views/post.html) | 0 | ||||
-rw-r--r-- | src/views/tag.njk (renamed from src/views/tag.html) | 0 |
4 files changed, 5 insertions, 1 deletions
diff --git a/src/index.js b/src/index.js index fce4c09..242b298 100644 --- a/src/index.js +++ b/src/index.js @@ -13,7 +13,11 @@ const view = require('koa-nunjucks-next') const Posts = require('./modules/posts.js') const posts = Posts.getFolder(process.env.POST_DIR) -app.use(view(`${__dirname}/views`)) +app.use( + view(`${__dirname}/views`, { + extname: 'njk' + }) +) const postsArray = Array.from(posts.entries()) router.get('/', async function (ctx) { diff --git a/src/views/index.html b/src/views/index.njk index dcc142c..dcc142c 100644 --- a/src/views/index.html +++ b/src/views/index.njk diff --git a/src/views/post.html b/src/views/post.njk index 81f7e3d..81f7e3d 100644 --- a/src/views/post.html +++ b/src/views/post.njk diff --git a/src/views/tag.html b/src/views/tag.njk index 7ff9871..7ff9871 100644 --- a/src/views/tag.html +++ b/src/views/tag.njk |