Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add itemProp attributes for meta tag, titleAttributes for title #169

Merged
merged 7 commits into from
Dec 19, 2016

Conversation

dattran92
Copy link
Contributor

Supporting issue #113.
Usage:

  • For itemProp in meta:
    <Helmet meta={[{'itemProp': 'image', 'content': 'some_url_here'}]} />
  • For itemProp in title:
    <Helmet title="Your title" titleAttributes={{itemProp: 'name'}} />

@CLAassistant
Copy link

CLAassistant commented Aug 16, 2016

CLA assistant check
All committers have signed the CLA.

@clayne11 clayne11 mentioned this pull request Oct 12, 2016
@roastlechon
Copy link

When is this going to get merged?

@homebrewerluke
Copy link

Is there a plan for this to be merged soon?

@cwelch5
Copy link
Contributor

cwelch5 commented Dec 4, 2016

Thanks for the PR and your patience. I will actively work on getting this into the codebase asap.

Copy link
Contributor

@cwelch5 cwelch5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Thanks for the PR.

@@ -273,6 +295,10 @@ const generateTagsAsString = (type, tags) => {
}

const encodedValue = encodeSpecialCharacters(tag[attribute]);
// itemProp in react is camelcase, but will generate as lowercase
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API should be html key itemprop as you would expect to see it in the DOM. It will just pass-through in this function.

Object.keys(attributes).forEach((attribute) => {
props[attribute] = attributes[attribute];
});

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You would do a conversion here using REACT_TAG_MAP to convert itemprop to itemProp

@@ -368,6 +399,7 @@ const Helmet = (Component) => {
* @param {String} title: "Title"
* @param {String} defaultTitle: "Default Title"
* @param {String} titleTemplate: "MySite.com - %s"
* @param {Object} titleAttributes: {"itemProp": "name"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

itemprop

@dattran92
Copy link
Contributor Author

@cwelch5 Updated.

@cwelch5 cwelch5 merged commit 6312e09 into nfl:master Dec 19, 2016
@cwelch5
Copy link
Contributor

cwelch5 commented Dec 19, 2016

Thx @dattran92 for your patience. Will publish soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants