Skip to content

Commit 4803698

Browse files
authored
Merge branch 'main' into hashnode
2 parents 2cfdad1 + 370962f commit 4803698

File tree

155 files changed

+5013
-656
lines changed

Some content is hidden

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

155 files changed

+5013
-656
lines changed

config/sidebar.ts

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,30 @@ type StarlightSidebarConfig = NonNullable<Parameters<typeof starlight>[0]['sideb
2222

2323
/** Generate a Starlight sidebar config object from our existing `nav.ts` files. */
2424
export function makeSidebar(): StarlightSidebarConfig {
25+
let currentSubGroup: Extract<StarlightSidebarConfig[number], { items: any }>;
2526
return navTranslations.en.reduce((sidebar, item) => {
2627
if ('header' in item) {
27-
sidebar.push({
28+
const newGroup = {
2829
label: item.text,
2930
translations: getTranslations(item),
3031
items: [],
31-
});
32-
} else {
33-
const group = sidebar.at(-1);
34-
if (group && 'items' in group) {
35-
group.items.push({
36-
label: item.text,
37-
link: item.slug,
38-
translations: getTranslations(item),
39-
});
32+
collapsed: item.collapsed,
33+
};
34+
if (item.nested) {
35+
const parentGroup = sidebar.at(-1);
36+
if (parentGroup && 'items' in parentGroup) {
37+
parentGroup.items.push(newGroup);
38+
}
39+
} else {
40+
sidebar.push(newGroup);
4041
}
42+
currentSubGroup = newGroup;
43+
} else {
44+
currentSubGroup.items.push({
45+
label: item.text,
46+
link: item.slug,
47+
translations: getTranslations(item),
48+
});
4149
}
4250
return sidebar;
4351
}, [] as StarlightSidebarConfig);

src/content/docs/en/editor-setup.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Editor Setup
33
description: Set up your editor to build with Astro.
44
i18nReady: true
55
---
6+
67
import Badge from '~/components/Badge.astro';
78
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'
89

@@ -24,11 +25,14 @@ import ReadMore from '~/components/ReadMore.astro';
2425

2526
<ReadMore>See how to [set up TypeScript](/en/guides/typescript/) in your Astro project.</ReadMore>
2627

28+
## Zed
29+
30+
[Zed](https://zed.dev/) is an open-source code editor that added support for Astro in version 0.123.2. You can install the [Astro extension](https://github.com/zed-industries/zed/tree/main/extensions/astro) in the IDE's Extensions tab. This extension includes features like syntax highlighting, code completion, and formatting.
31+
2732
## JetBrains IDEs
2833

2934
Initial support for Astro landed in WebStorm 2023.1. You can install the official plugin through [JetBrains Marketplace](https://plugins.jetbrains.com/plugin/20959-astro) or by searching for "Astro" in the IDE's Plugins tab. This plugin includes features like syntax highlighting, code completion, and formatting, and plans to add even more advanced features in the future. It is also available to all other [JetBrains IDEs with JavaScript support](https://www.jetbrains.com/products/#lang=js&type=ide).
3035

31-
3236
## Other Code Editors
3337

3438
Our amazing community maintains several extensions for other popular editors, including:
@@ -58,7 +62,7 @@ See [the project's User Guide](https://ota-meshi.github.io/eslint-plugin-astro/u
5862

5963
### Stylelint
6064

61-
[Stylelint](https://stylelint.io/) is a popular linter for CSS. [A community maintained Stylelint configuration](https://github.com/ota-meshi/stylelint-config-html) provides Astro support.
65+
[Stylelint](https://stylelint.io/) is a popular linter for CSS. [A community maintained Stylelint configuration](https://github.com/ota-meshi/stylelint-config-html) provides Astro support.
6266

6367
Installation instructions, editor integration, and additional information can be found in the project's README.
6468

src/content/docs/en/getting-started.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ editUrl: false
77
next: false
88
banner:
99
content: |
10-
<a href="https://astro.build/blog/astro-4/">Astro version 4.0 is here!</a>
11-
Are you ready to upgrade? <a href="/en/guides/upgrade-to/v4/">Read our upgrade guide</a>.
10+
Join us and 100+ Astro developers at <a href="https://lu.ma/astro-together-meetup-2024/">Astro Together</a> in Montreal on May 28th!
1211
hero:
1312
title: Astro Docs
1413
tagline: Guides, resources, and API references to help you build with Astro.
1514
actions:
16-
- text: Get started
15+
- text: Install Astro
1716
icon: rocket
1817
link: /en/install/auto/
1918
variant: primary

src/content/docs/en/guides/cms/apostrophecms.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ In this section, you will use the [Apostrophe integration](https://apostrophecms
1919

2020
To get started, you will need to have the following:
2121

22-
1. **An on-demand rendered Astro project** with the [Node.js adapter](https://docs.astro.build/en/guides/integrations-guide/node/) installed and `output: 'server'` configured - If you don't have an Astro project yet, our [installation guide](/en/install/auto/) will get you up and running in no time.
22+
1. **An on-demand rendered Astro project** with the [Node.js adapter](/en/guides/integrations-guide/node/) installed and `output: 'server'` configured - If you don't have an Astro project yet, our [installation guide](/en/install/auto/) will get you up and running in no time.
2323

2424
2. **An ApostropheCMS project with a configured environment variable called `APOS_EXTERNAL_FRONT_KEY`** - This environment variable can be set to any random string. If you don't have an ApostropheCMS project yet, the [installation guide](https://docs.apostrophecms.org/guide/development-setup.html) will get one setup quickly. We highly recommend using the [Apostrophe CLI tool](https://apostrophecms.com/extensions/apos-cli) to facilitate this.
2525

@@ -45,7 +45,7 @@ Your root directory should now include this new file:
4545

4646
### Installing dependencies
4747

48-
To connect Astro with your ApostropheCMS project, install the official Apostrophe integration in your Astro project using the command below for your prefered package manager.
48+
To connect Astro with your ApostropheCMS project, install the official Apostrophe integration in your Astro project using the command below for your preferred package manager.
4949
<PackageManagerTabs>
5050
<Fragment slot="npm">
5151
```shell
@@ -460,4 +460,4 @@ For the ApostropheCMS project, follow the instructions for your hosting type in
460460
## Community Resources
461461
- [Integrating ApostropheCMS with Astro, Pt. 1](https://apostrophecms.com/blog/how-to-integrate-astro-with-apostrophecms-pt-1) by Antonello Zaini
462462
- [Integrating ApostropheCMS with Astro, Pt. 2](https://apostrophecms.com/blog/how-to-integrate-astro-with-apostrophecms-pt-2) by Antonello Zaini
463-
- [Show & Tell Live | Astro & Apostrophe](https://youtu.be/cwJhtJhAhwA?si=6iUU9EjidfdnOdCh)
463+
- [Show & Tell Live | Astro & Apostrophe](https://youtu.be/cwJhtJhAhwA?si=6iUU9EjidfdnOdCh)

src/content/docs/en/guides/cms/builderio.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ const { results: posts } = await fetch(
219219
<body>
220220
<ul>
221221
{
222-
posts.map(({ data: { slug, title } }) => (
222+
posts.flatMap(({ data: { slug, title } }) => (
223223
<li>
224224
<a href={`/posts/${slug}`}>{title}</a>
225225
</li>
@@ -318,7 +318,7 @@ const { html: postHTML } = await fetch(
318318
<article>
319319
<Fragment set:html={postHTML} />
320320
</article>
321-
<footer>The is your footer</footer>
321+
<footer>This is your footer</footer>
322322
</body>
323323
</html>
324324
```

src/content/docs/en/guides/cms/umbraco.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ In this section you will use Umbraco's native [Content Delivery API](https://doc
2020

2121
To get started, you will need to have the following:
2222

23-
1. **An Astro project** - If you don’t have an Astro project yet, our [Installation guide](https://docs.astro.build/en/install/auto/) will get you up and running in no time.
23+
1. **An Astro project** - If you don’t have an Astro project yet, our [Installation guide](/en/install/auto/) will get you up and running in no time.
2424
2. **An Umbraco (v12+) project** - If you don’t have an Umbraco project yet, please see this [Installation guide](https://docs.umbraco.com/umbraco-cms/fundamentals/setup/install/).
2525

2626
### Setting up the Content Delivery API
@@ -64,7 +64,7 @@ const articles = await res.json();
6464
```
6565

6666

67-
<ReadMore>Read more about [data fetching in Astro](https://docs.astro.build/en/guides/data-fetching/).</ReadMore>
67+
<ReadMore>Read more about [data fetching in Astro](/en/guides/data-fetching/).</ReadMore>
6868

6969
## Building a blog with Umbraco and Astro
7070

@@ -150,7 +150,7 @@ const articles = await res.json();
150150

151151
### Generating individual blog posts
152152

153-
Create the file `[...slug].astro` at the root of the `/pages/` directory. This file will be used to [generate the individual blog pages dynamically](https://docs.astro.build/en/guides/routing/#dynamic-routes).
153+
Create the file `[...slug].astro` at the root of the `/pages/` directory. This file will be used to [generate the individual blog pages dynamically](/en/guides/routing/#dynamic-routes).
154154

155155
Note that the `params` property, which generates the URL path of the page, contains `article.route.path` from the API fetch. Similarly, the `props` property must include the entire `article` itself so that you can access all the information in your CMS entry.
156156

@@ -196,7 +196,7 @@ With the dev server running, you should now be able to view your Umbraco-created
196196

197197
## Publishing your site
198198

199-
To deploy your site visit our [deployment guides](https://docs.astro.build/en/guides/deploy/) and follow the instructions for your preferred hosting provider.
199+
To deploy your site visit our [deployment guides](/en/guides/deploy/) and follow the instructions for your preferred hosting provider.
200200

201201
## Local dev, HTTPS and self-signed SSL certificates
202202

src/content/docs/en/guides/data-fetching.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ i18nReady: true
88

99
## `fetch()` in Astro
1010

11-
All [Astro components](/en/basics/astro-components/) have access to the [global `fetch()` function](https://developer.mozilla.org/en-US/docs/Web/API/fetch) in their component script to make HTTP requests to APIs using the full URL (e.g. https://example.com/api or `Astro.url + "/api"`).
11+
All [Astro components](/en/basics/astro-components/) have access to the [global `fetch()` function](https://developer.mozilla.org/en-US/docs/Web/API/fetch) in their component script to make HTTP requests to APIs using the full URL (e.g. https://example.com/api).
12+
Additionally, you can construct a URL to your project's pages and endpoints that are rendered on demand on the server using `new URL("/api", Astro.url)`.
1213

1314
This fetch call will be executed at build time, and the data will be available to the component template for generating dynamic HTML. If [SSR](/en/guides/server-side-rendering/) mode is enabled, any fetch calls will be executed at runtime.
1415

src/content/docs/en/guides/deploy/netlify.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ You can also create a new site on Netlify and link up your Git repository by ins
133133

134134
### Set a Node.js Version
135135

136-
If you are using a legacy [build image](https://docs.netlify.com/configure-builds/get-started/#build-image-selection) (Xenial) on Netlify, make sure that your Node.js version is set. Astro requires `v18.14.1` or higher.
136+
If you are using a legacy [build image](https://docs.netlify.com/configure-builds/get-started/#build-image-selection) (Xenial) on Netlify, make sure that your Node.js version is set. Astro requires `v18.17.1` or `v20.3.0` or higher.
137137

138138
You can [specify your Node.js version in Netlify](https://docs.netlify.com/configure-builds/manage-dependencies/#node-js-and-javascript) using:
139139
- a [`.nvmrc`](https://github.com/nvm-sh/nvm#nvmrc) file in your base directory.

src/content/docs/en/guides/deploy/render.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ You can deploy your Astro project to [Render](https://render.com/), a service to
2020
4. Give your website a name, select the branch and specify the build command and publish directory
2121
- **build command:** `npm run build`
2222
- **publish directory:** `dist`
23-
- **Environment variables (advanced)**: By default, Render uses Node.js 14.17.0, but Astro [requires a higher version](/en/install/auto/#prerequisites). Add an environment variable with a **Variable key** of `NODE_VERSION` and a **Value** of `18.14.1` or higher to tell Render to use a compatible Node.js version. Alternatively, add a [`.node-version`](https://render.com/docs/node-version) or [`.nvmrc`](https://render.com/docs/node-version) file to your project to specify a Node.js version.
23+
- **Environment variables (advanced)**: By default, Render uses Node.js 14.17.0, but Astro [requires a higher version](/en/install/auto/#prerequisites). Add an environment variable with a **Variable key** of `NODE_VERSION` and a **Value** of `v18.17.1` or `v20.3.0` or higher to tell Render to use a compatible Node.js version. Alternatively, add a [`.node-version`](https://render.com/docs/node-version) or [`.nvmrc`](https://render.com/docs/node-version) file to your project to specify a Node.js version.
2424

2525
5. Click the **Create Static Site** button
2626
</Steps>

src/content/docs/en/guides/deploy/vercel.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,3 @@ After your project has been imported and deployed, all subsequent pushes to bran
9393
You can use `vercel.json` to override the default behavior of Vercel and to configure additional settings. For example, you may wish to attach headers to HTTP responses from your Deployments.
9494

9595
<ReadMore>Learn more about [Vercel’s project configuration](https://vercel.com/docs/project-configuration).</ReadMore>
96-
97-
### Upgrading to Astro 2.0
98-
99-
Astro v2.0 drops support for Node 14, so make sure your project is using **Node `18.14.1` or later**. You can [define the Node.js version](https://vercel.com/changelog/node-js-version-now-customizable-in-the-project-settings) used during the Build Step and Serverless Functions from the General page under Project Settings.

0 commit comments

Comments
 (0)