Skip to content

Commit e75cd7a

Browse files
authored
Merge branch 'v6' into i18n/ja/tutorial-5-astro-api-1
2 parents 98997e2 + 50394ca commit e75cd7a

28 files changed

Lines changed: 576 additions & 1161 deletions

astro.sidebar.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,7 @@ export const sidebar = [
147147
'reference/experimental-flags/live-content-collections',
148148
'reference/experimental-flags/client-prerender',
149149
'reference/experimental-flags/content-intellisense',
150-
'reference/experimental-flags/preserve-scripts-order',
151150
'reference/experimental-flags/heading-id-compat',
152-
'reference/experimental-flags/static-import-meta-env',
153151
'reference/experimental-flags/chrome-devtools-workspace',
154152
],
155153
}),

src/content/docs/en/guides/actions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ Actions are accessible as public endpoints based on the name of the action. For
656656

657657
To authorize action requests, add an authentication check to your action handler. You may want to use [an authentication library](/en/guides/authentication/) to handle session management and user information.
658658

659-
Actions expose the full `APIContext` object to access properties passed from middleware using `context.locals`. When a user is not authorized, you can raise an `ActionError` with the `UNAUTHORIZED` code:
659+
Actions expose the `ActionAPIContext` object, a subset of `APIContext`, to access properties passed from middleware using `context.locals`. When a user is not authorized, you can raise an `ActionError` with the `UNAUTHORIZED` code:
660660

661661
```ts title="src/actions/index.ts" {6-8}
662662
import { defineAction, ActionError } from 'astro:actions';

src/content/docs/en/guides/endpoints.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ import type { APIRoute } from "astro";
4747
export const GET: APIRoute = async ({ params, request }) => {...}
4848
```
4949

50+
Note that endpoints whose URLs include a file extension (e.g. `src/pages/sitemap.xml.ts`) can only be accessed without a trailing slash (e.g. `/sitemap.xml`), regardless of your [`build.trailingSlash`](/en/reference/configuration-reference/#trailingslash) configuration.
51+
5052
### `params` and Dynamic routing
5153

5254
Endpoints support the same [dynamic routing](/en/guides/routing/#dynamic-routes) features that pages do. Name your file with a bracketed parameter name and export a [`getStaticPaths()` function](/en/reference/routing-reference/#getstaticpaths). Then, you can access the parameter using the `params` property passed to the endpoint function:

src/content/docs/en/guides/environment-variables.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ Astro includes a few environment variables out of the box:
5858
- `import.meta.env.DEV`: `true` if your site is running in development; `false` otherwise. Always the opposite of `import.meta.env.PROD`.
5959
- `import.meta.env.BASE_URL`: The base URL your site is being served from. This is determined by the [`base` config option](/en/reference/configuration-reference/#base).
6060
- `import.meta.env.SITE`: This is set to [the `site` option](/en/reference/configuration-reference/#site) specified in your project's `astro.config`.
61-
- `import.meta.env.ASSETS_PREFIX`: The prefix for Astro-generated asset links if the [`build.assetsPrefix` config option](/en/reference/configuration-reference/#buildassetsprefix) is set. This can be used to create asset links not handled by Astro.
6261

6362
Use them like any other environment variable.
6463

src/content/docs/en/guides/upgrade-to/v5.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ function useRoute(route: IntegrationRouteData) {
11121112
}
11131113
```
11141114
1115-
<ReadMore>See the [API reference for `IntegrationRouteData`](/en/reference/integrations-reference/#integrationroutedata-type-reference).</ReadMore>
1115+
<ReadMore>See the API reference for `IntegrationRouteData`.</ReadMore>
11161116
11171117
### Changed: `distURL` is now an array (Integrations API)
11181118
@@ -1139,7 +1139,7 @@ if (route.distURL) {
11391139
}
11401140
```
11411141
1142-
<ReadMore>See the [API reference for `IntegrationRouteData`](/en/reference/integrations-reference/#integrationroutedata-type-reference).</ReadMore>
1142+
<ReadMore>See the [API reference for `IntegrationRouteData`.</ReadMore>
11431143
11441144
### Changed: Arguments passed to `app.render()` (Adapter API)
11451145

0 commit comments

Comments
 (0)