Skip to content

Commit 3ae1832

Browse files
feat: migrate the entire project to Starlight (#788)
1 parent 57b334e commit 3ae1832

File tree

129 files changed

+4630
-12334
lines changed

Some content is hidden

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

129 files changed

+4630
-12334
lines changed

README.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ All commands are run from the root of the project, from a terminal:
3636
| Command | Action |
3737
| :------------------------ | :----------------------------------------------- |
3838
| `npm install` | Installs dependencies |
39-
| `npm run dev` | Run the development server |
39+
| `npm run dev` | Run the development server at `localhost:4321` |
40+
| `npm run build` | Build your production site |
41+
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
42+
| `npm run astro -- --help` | Get help using the Astro CLI |
4043
| `npm run vercel` | Run in the same conditions as Vercel |
4144
| `npm run update:showcase` | Run the showcase script to gather links from https://github.com/orgs/Open-reSource/discussions/3 |
4245
| `npm run test` | Run the tests |
@@ -68,8 +71,10 @@ Code released under the [MIT License](https://github.com/Open-reSource/openresou
6871

6972
Content (including images) released under [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/):
7073
* `public/images/` directory
71-
* `src/content/articles` and `src/content/modules` directories
74+
* `src/content/docs` directory
7275

7376
## Thanks
7477

7578
[![Built with Astro](https://astro.badg.es/v2/built-with-astro/small.svg)](https://astro.build)
79+
80+
[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/small.svg)](https://starlight.astro.build)

astro.config.mjs

+273-62
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,285 @@
1-
import { defineConfig } from 'astro/config';
2-
import tailwind from "@astrojs/tailwind";
3-
import vercel from '@astrojs/vercel/serverless';
4-
import sitemap from "@astrojs/sitemap";
5-
import mdx from "@astrojs/mdx";
6-
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
7-
import { rehypeHeadingIds } from '@astrojs/markdown-remark';
8-
import { h } from 'hastscript';
9-
10-
const AnchorLinkIcon = h(
11-
'span',
12-
{ ariaHidden: 'true', class: 'anchor-icon grid items-center' },
13-
h(
14-
'svg',
15-
{
16-
width: 16,
17-
height: 16,
18-
viewBox: '0 0 16 16',
19-
xlmns: 'http://www.w3.org/2000/svg',
20-
fill: 'currentcolor',
21-
},
22-
h('path', {
23-
d: 'M6.354 5.5H4a3 3 0 0 0 0 6h3a3 3 0 0 0 2.83-4H9c-.086 0-.17.01-.25.031A2 2 0 0 1 7 10.5H4a2 2 0 1 1 0-4h1.535c.218-.376.495-.714.82-1z',
24-
}),
25-
h('path', {
26-
d: 'M9 5.5a3 3 0 0 0-2.83 4h1.098A2 2 0 0 1 9 6.5h3a2 2 0 1 1 0 4h-1.535a4.02 4.02 0 0 1-.82 1H12a3 3 0 1 0 0-6H9z',
27-
})
28-
)
29-
);
1+
import { defineConfig } from "astro/config";
2+
import starlight from "@astrojs/starlight";
3+
import vercel from "@astrojs/vercel/serverless";
4+
import starlightBlog from "starlight-blog";
5+
import starlightLinksValidator from "starlight-links-validator";
306

317
// https://astro.build/config
328
export default defineConfig({
33-
integrations: [
34-
tailwind(),
35-
sitemap(),
36-
mdx({
37-
optimize: true,
38-
})
39-
],
409
output: "server",
4110
adapter: vercel({
4211
webAnalytics: {
43-
enabled: true
44-
}
12+
enabled: true,
13+
},
4514
}),
46-
site: 'https://openresource.dev',
47-
// used for sitemap
15+
site: "https://openresource.dev",
4816
vite: {
4917
define: {
50-
'import.meta.env.PUBLIC_VERCEL_ANALYTICS_ID': JSON.stringify(process.env.VERCEL_ANALYTICS_ID)
51-
}
18+
"import.meta.env.PUBLIC_VERCEL_ANALYTICS_ID": JSON.stringify(
19+
process.env.VERCEL_ANALYTICS_ID
20+
),
21+
},
22+
},
23+
redirects: {
24+
'/books': '/resources/books',
25+
'/events': '/resources/events',
26+
'/open-sourcerers': '/resources/open-sourcerers',
27+
'/podcasts': '/resources/podcasts',
5228
},
53-
markdown: {
54-
rehypePlugins: [
55-
rehypeHeadingIds,
56-
[
57-
rehypeAutolinkHeadings,
29+
integrations: [
30+
starlight({
31+
components: {
32+
Footer: "./src/components/Footer.astro",
33+
Head: "./src/components/Head.astro",
34+
PageTitle: "./src/components/PageTitleThenReadingTime.astro",
35+
Pagination: "./src/components/SupportThenPagination.astro",
36+
Header: "./src/components/Header.astro",
37+
},
38+
plugins: [
39+
starlightLinksValidator({
40+
exclude: ["/articles"],
41+
}),
42+
starlightBlog({
43+
title: "Articles",
44+
prefix: "articles",
45+
authors: {
46+
julien: {
47+
name: "Julien Déramond",
48+
title: "Open {re}Source • Bootstrap • Orange",
49+
picture: "https://avatars.githubusercontent.com/u/17381666?s=200",
50+
url: "https://github.com/julien-deramond/",
51+
},
52+
},
53+
}),
54+
],
55+
title: "Open {re}Source",
56+
favicon: "./favicon.ico",
57+
logo: {
58+
light: "./src/assets/logo.svg",
59+
dark: "./src/assets/logo-dark.svg",
60+
replacesTitle: true,
61+
},
62+
editLink: {
63+
baseUrl: "https://github.com/Open-reSource/openresource.dev/edit/main/",
64+
},
65+
social: {
66+
github: "https://github.com/Open-reSource/openresource.dev",
67+
discord: "https://discord.gg/fpUDwEMGwE",
68+
"x.com": "https://x.com/open_resource",
69+
linkedin: "https://linkedin.com/company/open-re-source/",
70+
mastodon: "https://fosstodon.org/@openresource",
71+
blueSky: "https://bsky.app/profile/openresource.bsky.social",
72+
threads: "https://www.threads.net/@openresource",
73+
},
74+
customCss: ["./src/styles/custom.css"],
75+
defaultLocale: "root",
76+
locales: {
77+
root: {
78+
label: "English",
79+
lang: "en",
80+
},
81+
},
82+
sidebar: [
5883
{
59-
properties: { class: 'anchor-link' },
60-
behavior: 'after',
61-
group: () => h('div', { tabIndex: -1, class: "heading-wrapper" }),
62-
content: (heading) => [
63-
AnchorLinkIcon,
64-
h(
65-
'span',
66-
{ 'is:raw': true, class: 'sr-only' },
67-
heading?.children[0]?.value
68-
)
84+
label: "Guide",
85+
items: [
86+
{
87+
label: "Introduction",
88+
slug: "guide",
89+
},
90+
{
91+
label: "What Is Open Source?",
92+
collapsed: false,
93+
items: [
94+
{
95+
label: "Introduction",
96+
slug: "guide/what-is-open-source",
97+
},
98+
{
99+
slug: "guide/what-is-open-source/definition-of-open-source",
100+
},
101+
{
102+
slug: "guide/what-is-open-source/brief-history-of-open-source",
103+
},
104+
{
105+
slug: "guide/what-is-open-source/the-significance-of-open-source",
106+
},
107+
{
108+
slug: "guide/what-is-open-source/examples-of-successful-open-source-projects",
109+
},
110+
{
111+
slug: "guide/what-is-open-source/types-of-open-source-projects",
112+
},
113+
{
114+
slug: "guide/what-is-open-source/types-of-open-source-software-projects",
115+
},
116+
{
117+
slug: "guide/what-is-open-source/benefits-of-open-source",
118+
},
119+
],
120+
},
121+
{
122+
label: "Getting Started",
123+
collapsed: true,
124+
items: [
125+
{
126+
label: "Introduction",
127+
slug: "guide/getting-started-with-open-source",
128+
},
129+
{
130+
slug: "guide/getting-started-with-open-source/source-code-hosting-platforms",
131+
},
132+
{
133+
slug: "guide/getting-started-with-open-source/finding-open-source-projects",
134+
},
135+
],
136+
},
137+
{
138+
label: "Contributing",
139+
collapsed: true,
140+
items: [
141+
{
142+
label: "Introduction",
143+
slug: "guide/contributing-to-open-source-projects",
144+
},
145+
{
146+
slug: "guide/contributing-to-open-source-projects/finding-open-source-projects",
147+
},
148+
{
149+
slug: "guide/contributing-to-open-source-projects/contributing-to-open-source",
150+
},
151+
{
152+
slug: "guide/contributing-to-open-source-projects/getting-involved-in-the-open-source-community",
153+
},
154+
{
155+
slug: "guide/contributing-to-open-source-projects/building-a-portfolio-with-open-source-contributions",
156+
},
157+
{
158+
slug: "guide/contributing-to-open-source-projects/overcoming-challenges-in-open-source-contributions",
159+
},
160+
],
161+
},
162+
{
163+
label: "Creating",
164+
collapsed: true,
165+
items: [
166+
{
167+
label: "Introduction",
168+
slug: "guide/creating-your-own-open-source-project",
169+
},
170+
{
171+
slug: "guide/creating-your-own-open-source-project/choosing-a-project-idea",
172+
},
173+
{
174+
slug: "guide/creating-your-own-open-source-project/planning-your-project",
175+
},
176+
{
177+
slug: "guide/creating-your-own-open-source-project/creating-your-project",
178+
},
179+
{
180+
slug: "guide/creating-your-own-open-source-project/legal-considerations",
181+
},
182+
{
183+
slug: "guide/creating-your-own-open-source-project/developing-your-project",
184+
},
185+
{
186+
slug: "guide/creating-your-own-open-source-project/building-and-engaging-your-community",
187+
},
188+
{
189+
slug: "guide/creating-your-own-open-source-project/contributing-your-project-to-the-open-source-community",
190+
badge: "Coming soon",
191+
},
192+
],
193+
},
194+
{
195+
label: "Maintaining",
196+
collapsed: true,
197+
items: [
198+
{
199+
label: "Introduction",
200+
slug: "guide/maintaining-open-source-projects",
201+
},
202+
{
203+
slug: "guide/maintaining-open-source-projects/introduction-to-open-source-project-maintenance",
204+
},
205+
{
206+
slug: "guide/maintaining-open-source-projects/managing-contributions-and-community-engagement",
207+
badge: "Coming soon",
208+
},
209+
{
210+
slug: "guide/maintaining-open-source-projects/managing-project-dependencies",
211+
badge: "Coming soon",
212+
},
213+
{
214+
slug: "guide/maintaining-open-source-projects/fostering-a-strong-and-inclusive-community",
215+
},
216+
{
217+
slug: "guide/maintaining-open-source-projects/ensuring-project-sustainability",
218+
badge: "Coming soon",
219+
},
220+
],
221+
},
222+
{
223+
label: "Promoting",
224+
collapsed: true,
225+
items: [
226+
{
227+
label: "Introduction",
228+
slug: "guide/promoting-open-source-projects",
229+
},
230+
{
231+
slug: "guide/promoting-open-source-projects/introduction-to-project-promotion",
232+
},
233+
{
234+
slug: "guide/promoting-open-source-projects/building-a-strong-project-identity",
235+
},
236+
{
237+
slug: "guide/promoting-open-source-projects/crafting-an-engaging-project-website",
238+
},
239+
],
240+
},
241+
{
242+
label: "Financing",
243+
collapsed: true,
244+
items: [
245+
{
246+
label: "Introduction",
247+
slug: "guide/financing-open-source-projects",
248+
},
249+
{
250+
slug: "guide/financing-open-source-projects/importance-and-challenges-of-financing-open-source-projects",
251+
},
252+
{
253+
slug: "guide/financing-open-source-projects/understanding-funding-models",
254+
},
255+
{
256+
slug: "guide/financing-open-source-projects/effective-fundraising-strategies",
257+
},
258+
{
259+
slug: "guide/financing-open-source-projects/resource-allocation-and-budgeting",
260+
badge: "Coming soon",
261+
},
262+
{
263+
slug: "guide/financing-open-source-projects/fostering-a-sustainable-ecosystem",
264+
badge: "Coming soon",
265+
},
266+
{
267+
slug: "guide/financing-open-source-projects/transparency-accountability-and-community-involvement",
268+
badge: "Coming soon",
269+
},
270+
],
271+
},
69272
],
70-
}
71-
]
72-
]
73-
}
74-
});
273+
},
274+
{
275+
label: "Resources",
276+
autogenerate: { directory: "resources" },
277+
},
278+
{
279+
label: "Articles",
280+
link: "/articles",
281+
},
282+
],
283+
}),
284+
],
285+
});

0 commit comments

Comments
 (0)