Skip to content

Commit d13cf07

Browse files
committed
Merge pull request #164 from gatsbyjs/add-parent-template
Add parentTemplateFile to routes as potentially useful
2 parents 2e1a588 + 8620488 commit d13cf07

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/isomorphic/create-routes.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ module.exports = (files, pagesReq) => {
7171
indexRoute: {},
7272
pages,
7373
templates,
74+
parentTemplateFile,
7475
}
7576

7677
// Add route to the templates object for easy access.
@@ -93,6 +94,8 @@ module.exports = (files, pagesReq) => {
9394
switch (page.file.ext) {
9495
case 'md':
9596
handler = markdownWrapper
97+
// TODO figure out if this is redundant as data already added in
98+
// glob-pages.
9699
page.data = pagesReq(`./${page.requirePath}`)
97100
break
98101
case 'html':
@@ -144,6 +147,7 @@ module.exports = (files, pagesReq) => {
144147
page,
145148
pages,
146149
templates,
150+
parentTemplateFile,
147151
}
148152
} else {
149153
parentRoute.childRoutes.push({
@@ -152,6 +156,7 @@ module.exports = (files, pagesReq) => {
152156
page,
153157
pages,
154158
templates,
159+
parentTemplateFile,
155160
})
156161
}
157162
})

0 commit comments

Comments
 (0)