Replies: 1 comment 4 replies
-
Is the project open source or can you create a small reproduction of it so that one can clone it and try some things? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am currently working on a page with i18n requirements that will have multiple authors involved.
What I like to achieve is the same thing as described in this blog post: https://www.lekoarts.de/en/blog/adding-support-for-multiple-authors-in-gatsby
But I want to do it with MDX and the linking needs to be locale-aware.
I also read the docs about
createSchemaCustomization
and I believe it will involvecreateTypes
and@link
, but I am not really able to get it together myself.I would appreciate any help with this very much!
My MDX data model for authors
To maintain author data I have a folder
content/data/authors
Within the folder I have a subfolder per author, e.g.
content/data/authors/john
where I store localized mdx files to describe the author:content/data/authors/john/en.mdx
,content/data/authors/john/de.mdx
, etc.en.mdx
de.mdx
My MDX data model for blog posts
My blog posts have the usual metadata + a
collectionId
andpageId
to identify the posts across locales. The crucial part of this problem is the list of author IDs that I want to pass to theauthors
field.The page query I'd like to use (but don't know how)
This page query works perfectly as intended with my site setup, except for the
authors
part. In frontmatter, it is just a list of typeString
(the author IDs). What I want it to be, is an array of the actual localized author data, dependent on$localeCode
frompageContext
.Beta Was this translation helpful? Give feedback.
All reactions