Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Commit

Permalink
fix: Capture titles for sections and standalone pages
Browse files Browse the repository at this point in the history
Closes #127.
  • Loading branch information
bebraw committed May 4, 2017
1 parent 0efac37 commit 8f6594a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/antwar/src/core/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ function allPages() {
return [
{
type: 'custom',
fileName: sectionName
fileName: sectionName,
section
}
];
}
Expand Down Expand Up @@ -187,7 +188,7 @@ function processPage({
return keywords;
},
title({ file }) {
return file.attributes && file.attributes.title;
return (section && section.title) || (file.attributes && file.attributes.title);
},
url({ sectionName = '', fileName = '' }) {
return `${sectionName}/${fileName}`;
Expand Down
2 changes: 1 addition & 1 deletion smoketest/antwar.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module.exports = function (env) {

function section(contentCb) {
return {
title: 'Smoke test',
title: 'Section test',
path() {
return contentCb();
},
Expand Down

0 comments on commit 8f6594a

Please sign in to comment.