Skip to content

Commit d5ef613

Browse files
committed
feat: Introduce a new documentation site with i18n support, core layouts, and an interactive code playground.
1 parent e3ab2d9 commit d5ef613

17 files changed

Lines changed: 207 additions & 37 deletions

pages/public/favicon.png

15 KB
Loading

pages/src/components/Sidebar.astro

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ const navItems = [
4848
icon: "material-symbols:settings-outline",
4949
},
5050
{
51-
key: "nav.linter" as const,
51+
key: "nav.useLinter" as const,
5252
path: `/${lang}/linter/`,
5353
icon: "material-symbols:search-check",
5454
},
5555
{
56-
key: "nav.prettier" as const,
56+
key: "nav.usePrettier" as const,
5757
path: `/${lang}/prettier/`,
5858
icon: "material-symbols:format-align-left",
5959
},
@@ -111,6 +111,18 @@ const navItems = [
111111
npm
112112
</a>
113113
</li>
114+
<li>
115+
<a href={links.npmLinter} target="_blank" rel="noopener">
116+
<Icon name="material-symbols:search-check" class="nav-icon" />
117+
Linter
118+
</a>
119+
</li>
120+
<li>
121+
<a href={links.npmPrettier} target="_blank" rel="noopener">
122+
<Icon name="simple-icons:prettier" class="nav-icon" />
123+
Prettier Plugin
124+
</a>
125+
</li>
114126
<li>
115127
<a href={links.vscodeExtension} target="_blank" rel="noopener">
116128
<Icon name="simple-icons:visualstudiocode" class="nav-icon" />
@@ -124,7 +136,7 @@ const navItems = [
124136
<div class="sidebar-footer">
125137
<div class="lang-switcher">
126138
{
127-
currentPath === "/" ? (
139+
currentPath === "/" || currentPath === "/playground/" ? (
128140
<>
129141
<span class="lang-btn active">EN</span>
130142
<span class="lang-btn">JA</span>

pages/src/i18n/translations.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ export const ui = {
3737
"nav.classes": "Classes",
3838
"nav.cli": "CLI Reference",
3939
"nav.config": "Configuration",
40+
"nav.useLinter": "Use Linter",
41+
"nav.usePrettier": "Use Prettier Plugin",
4042
"nav.linter": "Linter",
4143
"nav.prettier": "Prettier Plugin",
4244
"nav.vscode": "VS Code Extension",
@@ -312,7 +314,7 @@ export const ui = {
312314
"vscode.idTitle": "Extension ID",
313315

314316
// Linter
315-
"linter.title": "Linter",
317+
"linter.title": "Use Linter",
316318
"linter.introDesc":
317319
"<code>@noshift.js/lint</code> is an official linter for NoShift.js that checks <code>.nsjs</code> files for syntax errors and style issues.",
318320
"linter.installTitle": "Installation",
@@ -383,6 +385,8 @@ export const ui = {
383385
"nav.classes": "Classes",
384386
"nav.cli": "CLI Reference",
385387
"nav.config": "Configuration",
388+
"nav.useLinter": "Use Linter",
389+
"nav.usePrettier": "Use Prettier Plugin",
386390
"nav.linter": "Linter",
387391
"nav.prettier": "Prettier Plugin",
388392
"nav.vscode": "VS Code Extension",

pages/src/layouts/BaseLayout.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ const { lang, title, description, ogTitle, ogDescription } = Astro.props;
1515
1616
const pageTitle = title ?? t(lang, "site.title");
1717
const pageDesc = description ?? t(lang, "site.description");
18-
const pageOgTitle = ogTitle ?? t(lang, "site.ogTitle");
19-
const pageOgDesc = ogDescription ?? t(lang, "site.ogDescription");
18+
const pageOgTitle = ogTitle ?? pageTitle;
19+
const pageOgDesc = ogDescription ?? pageDesc;
2020
const siteUrl = links.site;
21-
const ogImage = `${siteUrl}/img/icon.png`;
21+
const ogImage = `${siteUrl}/favicon.png`;
2222
const canonicalUrl = new URL(Astro.url.pathname, siteUrl).href;
2323
---
2424

pages/src/layouts/DocsLayout.astro

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@ interface Props {
1111
lang: Lang;
1212
title?: string;
1313
description?: string;
14+
ogTitle?: string;
15+
ogDescription?: string;
1416
currentPath: string;
1517
prev?: { href: string; title: string };
1618
next?: { href: string; title: string };
1719
}
1820
19-
const { lang, title, description, currentPath, prev, next } = Astro.props;
21+
const { lang, title, description, ogTitle, ogDescription, currentPath, prev, next } = Astro.props;
2022
---
2123

22-
<BaseLayout lang={lang} title={title} description={description}>
24+
<BaseLayout lang={lang} title={title} description={description} ogTitle={ogTitle} ogDescription={ogDescription}>
2325
<div class="layout">
2426
<Sidebar lang={lang} currentPath={currentPath} />
2527
<div class="sidebar-overlay" id="sidebar-overlay"></div>

pages/src/pages/[lang]/capitalize.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ const { lang } = Astro.params as { lang: Lang };
1212

1313
<DocsLayout
1414
lang={lang}
15-
title={t(lang, "cap.title") + " NoShift.js"}
15+
title={t(lang, "nav.capitalize") + " | NoShift.js"}
1616
currentPath={`/${lang}/capitalize/`}
1717
prev={{ href: `/${lang}/syntax/`, title: t(lang, "nav.syntax") }}
1818
next={{ href: `/${lang}/classes/`, title: t(lang, "nav.classes") }}
1919
>
20-
<h1>{t(lang, "cap.title")}</h1>
20+
<h1>{t(lang, "nav.capitalize")}</h1>
2121
<p set:html={t(lang, "cap.introDesc")} />
2222

2323
<h2>{t(lang, "cap.basicTitle")}</h2>

pages/src/pages/[lang]/classes.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ const { lang } = Astro.params as { lang: Lang };
1212

1313
<DocsLayout
1414
lang={lang}
15-
title={t(lang, "classes.title") + " NoShift.js"}
15+
title={t(lang, "nav.classes") + " | NoShift.js"}
1616
currentPath={`/${lang}/classes/`}
1717
prev={{ href: `/${lang}/capitalize/`, title: t(lang, "nav.capitalize") }}
1818
next={{ href: `/${lang}/cli/`, title: t(lang, "nav.cli") }}
1919
>
20-
<h1>{t(lang, "classes.title")}</h1>
20+
<h1>{t(lang, "nav.classes")}</h1>
2121
<p set:html={t(lang, "classes.introDesc")} />
2222

2323
<h2>{t(lang, "classes.basicTitle")}</h2>

pages/src/pages/[lang]/cli.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ const { lang } = Astro.params as { lang: Lang };
1212

1313
<DocsLayout
1414
lang={lang}
15-
title={t(lang, "cli.title") + " NoShift.js"}
15+
title={t(lang, "nav.cli") + " | NoShift.js"}
1616
currentPath={`/${lang}/cli/`}
1717
prev={{ href: `/${lang}/classes/`, title: t(lang, "nav.classes") }}
1818
next={{ href: `/${lang}/config/`, title: t(lang, "nav.config") }}
1919
>
20-
<h1>{t(lang, "cli.title")}</h1>
20+
<h1>{t(lang, "nav.cli")}</h1>
2121
<p set:html={t(lang, "cli.introDesc")} />
2222

2323
<h2>{t(lang, "cli.compileTitle")}</h2>

pages/src/pages/[lang]/config.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ const { lang } = Astro.params as { lang: Lang };
1212

1313
<DocsLayout
1414
lang={lang}
15-
title={t(lang, "config.title") + " NoShift.js"}
15+
title={t(lang, "nav.config") + " | NoShift.js"}
1616
currentPath={`/${lang}/config/`}
1717
prev={{ href: `/${lang}/cli/`, title: t(lang, "nav.cli") }}
1818
next={{ href: `/${lang}/linter/`, title: t(lang, "nav.linter") }}
1919
>
20-
<h1>{t(lang, "config.title")}</h1>
20+
<h1>{t(lang, "nav.config")}</h1>
2121
<p set:html={t(lang, "config.introDesc")} />
2222

2323
<h2>{t(lang, "config.fileTitle")}</h2>

pages/src/pages/[lang]/getting-started.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ const { lang } = Astro.params as { lang: Lang };
1212

1313
<DocsLayout
1414
lang={lang}
15-
title={t(lang, "gs.title") + " NoShift.js"}
15+
title={t(lang, "nav.gettingStarted") + " | NoShift.js"}
1616
currentPath={`/${lang}/getting-started/`}
1717
prev={{ href: "/", title: t(lang, "nav.home") }}
1818
next={{ href: `/${lang}/syntax/`, title: t(lang, "nav.syntax") }}
1919
>
20-
<h1>{t(lang, "gs.title")}</h1>
20+
<h1>{t(lang, "nav.gettingStarted")}</h1>
2121

2222
<h2>{t(lang, "gs.installTitle")}</h2>
2323
<p set:html={t(lang, "gs.installDesc")} />

0 commit comments

Comments
 (0)