-
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.
- Loading branch information
1 parent
6fbf176
commit 99d613e
Showing
10 changed files
with
138 additions
and
64 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 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,7 @@ | ||
import React from "react" | ||
|
||
export default ({ children }) => ( | ||
<div> | ||
{children} | ||
</div> | ||
) |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
import React from "react" | ||
import Layout from "../components/layout" | ||
|
||
const IndexRoute = () => ( | ||
<div> | ||
<p> | ||
Welcome to the GatsbyJS Sitemap Demo. Visit{` `} | ||
<a href="https://www.gatsbyjs.org/sitemap.xml"> | ||
to see the generated sitemap. | ||
</a> | ||
</p> | ||
</div> | ||
<Layout> | ||
<div> | ||
<p> | ||
Welcome to the GatsbyJS Sitemap Demo. Visit{` `} | ||
<a href="/sitemap.xml"> | ||
to see the generated sitemap. | ||
</a> | ||
</p> | ||
<p> | ||
Note: gatsby-plugin-sitemap uses <code>siteMetadata.siteUrl</code>{` `} | ||
defined in gatsby-config.js to construct absolute URLs! | ||
</p> | ||
</div> | ||
</Layout> | ||
) | ||
|
||
export default IndexRoute |
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,13 @@ | ||
import React from 'react' | ||
import Layout from "../components/layout" | ||
|
||
const Page = () => ( | ||
<Layout> | ||
<div> | ||
<h1>Not so secret page</h1> | ||
<p>This page should be included in sitemap.xml</p> | ||
</div> | ||
</Layout> | ||
) | ||
|
||
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,13 @@ | ||
import React from 'react' | ||
import Layout from "../components/layout" | ||
|
||
const Secret = () => ( | ||
<Layout> | ||
<div> | ||
<h1>Secret page</h1> | ||
<p>This page should be excluded from sitemap.xml</p> | ||
</div> | ||
</Layout> | ||
) | ||
|
||
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 | ||
} | ||
} | ||
} | ||
` |