Skip to content

Commit eaee96b

Browse files
feat: migrate the entire project to Starlight
1 parent c527e3c commit eaee96b

File tree

129 files changed

+4456
-12274
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

+4456
-12274
lines changed

README.md

Lines changed: 6 additions & 1 deletion
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 |
@@ -73,3 +76,5 @@ Content (including images) released under [CC BY-NC-SA 4.0](https://creativecomm
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

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

0 commit comments

Comments
 (0)