-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate
SiteMetadata
component into existing pages
All currently existing pages will now include the implemented metadata tags in the `<head>`. GH-101
- Loading branch information
1 parent
42bc8d0
commit f0afd74
Showing
7 changed files
with
66 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (C) 2018-present Arctic Ice Studio <[email protected]> | ||
* Copyright (C) 2018-present Sven Greb <[email protected]> | ||
* | ||
* Project: Nord Docs | ||
* Repository: https://github.com/arcticicestudio/nord-docs | ||
* License: MIT | ||
*/ | ||
|
||
/** | ||
* @file Provides shared prop types for pages. | ||
* @author Arctic Ice Studio <[email protected]> | ||
* @author Sven Greb <[email protected]> | ||
* @see https://reactjs.org/docs/typechecking-with-proptypes.html | ||
* @since 0.4.0 | ||
*/ | ||
|
||
import PropTypes from "prop-types"; | ||
|
||
const locationPropTypes = { | ||
/** | ||
* The `location` object provided by React/Reach Router. | ||
* | ||
* @see https://reach.tech/router/api/Router | ||
*/ | ||
location: PropTypes.shape({ | ||
/** | ||
* The name of the current route/path. | ||
*/ | ||
pathname: PropTypes.string | ||
}).isRequired | ||
}; | ||
|
||
/* eslint-disable-next-line import/prefer-default-export */ | ||
export { locationPropTypes }; |
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
|
||
import React from "react"; | ||
|
||
import { locationPropTypes } from "data/pages/shared/propTypes"; | ||
import BaseLayout from "layouts/core/BaseLayout"; | ||
import { SectionLanding } from "organisms/page/404"; | ||
|
||
|
@@ -19,10 +20,12 @@ import { SectionLanding } from "organisms/page/404"; | |
* @author Sven Greb <[email protected]> | ||
* @since 0.3.0 | ||
*/ | ||
const Docs = props => ( | ||
<BaseLayout {...props}> | ||
const HttpStatus404 = ({ location: { pathname } }) => ( | ||
<BaseLayout pathName={pathname}> | ||
<SectionLanding /> | ||
</BaseLayout> | ||
); | ||
|
||
export default Docs; | ||
HttpStatus404.propTypes = locationPropTypes; | ||
|
||
export default HttpStatus404; |
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
|
||
import React from "react"; | ||
|
||
import { locationPropTypes } from "data/pages/shared/propTypes"; | ||
import BaseLayout from "layouts/core/BaseLayout"; | ||
import { SectionBlogPosts } from "organisms/page/blog"; | ||
|
||
|
@@ -19,10 +20,12 @@ import { SectionBlogPosts } from "organisms/page/blog"; | |
* @author Sven Greb <[email protected]> | ||
* @since 0.3.0 | ||
*/ | ||
const Blog = props => ( | ||
<BaseLayout {...props}> | ||
const Blog = ({ location: { pathname } }) => ( | ||
<BaseLayout pathName={pathname}> | ||
<SectionBlogPosts /> | ||
</BaseLayout> | ||
); | ||
|
||
Blog.propTypes = locationPropTypes; | ||
|
||
export default Blog; |
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
|
||
import React from "react"; | ||
|
||
import { locationPropTypes } from "data/pages/shared/propTypes"; | ||
import BaseLayout from "layouts/core/BaseLayout"; | ||
import { SectionLanding } from "organisms/page/community"; | ||
|
||
|
@@ -19,10 +20,12 @@ import { SectionLanding } from "organisms/page/community"; | |
* @author Sven Greb <[email protected]> | ||
* @since 0.3.0 | ||
*/ | ||
const Community = props => ( | ||
<BaseLayout {...props}> | ||
const Community = ({ location: { pathname } }) => ( | ||
<BaseLayout pathName={pathname}> | ||
<SectionLanding /> | ||
</BaseLayout> | ||
); | ||
|
||
Community.propTypes = locationPropTypes; | ||
|
||
export default Community; |
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
|
||
import React from "react"; | ||
|
||
import { locationPropTypes } from "data/pages/shared/propTypes"; | ||
import BaseLayout from "layouts/core/BaseLayout"; | ||
import { SectionLanding } from "organisms/page/docs"; | ||
|
||
|
@@ -19,10 +20,12 @@ import { SectionLanding } from "organisms/page/docs"; | |
* @author Sven Greb <[email protected]> | ||
* @since 0.3.0 | ||
*/ | ||
const Docs = props => ( | ||
<BaseLayout {...props}> | ||
const Docs = ({ location: { pathname } }) => ( | ||
<BaseLayout pathName={pathname}> | ||
<SectionLanding /> | ||
</BaseLayout> | ||
); | ||
|
||
Docs.propTypes = locationPropTypes; | ||
|
||
export default Docs; |
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
|
||
import React from "react"; | ||
|
||
import { locationPropTypes } from "data/pages/shared/propTypes"; | ||
import BaseLayout from "layouts/core/BaseLayout"; | ||
import { SectionHero } from "organisms/page/landing"; | ||
|
||
|
@@ -19,10 +20,12 @@ import { SectionHero } from "organisms/page/landing"; | |
* @author Sven Greb <[email protected]> | ||
* @since 0.1.0 | ||
*/ | ||
const Landing = () => ( | ||
<BaseLayout> | ||
const Landing = ({ location: { pathname } }) => ( | ||
<BaseLayout pathName={pathname}> | ||
<SectionHero /> | ||
</BaseLayout> | ||
); | ||
|
||
Landing.propTypes = locationPropTypes; | ||
|
||
export default Landing; |
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
|
||
import React from "react"; | ||
|
||
import { locationPropTypes } from "data/pages/shared/propTypes"; | ||
import BaseLayout from "layouts/core/BaseLayout"; | ||
import { SectionLanding } from "organisms/page/ports"; | ||
|
||
|
@@ -19,10 +20,12 @@ import { SectionLanding } from "organisms/page/ports"; | |
* @author Sven Greb <[email protected]> | ||
* @since 0.3.0 | ||
*/ | ||
const Ports = props => ( | ||
<BaseLayout {...props}> | ||
const Ports = ({ location: { pathname } }) => ( | ||
<BaseLayout pathName={pathname}> | ||
<SectionLanding /> | ||
</BaseLayout> | ||
); | ||
|
||
Ports.propTypes = locationPropTypes; | ||
|
||
export default Ports; |