Skip to content

Commit

Permalink
Replace swig with nunjucks (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang authored Mar 28, 2020
1 parent 372a704 commit 9083c3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/deployer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const pathFn = require('path');
const fs = require('hexo-fs');
const chalk = require('chalk');
const swig = require('swig');
const nunjucks = require('nunjucks');
const moment = require('moment');
const util = require('hexo-util');
const spawn = util.spawn;
Expand Down Expand Up @@ -97,5 +97,5 @@ module.exports = function(args) {

function commitMessage(args) {
const message = args.m || args.msg || args.message || 'Site updated: {{ now(\'YYYY-MM-DD HH:mm:ss\') }}';
return swig.compile(message)(swigHelpers);
return nunjucks.renderString(message, swigHelpers);
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"hexo-fs": "^2.0.0",
"hexo-util": "^1.0.0",
"moment": "^2.13.0",
"swig": "^1.4.2"
"nunjucks": "^3.2.1"
},
"engines": {
"node": ">=8.6.0"
Expand Down

0 comments on commit 9083c3e

Please sign in to comment.