-
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
feat(www): Pull in translated gatsby docs (ENABLE_LOCALIZATIONS env var needed) #20637
feat(www): Pull in translated gatsby docs (ENABLE_LOCALIZATIONS env var needed) #20637
Conversation
@@ -4,7 +4,7 @@ import { graphql, useStaticQuery } from "gatsby" | |||
|
|||
import gatsbyIcon from "../assets/gatsby-icon.png" | |||
|
|||
const SiteMetadata = ({ pathname }) => { | |||
const SiteMetadata = ({ pathname, locale }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it better to pull in context or pass the locale down? SiteMetadata
is so far only used in Layout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the current setup I don't think it'll make a difference. I would consider using Context if the component e.g. would be used in MDX (for ease of use).
@@ -475,6 +487,7 @@ exports.createPages = ({ graphql, actions, reporter }) => { | |||
node { | |||
fields { | |||
slug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might end up causing confusion since here, "slug = path without locale".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess in the interim phase we have to live with that, once we have all parts of the site we could make a localizedSlug
or localize the slug
Is there a preview of this we can look at? |
@KyleAMathews I'm trying to build it on Gatsby Cloud but it's been finnicky, and there's currently no way to re-trigger a build AFAIK. Do we not have it set up to create a preview build on PRs? |
Here's a version of it with localizations not enabled, to test that everything works as before: |
It's not setup yet for preview builds. If you add your fork as a site however it'll build your branches. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM 👍 Good job :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What Lennart said ;)
Description
Pull in translated gatsby docs and display those docs on the site.
Live Example
https://build-57f60042-fb09-471c-9527-4479f5ba2c36.gtsb.io/es/tutorial/
Notes
ENABLE_LOCALIZATIONS
variableFollow-up Issues
localizedLink
(and lint against using the default gatsby link)Related Issues
fixes: #19353 #17759