-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support internationalization of document content and delete use…
…less sample files
- Loading branch information
1 parent
2e56230
commit 6d706ec
Showing
45 changed files
with
213 additions
and
1,429 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["biomejs.biome", "unifiedjs.vscode-mdx"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,44 @@ | ||
{ | ||
"editor.codeActionsOnSave": { | ||
"quickfix.biome": "explicit", | ||
"source.organizeImports.biome": "explicit", | ||
"quickfix.biome": "explicit" | ||
"source.formatDocument.biome": "explicit" | ||
}, | ||
"editor.defaultFormatter": "biomejs.biome", | ||
"editor.formatOnSave": true, | ||
"eslint.enable": false, | ||
"prettier.enable": false | ||
"prettier.enable": false, | ||
"[typescriptreact]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[javascript]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[javascriptreact]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[json]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[jsonc]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[cjs]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[mjs]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[cts]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[mts]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[css]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
pre-commit: | ||
commands: | ||
check: | ||
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}" | ||
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc,css}" | ||
run: npx @biomejs/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files} | ||
stage_fixed: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import { Footer, LastUpdated, Layout, Navbar } from 'nextra-theme-docs' | ||
import { Banner, Head } from 'nextra/components' | ||
import { getPageMap } from 'nextra/page-map' | ||
import 'nextra-theme-docs/style.css' | ||
import type { ReactNode } from 'react' | ||
import { Logo } from '~/components/logo' | ||
import '~/styles/globals.css' | ||
import type { Locale } from '~/i18n/config' | ||
import { getDictionary } from '~/i18n/routing' | ||
|
||
export const metadata = { | ||
metadataBase: new URL('https://createwise.ai'), | ||
favicon: '/favicon.ico', | ||
title: { | ||
template: '%s - CreateWise', | ||
}, | ||
description: 'CreateWise Docs', | ||
} | ||
|
||
export default async function RootLayout({ | ||
children, | ||
params, | ||
}: { children: ReactNode; params: Promise<{ lang: string }> }) { | ||
const { lang } = await params | ||
|
||
const dict = await getDictionary(lang as Locale) | ||
const pageMap = await getPageMap(`/${lang}`) | ||
|
||
const banner = () => { | ||
return ( | ||
<Banner storageKey='1.0-beta'> | ||
<div className=''> | ||
<a | ||
href='https://createwise.ai' | ||
target='_blank' | ||
rel='noreferrer' | ||
> | ||
🎉 CreateWise 1.0 beta is released. Read more → | ||
</a> | ||
</div> | ||
</Banner> | ||
) | ||
} | ||
|
||
const navbar = () => { | ||
return ( | ||
<Navbar | ||
logo={<Logo />} | ||
chatLink='https://discord.gg/p7kWbxDx' | ||
/> | ||
) | ||
} | ||
|
||
return ( | ||
<html | ||
lang={lang} | ||
suppressHydrationWarning | ||
> | ||
<Head /> | ||
<body> | ||
<Layout | ||
banner={banner()} | ||
navbar={navbar()} | ||
footer={<Footer />} | ||
docsRepositoryBase='https://github.com/CreateWise/createwise-docs' | ||
editLink={dict.editPage} | ||
sidebar={{ defaultMenuCollapseLevel: 2 }} | ||
pageMap={pageMap} | ||
lastUpdated={<LastUpdated>{dict.lastUpdated}</LastUpdated>} | ||
i18n={[ | ||
{ locale: 'en', name: 'English' }, | ||
{ locale: 'zh', name: '简体中文' }, | ||
]} | ||
themeSwitch={{ | ||
dark: dict.dark, | ||
light: dict.light, | ||
system: dict.system, | ||
}} | ||
nextThemes={{ defaultTheme: 'system' }} | ||
feedback={{ | ||
content: dict.feedback, | ||
labels: '', | ||
}} | ||
> | ||
{children} | ||
</Layout> | ||
</body> | ||
</html> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { NotFoundPage as default } from 'nextra-theme-docs' |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default { | ||
index: 'Introduction', | ||
guide: 'Guide', | ||
advanced: 'Advanced', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Todo 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default { | ||
demo: '', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Todo 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Introduction |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.