From 19bec9a84912178e0e59b4b0ac0331372f00c889 Mon Sep 17 00:00:00 2001 From: sKawashima Date: Sat, 29 Jun 2019 19:12:44 +0900 Subject: [PATCH 1/2] feat:create pull request From a423068e6e4cbad24bd808ef0ddbf30d43fc7fba Mon Sep 17 00:00:00 2001 From: sKawashima Date: Sat, 29 Jun 2019 19:17:22 +0900 Subject: [PATCH 2/2] fix virtual(permalink).get() --- lib/models/category.js | 2 +- lib/models/page.js | 2 +- lib/models/tag.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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() {