Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add permalink to include the page #40

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions permalinks.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -251,9 +251,7 @@ module.exports = function(params, callback) {
if(_.isUndefined(options.structure) && _.isUndefined(options.preset)) { if(_.isUndefined(options.structure) && _.isUndefined(options.preset)) {
page.dest = page.dest; page.dest = page.dest;
} else { } else {
if (page.basename === 'index') { if (page.data.permalink === true ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this code is necessary to exclude index pages from having the destination file path altered in an unexpected way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does this achieve what you're suggesting in the pr?

page.dest = page.dest;
} else {
page.dest = utils.normalizePath(path.join(page.dirname, permalink)); page.dest = utils.normalizePath(path.join(page.dirname, permalink));
} }
} }
Expand All @@ -272,4 +270,4 @@ module.exports = function(params, callback) {


module.exports.options = { module.exports.options = {
stage: 'render:pre:pages' stage: 'render:pre:pages'
}; };