Skip to content

Commit 0bfaa7e

Browse files
Solantchoisuhyeok1255Gaic4o
authored
Migrate documentation from docusaurus to astro starlight (#900)
* chore: initial astro setup * feat: add i18n * add get-started pages * docs: migrate /get-started/tutorial page * chore: add discord link * docs: migrate /guides/examples/auth * chore: ignore .astro * docs(kr): fix title mismatch in Next.js guide (#896) - Change title from "Usage with Electron" to "Usage with Next.js" - Ensures title matches file name, URL path, and content * docs: code smells/cross-imports add (#888) * docs: code smells/cross-imports add * fix: Title typo correction * docs: reflecting feedback * docs: reflecting feedback * Update i18n/en/docusaurus-plugin-content-docs/current/guides/issues/cross-imports.mdx Co-authored-by: Solant <runner62v6@gmail.com> --------- Co-authored-by: Solant <runner62v6@gmail.com> * docs: refactor desegmentation page (#895) * docs: refactor desegmentation page * docs: remove wip class * docs: remove outdated translations * docs: migrate examples/guides/types * docs: migrate guides/examples/page-layout * docs: migrate guides/examples/api-requests * docs: migrate guides/migration articles * docs: migrate tech category * docs: migrate issues * docs: migrate reference * chore: add fsd logo * docs: change home page * chore: replace build script with astro * docs: add favicon * docs: add missing en pages * docs: add llms.txt support * docs: follow exiting docs routing * add missing root pages * fix language order and social links * add sidebar ru translations * add ru translations for get-started * migrate ru/docs/about articles * add ru/docs/reference articles * use aside consistently across the files * migrate ru guides * add ja translations * migrate the rest of ja articles * add uz translations * migrate kr about articles * add korean translations * add vi translations * add missing Aside components * fix linter * add missing component * add zh translations * add available category translations * add placeholder home pages * fix review comments * fix some text inconsistencies * fix light/dark mode images * add component to use images from /static * docs: astro.config sidebar title emoji remove * docs: astro document color theme and font apply * fix: astro custom.css format build error * add prettier config for astro * fix iframe size * use replace <img> with StaticImage * docs: color theme, font - system ui change * fix: image path issue * docs: cross-imports kr update * docs: redirect landing page to overview * fix formatting * docs: astro meta tag add * docs: astro format update * fix links * add missing image * fix nested slice images * remove excessive headings * docs: ko desegmented add --------- Co-authored-by: choisuhyeok1255 <72919631+choisuhyeok1255@users.noreply.github.com> Co-authored-by: Minsu <alstntorl@naver.com>
1 parent 21e295a commit 0bfaa7e

File tree

194 files changed

+41052
-100
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+41052
-100
lines changed

.eslintrc.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ module.exports = {
3131
"linebreak-style": [2, "unix"],
3232
"import/no-unresolved": [
3333
2,
34-
{ ignore: ["^@theme", "^@docusaurus/plugin-content-docs/client"] },
34+
{
35+
ignore: [
36+
"^@theme",
37+
"^@docusaurus/plugin-content-docs/client",
38+
"astro:content",
39+
],
40+
},
3541
],
3642
"import/extensions": 0,
3743
"import/no-extraneous-dependencies": 0,

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# IDE
22
.idea
33

4+
# Astro
5+
.astro
6+
47
# Dependencies
58
node_modules
69

.prettierrc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
{
2-
"tabWidth": 4
2+
"tabWidth": 4,
3+
"plugins": ["prettier-plugin-astro"],
4+
"overrides": [
5+
{
6+
"files": "*.astro",
7+
"options": {
8+
"parser": "astro"
9+
}
10+
}
11+
]
312
}

astro.config.mjs

Lines changed: 245 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
1+
// @ts-check
2+
import { defineConfig } from "astro/config";
3+
import starlight from "@astrojs/starlight";
4+
import remarkHeaderId from "remark-heading-id";
5+
import starlightLlmsTxt from "starlight-llms-txt";
6+
import starlightLinksValidator from "starlight-links-validator";
7+
8+
// https://astro.build/config
9+
export default defineConfig({
10+
outDir: "./build",
11+
site: "https://fsd.how",
12+
redirects: {
13+
"/": "/docs/get-started/overview",
14+
"/ru": "/ru/docs/get-started/overview",
15+
"/uz": "/uz/docs/get-started/overview",
16+
"/kr": "/kr/docs/get-started/overview",
17+
"/ja": "/ja/docs/get-started/overview",
18+
"/vi": "/vi/docs/get-started/overview",
19+
"/zh": "/zh/docs/get-started/overview",
20+
},
21+
markdown: {
22+
// @ts-ignore
23+
remarkPlugins: [remarkHeaderId],
24+
},
25+
integrations: [
26+
starlight({
27+
title: "Feature-Sliced Design",
28+
description: "Architectural methodology for frontend projects",
29+
favicon: "./static/img/favicon/adaptive.svg",
30+
defaultLocale: "root",
31+
customCss: ["./src/styles/custom.css"],
32+
head: [
33+
{
34+
tag: "meta",
35+
attrs: { property: "og:type", content: "website" },
36+
},
37+
{
38+
tag: "meta",
39+
attrs: {
40+
property: "og:title",
41+
content: "Feature-Sliced Design",
42+
},
43+
},
44+
{
45+
tag: "meta",
46+
attrs: {
47+
property: "og:description",
48+
content:
49+
"Architectural methodology for frontend projects",
50+
},
51+
},
52+
{
53+
tag: "meta",
54+
attrs: {
55+
property: "og:image",
56+
content: "https://fsd.how/img/preview.png",
57+
},
58+
},
59+
{
60+
tag: "meta",
61+
attrs: { property: "og:url", content: "https://fsd.how" },
62+
},
63+
{
64+
tag: "meta",
65+
attrs: {
66+
name: "twitter:card",
67+
content: "summary_large_image",
68+
},
69+
},
70+
{
71+
tag: "meta",
72+
attrs: {
73+
name: "twitter:title",
74+
content: "Feature-Sliced Design",
75+
},
76+
},
77+
{
78+
tag: "meta",
79+
attrs: {
80+
name: "twitter:description",
81+
content:
82+
"Architectural methodology for frontend projects",
83+
},
84+
},
85+
{
86+
tag: "meta",
87+
attrs: {
88+
name: "twitter:image",
89+
content: "https://fsd.how/img/preview.png",
90+
},
91+
},
92+
],
93+
logo: {
94+
src: "./static/img/brand/logo-primary.png",
95+
replacesTitle: true,
96+
},
97+
plugins: [
98+
starlightLlmsTxt(),
99+
starlightLinksValidator({
100+
errorOnFallbackPages: false,
101+
errorOnInconsistentLocale: true,
102+
}),
103+
],
104+
locales: {
105+
root: {
106+
label: "English",
107+
lang: "en",
108+
},
109+
ru: {
110+
label: "Русский",
111+
},
112+
uz: {
113+
label: "O'zbekcha",
114+
},
115+
kr: {
116+
label: "한국어",
117+
lang: "ko",
118+
},
119+
ja: {
120+
label: "日本語",
121+
},
122+
vi: {
123+
label: "Tiếng Việt",
124+
},
125+
zh: {
126+
label: "中文",
127+
},
128+
},
129+
social: [
130+
{
131+
icon: "github",
132+
label: "GitHub",
133+
href: "https://github.com/feature-sliced/documentation",
134+
},
135+
{
136+
icon: "discord",
137+
label: "Discord",
138+
href: "https://discord.gg/S8MzWTUsmp",
139+
},
140+
],
141+
sidebar: [
142+
{
143+
label: "Get Started",
144+
translations: {
145+
ru: "Начало работы",
146+
ja: "はじめに",
147+
},
148+
autogenerate: { directory: "docs/get-started" },
149+
},
150+
{
151+
label: "Guides",
152+
translations: {
153+
ru: "Гайды",
154+
ja: "ガイド",
155+
},
156+
items: [
157+
{
158+
label: "Examples",
159+
translations: {
160+
ru: "Примеры",
161+
ja: "例",
162+
},
163+
autogenerate: { directory: "docs/guides/examples" },
164+
},
165+
{
166+
label: "Migration",
167+
translations: {
168+
ru: "Миграция",
169+
ja: "移行",
170+
uz: "Migratsiya",
171+
},
172+
autogenerate: {
173+
directory: "docs/guides/migration",
174+
},
175+
},
176+
{
177+
label: "Tech",
178+
translations: {
179+
ru: "Технологии",
180+
ja: "技術",
181+
uz: "Texnologiya",
182+
},
183+
autogenerate: { directory: "docs/guides/tech" },
184+
},
185+
{
186+
label: "Code smells & Issues",
187+
translations: {
188+
ru: "Известные проблемы",
189+
ja: "コード臭いと問題",
190+
uz: "Muammolar",
191+
},
192+
autogenerate: { directory: "docs/guides/issues" },
193+
},
194+
],
195+
},
196+
{
197+
label: "Reference",
198+
translations: {
199+
ru: "Справочник",
200+
ja: "参考書",
201+
},
202+
autogenerate: { directory: "docs/reference" },
203+
},
204+
{
205+
label: "About",
206+
translations: {
207+
ru: "О нас",
208+
ja: "メソッドについて",
209+
},
210+
items: [
211+
{
212+
slug: "docs/about/mission",
213+
},
214+
{
215+
slug: "docs/about/motivation",
216+
},
217+
{
218+
slug: "docs/about/alternatives",
219+
},
220+
{
221+
label: "Understanding",
222+
translations: {
223+
ru: "Понимание",
224+
ja: "理解",
225+
},
226+
autogenerate: {
227+
directory: "docs/about/understanding",
228+
},
229+
collapsed: true,
230+
},
231+
{
232+
label: "Promote",
233+
translations: {
234+
ru: "Продвижение",
235+
ja: "プロモート",
236+
},
237+
autogenerate: { directory: "docs/about/promote" },
238+
collapsed: true,
239+
},
240+
],
241+
},
242+
],
243+
}),
244+
],
245+
});

package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"version": "2.1.0",
44
"private": true,
55
"scripts": {
6+
"dev": "astro dev",
7+
"linkcheck": "CHECK_LINKS=true pnpm build",
68
"docusaurus": "docusaurus",
79
"start": "docusaurus start",
810
"start:ru": "docusaurus start --locale ru",
@@ -12,7 +14,7 @@
1214
"start:ja": "docusaurus start --locale ja",
1315
"start:zh": "docusaurus start --locale zh",
1416
"start:vi": "docusaurus start --locale vi",
15-
"build": "docusaurus build",
17+
"build": "astro build",
1618
"swizzle": "docusaurus swizzle",
1719
"format": "prettier --cache --experimental-cli --write .",
1820
"test": "pnpm run test:lint && pnpm run build",
@@ -49,6 +51,7 @@
4951
"react-fast-marquee": "^1.6.5"
5052
},
5153
"devDependencies": {
54+
"@astrojs/starlight": "^0.37.4",
5255
"@babel/eslint-parser": "^7.28.4",
5356
"@docusaurus/module-type-aliases": "^3.9.1",
5457
"@docusaurus/theme-classic": "^3.9.1",
@@ -63,12 +66,18 @@
6366
"@types/react-dom": "^19.1.9",
6467
"@typescript-eslint/eslint-plugin": "^6.21.0",
6568
"@typescript-eslint/parser": "^6.21.0",
69+
"astro": "^5.16.16",
6670
"docusaurus-plugin-sass": "^0.2.6",
6771
"eslint": "^7.32.0",
6872
"eslint-config-prettier": "^9.1.2",
6973
"eslint-import-resolver-alias": "1.1.2",
7074
"prettier": "^3.6.2",
75+
"prettier-plugin-astro": "^0.14.1",
76+
"remark-heading-id": "^1.0.1",
7177
"sass": "^1.93.2",
78+
"sharp": "^0.34.5",
79+
"starlight-links-validator": "^0.19.2",
80+
"starlight-llms-txt": "^0.7.0",
7281
"stylelint": "^16.24.0",
7382
"stylelint-config-recess-order": "^5.1.1",
7483
"stylelint-config-recommended": "^14.0.1",

0 commit comments

Comments
 (0)