Skip to content

Commit 52b5236

Browse files
chore(deps): upgrade to Astro 7 and Starlight 0.41, migrate to starlight-sidebar-topics (#803)
1 parent e18d8a0 commit 52b5236

13 files changed

Lines changed: 1745 additions & 1830 deletions

File tree

astro.config.mjs

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineConfig } from 'astro/config';
22
import starlight from '@astrojs/starlight';
33
import sitemap from '@astrojs/sitemap';
4-
import starlightUtils from '@lorenzo_lewis/starlight-utils';
4+
import starlightSidebarTopics from 'starlight-sidebar-topics';
55
import starlightLinksValidator from 'starlight-links-validator';
66
import starlightHeadingBadges from 'starlight-heading-badges';
77
import starlightLlmsTxt from 'starlight-llms-txt';
@@ -36,7 +36,10 @@ if (process.env.VERCEL_ENV === 'production' && process.env.VERCEL_PROJECT_PRODUC
3636
// https://astro.build/config
3737
const config = defineConfig({
3838
site: site,
39-
trailingSlash: 'always',
39+
// 'ignore' works around an Astro 7 bug where 'always' breaks starlight-llms-txt's
40+
// extensioned `/_llms-txt/[slug].txt` route. Output is unchanged: the 'directory' build
41+
// format and Vercel (`trailingSlash: true`) keep URLs trailing-slashed regardless.
42+
trailingSlash: 'ignore',
4043
integrations: [
4144
starlight({
4245
title: 'Crowdin Docs',
@@ -47,33 +50,6 @@ const config = defineConfig({
4750
light: './src/assets/logo/dark.svg',
4851
dark: './src/assets/logo/light.svg',
4952
},
50-
sidebar: [
51-
{
52-
label: 'Crowdin Help',
53-
items: [...crowdinSidebar],
54-
},
55-
{
56-
label: 'Enterprise Help',
57-
items: [...enterpriseSidebar],
58-
},
59-
{
60-
label: 'Developer Portal',
61-
items: [...developerSidebar],
62-
},
63-
// Navigation links
64-
{
65-
label: "leading",
66-
items: [
67-
{ label: "Crowdin Help", slug: "introduction", attrs: { id: "crowdin-nav-button", class: "nav-link" } },
68-
{ label: "Enterprise Help", slug: "enterprise/introduction", attrs: { id: "enterprise-nav-button", class: "nav-link" } },
69-
{ label: "Developer Portal", slug: "developer/crowdin-apps-about", attrs: { id: "developer-nav-button", class: "nav-link" } },
70-
{ label: "Store", link: "https://store.crowdin.com", attrs: { target: "_blank", class: "nav-link" } },
71-
{ label: "Blog", link: "https://crowdin.com/blog", attrs: { target: "_blank", class: "nav-link" } },
72-
{ label: "Community", link: "https://community.crowdin.com/", attrs: { target: "_blank", class: "nav-link" } },
73-
{ label: "Crowdin.com", link: "https://crowdin.com/", attrs: { target: "_blank", class: "nav-link" } },
74-
],
75-
}
76-
],
7753
head: [
7854
// Custom consent mode https://www.cookieyes.com/documentation/implementing-google-consent-mode-using-cookieyes/
7955
{
@@ -136,6 +112,8 @@ const config = defineConfig({
136112
SocialIcons: './src/components/SocialIcons.astro',
137113
EditLink: './src/components/EditLink.astro',
138114
FallbackContentNotice: './src/components/FallbackContentNotice.astro',
115+
SiteTitle: './src/components/SiteTitle.astro',
116+
Sidebar: './src/components/Sidebar.astro',
139117
},
140118
customCss: [
141119
'./src/style/global.css',
@@ -148,14 +126,39 @@ const config = defineConfig({
148126
baseUrl: 'https://github.com/crowdin/docs/edit/main',
149127
},
150128
plugins: [
151-
starlightUtils({
152-
multiSidebar: {
153-
switcherStyle: "hidden",
129+
starlightSidebarTopics(
130+
[
131+
{
132+
label: 'hero.crowdinHelp',
133+
id: 'crowdin',
134+
link: '/introduction/',
135+
icon: 'open-book',
136+
items: [...crowdinSidebar],
137+
},
138+
{
139+
label: 'hero.enterpriseHelp',
140+
id: 'enterprise',
141+
link: '/enterprise/introduction/',
142+
icon: 'information',
143+
items: [...enterpriseSidebar],
144+
},
145+
{
146+
label: 'hero.developerPortal',
147+
id: 'developer',
148+
link: '/developer/crowdin-apps-about/',
149+
icon: 'puzzle',
150+
items: [...developerSidebar],
151+
},
152+
],
153+
{
154+
exclude: [
155+
'/ai-fine-tuning',
156+
'/enterprise/ai-fine-tuning',
157+
'/*/ai-fine-tuning',
158+
'/*/enterprise/ai-fine-tuning',
159+
],
154160
},
155-
navLinks: {
156-
leading: { useSidebarLabelled: "leading" },
157-
}
158-
}),
161+
),
159162
starlightLinksValidator({
160163
errorOnFallbackPages: false,
161164
errorOnInvalidHashes: false,
@@ -286,15 +289,15 @@ const config = defineConfig({
286289
targets: [
287290
{
288291
src: 'src/scripts',
289-
dest: 'src'
292+
dest: ''
290293
},
291294
{
292295
src: 'node_modules/redoc/bundles/redoc.standalone.js',
293-
dest: 'node_modules/redoc/bundles'
296+
dest: ''
294297
},
295298
{
296299
src: 'src/assets/api',
297-
dest: 'src/assets'
300+
dest: ''
298301
}
299302
]
300303
})

package.json

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,48 +20,48 @@
2020
"generate-llms-api": "node generate-llms-api.js"
2121
},
2222
"dependencies": {
23-
"@astrojs/check": "^0.9.6",
24-
"@astrojs/markdown-remark": "^6.3.10",
23+
"@astrojs/check": "^0.9.9",
24+
"@astrojs/markdown-remark": "^7.2.1",
2525
"@astrojs/sitemap": "^3.7.3",
26-
"@astrojs/starlight": "^0.37.6",
27-
"@astrojs/starlight-tailwind": "^4.0.2",
28-
"@expressive-code/plugin-collapsible-sections": "^0.41.7",
26+
"@astrojs/starlight": "^0.41.3",
27+
"@astrojs/starlight-tailwind": "^5.0.0",
28+
"@expressive-code/plugin-collapsible-sections": "^0.44.0",
2929
"@fontsource-variable/noto-sans": "^5.2.10",
3030
"@fontsource-variable/plus-jakarta-sans": "^5.2.8",
31-
"@iconify-json/garden": "^1.2.4",
31+
"@iconify-json/garden": "^1.2.6",
3232
"@iconify-json/heroicons": "^1.2.3",
33-
"@iconify-json/material-symbols": "^1.2.58",
33+
"@iconify-json/material-symbols": "^1.2.80",
3434
"@iconify-json/mdi": "^1.2.3",
35-
"@lorenzo_lewis/starlight-utils": "^0.3.2",
36-
"@tailwindcss/vite": "^4.2.1",
37-
"astro": "^5.18.1",
38-
"astro-embed": "^0.12.0",
35+
"@tailwindcss/vite": "^4.3.2",
36+
"astro": "^7.0.6",
37+
"astro-embed": "^0.13.1",
3938
"astro-icon": "^1.1.5",
40-
"astro-og-canvas": "^0.10.1",
41-
"canvaskit-wasm": "^0.40.0",
39+
"astro-og-canvas": "^0.13.0",
40+
"canvaskit-wasm": "^0.41.1",
4241
"github-slugger": "^2.0.0",
4342
"redoc": "2.5.2",
4443
"rehype-autolink-headings": "^7.1.0",
4544
"rehype-external-links": "^3.0.0",
4645
"remark-custom-heading-id": "^2.0.0",
47-
"sharp": "^0.34.5",
48-
"starlight-heading-badges": "^0.6.1",
49-
"starlight-links-validator": "^0.19.2",
50-
"starlight-llms-txt": "^0.7.0",
51-
"tailwindcss": "^4.2.1",
52-
"typescript": "^5.9.3",
46+
"sharp": "^0.35.3",
47+
"starlight-heading-badges": "^0.8.0",
48+
"starlight-links-validator": "^0.25.2",
49+
"starlight-llms-txt": "^0.11.0",
50+
"starlight-sidebar-topics": "^0.8.0",
51+
"tailwindcss": "^4.3.2",
52+
"typescript": "^6.0.3",
5353
"unist-util-visit": "^5.1.0"
5454
},
5555
"devDependencies": {
5656
"@apidevtools/swagger-parser": "^12.1.0",
5757
"@types/mdast": "^4.0.4",
58-
"sass": "^1.97.3",
58+
"sass": "^1.101.0",
5959
"vfile": "^6.0.3",
60-
"vite-plugin-static-copy": "^3.2.0",
61-
"vitest": "^4.1.8"
60+
"vite-plugin-static-copy": "^4.1.1",
61+
"vitest": "^4.1.10"
6262
},
6363
"engines": {
64-
"node": ">=22"
64+
"node": ">=22.12.0"
6565
},
66-
"packageManager": "pnpm@11.8.0"
66+
"packageManager": "pnpm@11.10.0"
6767
}

0 commit comments

Comments
 (0)