diff --git a/lib/models/category.js b/lib/models/category.js index a025b5316a..593ddb799f 100644 --- a/lib/models/category.js +++ b/lib/models/category.js @@ -38,7 +38,7 @@ module.exports = ctx => { }); Category.virtual('permalink').get(function() { - return `${ctx.config.url}/${this.path}`; + return `${ctx.config.url}${ctx.config.root}${this.path}`; }); Category.virtual('posts').get(function() { diff --git a/lib/models/page.js b/lib/models/page.js index f946abb25d..e9762d5f76 100644 --- a/lib/models/page.js +++ b/lib/models/page.js @@ -32,7 +32,7 @@ module.exports = ctx => { }); Page.virtual('permalink').get(function() { - return `${ctx.config.url}/${this.path}`; + return `${ctx.config.url}${ctx.config.root}${this.path}`; }); Page.virtual('full_source').get(function() { diff --git a/lib/models/tag.js b/lib/models/tag.js index 22491f1fd9..3bcf96e288 100644 --- a/lib/models/tag.js +++ b/lib/models/tag.js @@ -29,7 +29,7 @@ module.exports = ctx => { }); Tag.virtual('permalink').get(function() { - return `${ctx.config.url}/${this.path}`; + return `${ctx.config.url}${ctx.config.root}${this.path}`; }); Tag.virtual('posts').get(function() {