Skip to content

Commit 879889b

Browse files
committed
Merge pull request #248 from gatsbyjs/test-html-metadata
Make HTML & md wrappers consistent + test html frontmatter
2 parents 286c846 + 0454bf7 commit 879889b

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

lib/isomorphic/wrappers/html.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ module.exports = React.createClass({
1212
},
1313

1414
render () {
15-
const html = this.props.route.page.data.body
15+
const post = this.props.route.page.data
1616
return (
17-
<div dangerouslySetInnerHTML={{ __html: html }} />
17+
<div>
18+
<h1>{post.title}</h1>
19+
<div dangerouslySetInnerHTML={{ __html: post.html }} />
20+
</div>
1821
)
1922
},
2023
})
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
<h1>html</h1>
1+
<!--
2+
title: html
3+
-->
24
<p>This is a page with the .html extension.</p>

test/integration/static-html-wrappers.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ test('md/index.html has an h1 that states file extention', async t => {
2222
const filePath = path.join(fixturePath, 'public', 'md', 'index.html')
2323
const $ = await dom(filePath)
2424

25-
// MD wrapper spits out an h1 tag. Shouldn't it be consistent with HTML
2625
const heading = $('h1').last()
2726
t.truthy(heading)
2827
const headingText = heading.text()

0 commit comments

Comments
 (0)