-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Localized site metadata #8890
Comments
Hi @sedubois 👋, |
Thanks @NickyMeuleman. I haven’t understood how those build-time GraphQL templates would solve the issue. How would I build and query siteMetadata so that it works for all locales? |
@kakadiadarpan would you know if the way site metadata is built could be adapted to support GraphQL variables, and what would be the process to make it happen? |
You would probably need some other place than gatsby-config for that. Like separate yaml, or json file with something setup like: [
{
"lang": "en",
"algioliaIndex": "my-algolia-index-en"
}
] and using transformer json transformer plugin then you could query that and filter based on "lang" field |
Thanks @pieh |
Summary
I would like to populate my GraphQL API with localized site metadata, which would require the ability to pass a variable in the GraphQL query.
Basic example
or
Motivation
The various examples using
siteMetadata
currently don't take localization into account, which makes its use problematic for multilingual webapps. Even the basic properties shown in the doc such astitle
,siteUrl
anddescription
can't be defined there currently as they are all language-dependent.The text was updated successfully, but these errors were encountered: