R
Reactiflux

✅ – venus – 11-48 Jun 9

✅ – venus – 11-48 Jun 9

Vvenus6/9/2022
Hey, I want to extract which locale is being used in that specific article. _raw is an output where should be that locale taken from. What is the best way to extract it? In this case it's en.
const _raw = {
sourceFilePath: 'articles/en/new-web.mdx',
sourceFileName: 'new-web.mdx',
sourceFileDir: 'articles/en',
contentType: 'mdx',
flattenedPath: 'articles/en/new-web'
};
const _raw = {
sourceFilePath: 'articles/en/new-web.mdx',
sourceFileName: 'new-web.mdx',
sourceFileDir: 'articles/en',
contentType: 'mdx',
flattenedPath: 'articles/en/new-web'
};
UUUnknown User6/9/2022
3 Messages Not Public
Sign In & Join Server To View
Vvenus6/9/2022
Yeah something like so?
const pathArray = path.split("/");
const locale = pathArray[1];
const pathArray = path.split("/");
const locale = pathArray[1];
UUUnknown User6/9/2022
2 Messages Not Public
Sign In & Join Server To View
Vvenus6/9/2022
Okay, thanks
UUUnknown User6/10/2022
Message Not Public
Sign In & Join Server To View

Looking for more? Join the community!

R
Reactiflux

✅ – venus – 11-48 Jun 9

Join Server