add import linting + fix checks
This commit is contained in:
parent
ea2d8b2773
commit
902f722d4c
17 changed files with 317 additions and 173 deletions
|
|
@ -40,7 +40,7 @@ export const ALGOLIA = {
|
|||
apiKey: 'XXXXXXXXXX',
|
||||
};
|
||||
|
||||
export type Sidebar = Record<typeof KNOWN_LANGUAGE_CODES[number], Record<string, { text: string; link: string }[]>>;
|
||||
export type Sidebar = Record<(typeof KNOWN_LANGUAGE_CODES)[number], Record<string, { text: string; link: string }[]>>;
|
||||
export const SIDEBAR: Sidebar = {
|
||||
en: {
|
||||
Tutorial: [
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@ export const langPathRegex = /\/([a-z]{2}-?[A-Z]{0,2})\//;
|
|||
export function getLanguageFromURL(pathname: string) {
|
||||
const langCodeMatch = pathname.match(langPathRegex);
|
||||
const langCode = langCodeMatch ? langCodeMatch[1] : 'en';
|
||||
return langCode as typeof KNOWN_LANGUAGE_CODES[number];
|
||||
return langCode as (typeof KNOWN_LANGUAGE_CODES)[number];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue