Skip to content

Commit

Permalink
fix: trailing_index function should ru first
Browse files Browse the repository at this point in the history
  • Loading branch information
curbengh committed Sep 15, 2019
1 parent 7818a9c commit 3d0ba3c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/models/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ module.exports = ctx => {
Post.virtual('permalink').get(function() {
const { config } = ctx;
let partial_url = url_for.call(ctx, this.path);
if (config.relative_link) partial_url = `/${partial_url}`;
if (config.pretty_urls.trailing_index === false) partial_url = partial_url.replace(/index\.html$/, '');
if (config.relative_link) partial_url = `/${partial_url}`;
return full_url_for.call(ctx, partial_url.replace(config.root, '/'));
});

Expand Down

0 comments on commit 3d0ba3c

Please sign in to comment.