Skip to content

Commit

Permalink
Remove Swig rendering condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Parisot committed Jan 17, 2020
1 parent 4c4027e commit ac9fa60
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lib/hexo/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,6 @@ class Post {
return Promise.reject(new Error('No input file or string!')).asCallback(callback);
}

const isSwig = ext === 'swig';

// disable Nunjucks when the renderer spcify that.
const disableNunjucks = ext && ctx.render.renderer.get(ext) && !!ctx.render.renderer.get(ext).disableNunjucks;

Expand All @@ -260,12 +258,7 @@ class Post {
}).then(() => {
data.content = cacheObj.escapeContent(data.content);

if (isSwig) {
// Render with Nunjucks if this is a swig file
return tag.render(data.content, data);
}

// Escape all Swig tags
// Escape all Nunjucks/Swig tags
if (!disableNunjucks) {
data.content = cacheObj.escapeAllSwigTags(data.content);
}
Expand Down

0 comments on commit ac9fa60

Please sign in to comment.