Skip to content

Commit a0e975c

Browse files
Merge branch 'main' into patch-6
2 parents c8647dd + e521693 commit a0e975c

File tree

15 files changed

+1194
-441
lines changed

15 files changed

+1194
-441
lines changed

src/components/Checklist.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ const { key = 'default' } = Astro.props as Props;
133133
upgradeSubList(ul: Element | null, type: SubListType) {
134134
if (!ul) return;
135135
const items = Array.from(ul.children);
136-
ProgressStore.initaliseSubList(this.key, type, items.length);
136+
ProgressStore.initialiseSubList(this.key, type, items.length);
137137
items.forEach((li, index) => this.upgradeTaskItem(li, type, index));
138138
}
139139

src/components/tutorial/ProgressStore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export class ProgressStore {
125125
ProgressStore.pageState.lists[listKey] = { primary: [], secondary: [] };
126126
}
127127

128-
public static initaliseSubList(listKey: string, type: SubListType, length: number): void {
128+
public static initialiseSubList(listKey: string, type: SubListType, length: number): void {
129129
if (ProgressStore.pageState.lists[listKey][type].length === length) return;
130130
ProgressStore.pageState.lists[listKey][type] = Array.from({ length }, () => false);
131131
ProgressStore.store();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Parameters can be included in separate parts of the path. For example, the file
8888

8989
#### Decoding `params`
9090

91-
The `params` provided to the function `getStaticPaths()` function are not decoded. Use the function [`decodeURI`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI) when you need to decode parameter values.
91+
`params` returned by a `getStaticPaths()` function are not decoded. Use [`decodeURI()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI) when you need to decode parameter values.
9292

9393
```astro title="src/pages/[slug].astro"
9494
---

src/content/docs/en/reference/adapter-reference.mdx

Lines changed: 45 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export default function createIntegration() {
166166
**Type:** `URLSearchParams`
167167
</p>
168168

169-
Define the query parameters to append to all asset URLs (e.g. images, stylesheets, scripts, etc.). This is useful for adapters that need to track deployment versions or other metadata.
169+
Defines the query parameters to append to all asset URLs (e.g. images, stylesheets, scripts). This is useful for adapters that need to track deployment versions or other metadata.
170170

171171
The following example retrieves a `DEPLOY_ID` from the environment variables and, if provided, returns an object with a custom search parameter name as key and the deploy id as value:
172172

@@ -257,7 +257,7 @@ You will need to create a file that executes during server-side requests to enab
257257
Type: `(manifest: SSRManifest, options: any) => Record<string, any>`
258258
</p>
259259

260-
An exported function that takes an SSR manifest as its first argument and an object containing your adapter [args](#args) as its second argument. This should provide the exports required by your host.
260+
An exported function that takes an SSR manifest as its first argument and an object containing your adapter [`args`](#args) as its second argument. This should provide the exports required by your host.
261261

262262
For example, some serverless hosts expect you to export an `handler()` function. With the adapter API, you achieve this by implementing `createExports()` in your server entrypoint:
263263

@@ -317,9 +317,9 @@ export function createExports(manifest, args) {
317317
Type: `(manifest: SSRManifest, options: any) => Record<string, any>`
318318
</p>
319319

320-
An exported function that takes an SSR manifest as its first argument and an object containing your adapter [args](#args) as its second argument.
320+
An exported function that takes an SSR manifest as its first argument and an object containing your adapter [`args`](#args) as its second argument.
321321

322-
Some hosts expect you to *start* the server yourselves, for example, by listening to a port. For these types of hosts, the adapter API allows you to export a `start` function, which will be called when the bundle script is run.
322+
Some hosts expect you to *start* the server yourselves, for example, by listening to a port. For these types of hosts, the adapter API allows you to export a `start()` function, which will be called when the bundle script is run.
323323

324324
```js title="my-adapter/server.js"
325325
import { App } from 'astro/app';
@@ -335,7 +335,7 @@ export function start(manifest) {
335335

336336
### `astro/app`
337337

338-
This module is used for rendering pages that have been prebuilt through `astro build`. Astro uses the standard [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) and [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) objects. Hosts that have a different API for request/response should convert to these types in their adapter.
338+
This module is used for rendering pages that have been prebuilt through `astro build`. Astro uses the standard [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request) and [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) objects. Hosts that have a different API for request/response should convert to these types in their adapter.
339339

340340
The `App` constructor accepts a required SSR manifest argument, and optionally an argument to enable or disable streaming, defaulting to `true`.
341341

@@ -427,11 +427,11 @@ The example below reads a header named `x-private-header`, attempts to parse it
427427
const privateHeader = request.headers.get("x-private-header");
428428
let locals = {};
429429
try {
430-
if (privateHeader) {
431-
locals = JSON.parse(privateHeader);
432-
}
430+
if (privateHeader) {
431+
locals = JSON.parse(privateHeader);
432+
}
433433
} finally {
434-
const response = await app.render(request, { locals });
434+
const response = await app.render(request, { locals });
435435
}
436436
```
437437

@@ -450,22 +450,23 @@ This is used to override the default `fetch()` behavior, for example, when `fetc
450450

451451
The following example reads `500.html` and `404.html` from disk instead of performing an HTTP call:
452452

453-
```js "prerenderedErrorPageFetch"
453+
```ts "prerenderedErrorPageFetch"
454454
return app.render(request, {
455455
prerenderedErrorPageFetch: async (url: string): Promise<Response> => {
456456
if (url.includes("/500")) {
457-
const content = await fs.promises.readFile("500.html", "utf-8");
458-
return new Response(content, {
459-
status: 500,
460-
headers: { "Content-Type": "text/html" },
461-
});
462-
}
463-
464-
const content = await fs.promises.readFile("404.html", "utf-8");
457+
const content = await fs.promises.readFile("500.html", "utf-8");
465458
return new Response(content, {
466-
status: 404,
459+
status: 500,
467460
headers: { "Content-Type": "text/html" },
468461
});
462+
}
463+
464+
const content = await fs.promises.readFile("404.html", "utf-8");
465+
return new Response(content, {
466+
status: 404,
467+
headers: { "Content-Type": "text/html" },
468+
});
469+
}
469470
});
470471
```
471472

@@ -479,15 +480,15 @@ If not provided, Astro will fallback to its default behavior for fetching error
479480
**Default:** `app.match(request)`
480481
</p>
481482

482-
Provide a value for [`integrationRouteData`](/en/reference/integrations-reference/#integrationroutedata-type-reference) if you already know the route to render. Doing so will bypass the internal call to [`app.match`](#appmatch) to determine the route to render.
483+
Provides a value for [`integrationRouteData`](/en/reference/integrations-reference/#integrationroutedata-type-reference) if you already know the route to render. Doing so will bypass the internal call to [`app.match()`](#appmatch) to determine the route to render.
483484

484485
```js "routeData"
485486
const routeData = app.match(request);
486487
if (routeData) {
487-
return app.render(request, { routeData });
488+
return app.render(request, { routeData });
488489
} else {
489-
/* adapter-specific 404 response */
490-
return new Response(..., { status: 404 });
490+
/* adapter-specific 404 response */
491+
return new Response(..., { status: 404 });
491492
}
492493
```
493494

@@ -748,7 +749,7 @@ nodeApp.setHeadersMap([
748749
749750
Converts a NodeJS `IncomingMessage` into a standard `Request` object. This static method accepts an optional object as the second argument, allowing you to define if the body should be ignored, defaulting to `false`, and the [`allowedDomains`](/en/reference/configuration-reference/#securityalloweddomains).
750751
751-
The following example creates a `Request` and passes it to `app.render`:
752+
The following example creates a `Request` and passes it to `app.render()`:
752753
753754
```js {5}
754755
import { NodeApp } from 'astro/app/node';
@@ -770,16 +771,16 @@ const server = createServer(async (req, res) => {
770771
771772
Streams a web-standard `Response` into a NodeJS server response. This static method takes a `Response` object and the initial `ServerResponse` before returning a promise of a `ServerResponse` object.
772773
773-
The following example creates a `Request`, passes it to `app.render`, and writes the response:
774+
The following example creates a `Request`, passes it to `app.render()`, and writes the response:
774775
775776
```js {7}
776777
import { NodeApp } from 'astro/app/node';
777778
import { createServer } from 'node:http';
778779

779780
const server = createServer(async (req, res) => {
780-
const request = NodeApp.createRequest(req);
781-
const response = await app.render(request);
782-
await NodeApp.writeResponse(response, res);
781+
const request = NodeApp.createRequest(req);
782+
const response = await app.render(request);
783+
await NodeApp.writeResponse(response, res);
783784
})
784785
```
785786
@@ -907,7 +908,7 @@ export default function createIntegration() {
907908
name: '@example/my-adapter',
908909
serverEntrypoint: '@example/my-adapter/server.js',
909910
supportedAstroFeatures: {
910-
envGetSecret: 'stable'
911+
envGetSecret: 'stable'
911912
}
912913
});
913914
},
@@ -944,21 +945,21 @@ import { setGetEnv } from 'astro/env/setup';
944945
import { createGetEnv } from '../utils/env.js';
945946

946947
type Env = {
947-
[key: string]: unknown;
948+
[key: string]: unknown;
948949
};
949950

950951
export function createExports(manifest: SSRManifest) {
951-
const app = new App(manifest);
952+
const app = new App(manifest);
952953

953-
const fetch = async (request: Request, env: Env) => {
954-
setGetEnv(createGetEnv(env));
954+
const fetch = async (request: Request, env: Env) => {
955+
setGetEnv(createGetEnv(env));
955956

956-
const response = await app.render(request);
957+
const response = await app.render(request);
957958

958-
return response;
959-
};
959+
return response;
960+
};
960961

961-
return { default: { fetch } };
962+
return { default: { fetch } };
962963
}
963964
```
964965
@@ -997,7 +998,7 @@ export default function createIntegration() {
997998
name: '@example/my-adapter',
998999
serverEntrypoint: '@example/my-adapter/server.js',
9991000
adapterFeatures: {
1000-
edgeMiddleware: true
1001+
edgeMiddleware: true
10011002
}
10021003
});
10031004
},
@@ -1018,23 +1019,23 @@ export default function createIntegration() {
10181019
name: '@example/my-adapter',
10191020
serverEntrypoint: '@example/my-adapter/server.js',
10201021
adapterFeatures: {
1021-
edgeMiddleware: true
1022+
edgeMiddleware: true
10221023
}
10231024
});
10241025
},
10251026

10261027
'astro:build:ssr': ({ middlewareEntryPoint }) => {
1027-
// remember to check if this property exits, it will be `undefined` if the adapter doesn't opt in to the feature
1028-
if (middlewareEntryPoint) {
1029-
createEdgeMiddleware(middlewareEntryPoint)
1030-
}
1028+
// remember to check if this property exits, it will be `undefined` if the adapter doesn't opt in to the feature
1029+
if (middlewareEntryPoint) {
1030+
createEdgeMiddleware(middlewareEntryPoint)
1031+
}
10311032
}
10321033
},
10331034
};
10341035
}
10351036

10361037
function createEdgeMiddleware(middlewareEntryPoint) {
1037-
// emit a new physical file using your bundler
1038+
// emit a new physical file using your bundler
10381039
}
10391040
```
10401041

src/content/docs/en/reference/modules/astro-config.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
base,
2626
build,
2727
site,
28+
compressHTML,
2829
} from "astro:config/client";
2930
```
3031

@@ -49,6 +50,7 @@ See more about the configuration imports available from `astro:config/client`:
4950
- [`base`](/en/reference/configuration-reference/#base)
5051
- [`build.format`](/en/reference/configuration-reference/#buildformat)
5152
- [`site`](/en/reference/configuration-reference/#site)
53+
- [`compressHTML`](/en/reference/configuration-reference/#compresshtml)
5254

5355

5456

@@ -66,6 +68,7 @@ import {
6668
outDir,
6769
publicDir,
6870
root,
71+
compressHTML,
6972
} from "astro:config/server";
7073
```
7174

@@ -111,13 +114,10 @@ See more about the configuration imports available from `astro:config/server`:
111114
- [`build.format`](/en/reference/configuration-reference/#buildformat)
112115
- [`build.client`](/en/reference/configuration-reference/#buildclient)
113116
- [`build.server`](/en/reference/configuration-reference/#buildserver)
114-
- [`build.serverEntry`](/en/reference/configuration-reference/#buildserverentry)
115-
- [`build.assetsPrefix`](/en/reference/configuration-reference/#buildassetsprefix)
116117
- [`site`](/en/reference/configuration-reference/#site)
117118
- [`srcDir`](/en/reference/configuration-reference/#srcdir)
118119
- [`cacheDir`](/en/reference/configuration-reference/#cachedir)
119120
- [`outDir`](/en/reference/configuration-reference/#outdir)
120121
- [`publicDir`](/en/reference/configuration-reference/#publicdir)
121122
- [`root`](/en/reference/configuration-reference/#root)
122-
123-
123+
- [`compressHTML`](/en/reference/configuration-reference/#compresshtml)

src/content/docs/en/reference/modules/astro-transitions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ This option mimics the [`info` option](https://developer.mozilla.org/en-US/docs/
170170
<Since v="3.6.0" />
171171
</p>
172172

173-
Arbitrary data to be associated with the `NavitationHistoryEntry` object created by this navigation. This data can then be retrieved using the [`history.getState` function](https://developer.mozilla.org/en-US/docs/Web/API/NavigationHistoryEntry/getState) from the History API.
173+
Arbitrary data to be associated with the `NavigationHistoryEntry` object created by this navigation. This data can then be retrieved using the [`history.getState` function](https://developer.mozilla.org/en-US/docs/Web/API/NavigationHistoryEntry/getState) from the History API.
174174

175175
This option mimics the [`state` option](https://developer.mozilla.org/en-US/docs/Web/API/Navigation/navigate#state) from the browser Navigation API.
176176

src/content/docs/fr/tutorial/3-components/3.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ import Badge from "~/components/Badge.astro"
107107
2. Copiez les styles CSS ci-dessous dans `global.css`. Ces styles :
108108

109109
- Mettent en forme et positionnent les liens de navigation pour les appareils mobiles
110-
- Incluent une classe `expanded` qui peut être activée ou désactivée pour afficher ou masquer les liens sur mobile
111110
- Utilisent une requête `@media` pour définir des styles différents pour des tailles d'écran plus grandes
112111

113112
:::tip[Conception Mobile-First]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: JekyllPad & Astro
3+
description: JekyllPad의 브라우저 기반, GitHub 백엔드 편집기로 Git이나 Markdown의 번거로움 없이 Astro 사이트 콘텐츠를 관리하세요.
4+
sidebar:
5+
label: JekyllPad
6+
type: cms
7+
service: JekyllPad
8+
i18nReady: true
9+
stub: true
10+
---
11+
12+
[JekyllPad](https://www.jekyllpad.com)는 GitHub 저장소에 직접 연결되는 가벼운 브라우저 기반 CMS입니다.
13+
14+
현대적인 WYSIWYG + Markdown 편집기를 제공하며, 변경 사항을 저장소에 직접 커밋하고 100% 클라이언트 측에서 실행되므로 서버 설정이나 Git 학습 없이 Astro 콘텐츠를 관리할 수 있습니다.
15+
16+
사용자 브라우저에서 완전히 실행되는 클라이언트 측 애플리케이션입니다. 즉, 데이터, OAuth 및 보안 토큰이 모두 사용자 브라우저에 유지됩니다. 설치가 필요 없으며 모든 모바일 또는 데스크톱 브라우저에서 작동합니다.
17+
18+
## 공식 리소스
19+
20+
- [Astro용 JekyllPad CMS](https://www.jekyllpad.com/features/astro-headless-cms)

0 commit comments

Comments
 (0)