-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update sitemap example to include posts and exclude sample page (#5723)
* Update sitemap example to include posts and exclude sample page * this page isn't secret * no need to have custom html.js here * add some information and change link to point to sitemap produced by this example
- Loading branch information
1 parent
956a357
commit 44ad96d
Showing
8 changed files
with
109 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react' | ||
|
||
const Page = () => ( | ||
<div> | ||
<h1>Not so secret page</h1> | ||
<p>This page should be included in sitemap.xml</p> | ||
</div> | ||
) | ||
|
||
export default Page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react' | ||
|
||
const Secret = () => ( | ||
<div> | ||
<h1>Secret page</h1> | ||
<p>This page should be excluded from sitemap.xml</p> | ||
</div> | ||
) | ||
|
||
export default Secret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react' | ||
|
||
class BlogPost extends React.Component { | ||
render() { | ||
const { html, frontmatter } = this.props.data.markdownRemark | ||
return ( | ||
<div> | ||
<h1>{frontmatter.title}</h1> | ||
<div className="container content"> | ||
<div dangerouslySetInnerHTML={{ __html: html }} /> | ||
</div> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
export default BlogPost | ||
|
||
export const PageQuery = graphql` | ||
query blogPostBySlug($slug: String!) { | ||
markdownRemark(fields: { slug: { eq: $slug } }) { | ||
html | ||
frontmatter { | ||
title | ||
} | ||
} | ||
site { | ||
siteMetadata { | ||
title | ||
} | ||
} | ||
} | ||
` |