This repository has been archived by the owner on Aug 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add document titles to docs and recipes (#49)
Add page titles to docs and recipes
- Loading branch information
Showing
9 changed files
with
183 additions
and
131 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,32 @@ | ||
import React from "react"; | ||
import DocumentMeta from "react-document-meta"; | ||
|
||
class TitleMeta extends React.Component { | ||
render() { | ||
const titleMeta = { | ||
title: this.props.title, | ||
meta: { | ||
property: { | ||
"og:title": this.props.title | ||
} | ||
} | ||
}; | ||
|
||
return ( | ||
<DocumentMeta {...titleMeta}> | ||
{this.props.children} | ||
</DocumentMeta> | ||
); | ||
} | ||
} | ||
|
||
TitleMeta.propTypes = { | ||
title: React.PropTypes.string, | ||
children: React.PropTypes.node | ||
}; | ||
|
||
export default TitleMeta; | ||
|
||
export const renderAsHTML = function () { | ||
return DocumentMeta.renderAsHTML(); | ||
}; |
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
Oops, something went wrong.