Skip to content

Commit

Permalink
Add ability to override page URL in attr section
Browse files Browse the repository at this point in the history
  • Loading branch information
kisenka committed Jul 28, 2016
1 parent bdcf8c4 commit 5276c87
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/plugins/PagePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,16 @@ PagePlugin.prototype.apply = function (compiler) {
return result instanceof DocPage;
})
.map(function(page) {
var filename = interpolateName(plugin.options.filename, {
path: page.source.absolutePath,
context: compilation.compiler.context
});
var filename;

if (page.attrs.url) {
filename = page.attrs.url;
} else {
filename = interpolateName(plugin.options.filename, {
path: page.source.absolutePath,
context: compilation.compiler.context
});
}

page.path = filename;

Expand Down

0 comments on commit 5276c87

Please sign in to comment.