Skip to content

Commit

Permalink
Merge pull request #1599 from magicdawn/fix-special-tags
Browse files Browse the repository at this point in the history
tag: fix special tag names
  • Loading branch information
Xuanwo committed Dec 4, 2015
2 parents 2af6676 + 23dddf2 commit 7e1d351
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/models/tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
var Schema = require('warehouse').Schema;
var util = require('hexo-util');
var slugize = util.slugize;
var hasOwn = Object.prototype.hasOwnProperty;

module.exports = function(ctx) {
var Tag = new Schema({
Expand All @@ -14,7 +15,10 @@ module.exports = function(ctx) {
var name = this.name;
if (!name) return;

name = map[name] || name;
if (hasOwn.call(map, name)) {
name = map[name] || name;
}

return slugize(name, {transform: ctx.config.filename_case});
});

Expand Down

0 comments on commit 7e1d351

Please sign in to comment.