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
Dato globalSeo
doesn't work with HelmetDatoCms
#116
Comments
Thank you @ndom91 for the issue and the PR! We'll have a look at this as soon as possible and get back to you :) |
Hey @ndom91 thanks for the PR, but Meta tags are generated merging the values present in the record's SEO meta tags field together with the Global SEO settings. |
Okay understand, but then how do you recommend we work with the |
If you just want to use globalSeo then yes, go ahead adding custom children to the component:
It's not a good practice to use the same SEO information everywhere in the site, so we'd rather not facilitate doing this. Would be better to create a single-instance model for every website page and add a SEO field in it, so that editors can customize SEO differently for each page. Does it make any sense to you? |
Yeah that makes sense, I just wanted to have a base set of Seo tags, default title, fb Url, twitter Url, etc. which don't change from page to page, and only overwrite certain tags based on the page. |
Then I would suggest you to have a single-instance model (maybe Homepage, or something else) with a SEO field, and use seoMetaTags with it inside the Layout. Then override with a new HelmetDatoCms component within the single specific pages! 👍 |
Due to the
globalCms
having a different shape, it doesn't seem to work with theHelmetDatoCms
component.For example:
Query to get page and global seo tags:
The format of the globalSeo return value is totally different, no array full of neat objects of tags with attribute name / value, so i think we'd have to build a totally separate handler for if the user passes in global seo tags, instead of the page based ones.
See:
gatsby-source-datocms/src/index.js
Lines 10 to 29 in 1ee87cb
What do you guys think?
EDIT: Put together an initial PR to explore this idea: #117
The text was updated successfully, but these errors were encountered: