Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime API restructure #10062

Merged
merged 93 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
864b90c
combine Astro global and context entries
sarah11918 Nov 19, 2024
9bece93
missing code formatting
sarah11918 Nov 20, 2024
28c496f
create separate routing reference page
sarah11918 Nov 21, 2024
a46b344
fix filename
sarah11918 Nov 21, 2024
6549cdc
start to update render context page
sarah11918 Nov 21, 2024
1e67cf4
Merge branch '5.0.0-beta' into runtime-api
sarah11918 Nov 21, 2024
0ff6543
combine more entries; leave WIP
sarah11918 Nov 21, 2024
24d3614
Merge branch '5.0.0-beta' into runtime-api
sarah11918 Nov 26, 2024
7a3c148
slight text edits to pre WIP content
sarah11918 Nov 26, 2024
c483cea
go through cookies section
sarah11918 Nov 26, 2024
b3f1a2a
update i18n locale properties
sarah11918 Nov 26, 2024
e2f4f43
first draft done
sarah11918 Nov 26, 2024
badb2c4
Commit some of Yan's fixes before the page crashes
sarah11918 Nov 26, 2024
d86b575
capitalization
sarah11918 Nov 26, 2024
7fdaff7
hightlighting
sarah11918 Nov 26, 2024
727bf1a
highlighting
sarah11918 Nov 26, 2024
00cc1b0
apply rest of Yan's suggestions
sarah11918 Nov 26, 2024
43d1364
commit some more suggestions
sarah11918 Nov 26, 2024
b3b09c4
Revert "commit some more suggestions"
sarah11918 Nov 26, 2024
a2d8d58
Apply suggestions from code review
TheOtterlord Nov 26, 2024
b9b6c3b
please commit properly
sarah11918 Nov 26, 2024
29576de
rename astro-syntax from basics to reference
sarah11918 Nov 26, 2024
0f49120
Update action-called-from-server-error.mdx
sarah11918 Nov 26, 2024
c334a96
Update client-address-not-available.mdx
sarah11918 Nov 26, 2024
d7718d3
Update prerender-client-address-not-available.mdx
sarah11918 Nov 26, 2024
55ae648
Update redirect-with-no-location.mdx
sarah11918 Nov 26, 2024
8e46d67
Update rewrite-with-body-used.mdx
sarah11918 Nov 26, 2024
9d79cfc
Update static-redirect-not-available.mdx
sarah11918 Nov 26, 2024
8b879d2
fix en links
sarah11918 Nov 26, 2024
3a133fd
move translations of astro-syntax to reference
sarah11918 Nov 26, 2024
cd8961e
code highlighting
sarah11918 Nov 26, 2024
7a8f4e9
code highlighting
sarah11918 Nov 26, 2024
d718dea
Armand returns!
sarah11918 Nov 26, 2024
4e63d82
Armand indents!
sarah11918 Nov 26, 2024
3fb16ef
fix more routing links
sarah11918 Nov 26, 2024
c159732
fix more links
sarah11918 Nov 26, 2024
f211171
Update static-client-address-not-available.mdx
sarah11918 Nov 26, 2024
2f0c383
Update get-static-paths-expected-params.mdx
sarah11918 Nov 26, 2024
d618567
Update get-static-paths-invalid-route-param.mdx
sarah11918 Nov 26, 2024
da813b5
Update get-static-paths-required.mdx
sarah11918 Nov 26, 2024
553e39f
Update invalid-get-static-path-param.mdx
sarah11918 Nov 26, 2024
b387f3d
Update invalid-get-static-paths-entry.mdx
sarah11918 Nov 26, 2024
0d05ae3
Update invalid-get-static-paths-return.mdx
sarah11918 Nov 26, 2024
992e3b5
Update no-matching-static-path-found.mdx
sarah11918 Nov 26, 2024
f21a5b2
Update prerender-dynamic-endpoint-path-collide.mdx
sarah11918 Nov 26, 2024
f582c85
fix it links
sarah11918 Nov 26, 2024
60b8c07
Merge branch 'runtime-api' of https://github.com/withastro/docs into …
sarah11918 Nov 26, 2024
682294a
fix pl links
sarah11918 Nov 26, 2024
2190f6b
fix ja links
sarah11918 Nov 26, 2024
9531c86
Lighten up!
sarah11918 Nov 26, 2024
3f7ee52
code highlighting
sarah11918 Nov 26, 2024
2f30afb
Merge branch '5.0.0-beta' into runtime-api
sarah11918 Nov 27, 2024
3c6eaaa
Merge branch '5.0.0-beta' into runtime-api
sarah11918 Nov 27, 2024
da61c0c
some Chris routing suggestions
sarah11918 Nov 28, 2024
dcad461
some edits to getStaticPaths and paginate text re: astro is a static …
sarah11918 Nov 28, 2024
87a8439
prerender draft
sarah11918 Nov 28, 2024
71882fa
subheadings make it easier to read
sarah11918 Nov 28, 2024
5dec31e
make prerendering feel more a part of the page
sarah11918 Nov 28, 2024
09b7206
fix link
sarah11918 Nov 28, 2024
3d80fe2
commit Chris's suggestions
sarah11918 Nov 29, 2024
5710f76
component utilities heading
sarah11918 Nov 29, 2024
0c20706
all properties are available!
sarah11918 Nov 29, 2024
c8a7e5f
file path
sarah11918 Nov 29, 2024
12a92f9
pages
sarah11918 Nov 29, 2024
079a6c5
helpful cookies property naming
sarah11918 Nov 29, 2024
805c96d
helpful cookies property naming
sarah11918 Nov 29, 2024
dc41d00
helpful cookies property naming
sarah11918 Nov 29, 2024
263f1b7
helpful cookies property naming
sarah11918 Nov 29, 2024
6fc27d5
properties > shape
sarah11918 Nov 29, 2024
25e9001
helpful cookies property naming
sarah11918 Nov 29, 2024
d2554f7
helpful cookies property naming
sarah11918 Nov 29, 2024
1fa3d3b
middleware nit
sarah11918 Nov 29, 2024
3a07d72
url 3D chess
sarah11918 Nov 29, 2024
5c60523
less indirection!
sarah11918 Nov 29, 2024
b2828bb
Also less indirection!
sarah11918 Nov 29, 2024
8711130
utter nit
sarah11918 Nov 29, 2024
e78c689
no comments left behind!
sarah11918 Nov 29, 2024
d8c31be
routes!
sarah11918 Nov 29, 2024
b291938
conciser!
sarah11918 Nov 29, 2024
217c45c
equivalent example
sarah11918 Nov 29, 2024
f183d69
de-emphasize read-only
sarah11918 Nov 29, 2024
f4165a1
align examples
sarah11918 Nov 29, 2024
67280c3
page context
sarah11918 Nov 29, 2024
f3e24ef
suggestion to move cheesier language to components page
sarah11918 Nov 29, 2024
116889f
syncKey for rewrite()
sarah11918 Nov 29, 2024
7142edb
Merge branch '5.0.0-beta' into runtime-api
sarah11918 Nov 30, 2024
6c7dd7c
add partial content to routing reference
sarah11918 Nov 30, 2024
055d9cc
add some type information
sarah11918 Nov 30, 2024
94354ec
move some content from pages to routing reference, and include a link
sarah11918 Nov 30, 2024
8267d94
space
sarah11918 Nov 30, 2024
5256850
Merge branch '5.0.0-beta' into runtime-api
sarah11918 Nov 30, 2024
4ecafc0
Merge branch '5.0.0-beta' into runtime-api
sarah11918 Dec 2, 2024
862d442
last min decision re: prerender default
sarah11918 Dec 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion astro.sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,12 @@ export const sidebar = [
group('reference', {
items: [
group('reference.syntax', {
items: ['basics/astro-syntax', 'reference/directives-reference'],
items: ['reference/astro-syntax', 'reference/directives-reference'],
}),
'reference/configuration-reference',
'reference/cli-reference',
'guides/imports',
'reference/routing-reference',
group('reference.runtime', {
items: [
'reference/api-reference',
Expand Down
7 changes: 4 additions & 3 deletions public/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
/:lang/guides/content/ /:lang/guides/markdown-content/
/:lang/community-resources/talks/ /:lang/recipes/
/:lang/community-resources/content/ /:lang/recipes/
/:lang:/reference/components-reference/ /:lang:/guides/syntax-highlighting/
/:lang:/tutorials/add-content-collections/ /:lang:/tutorial/6-islands/4/
/:lang:/tutorials/add-view-transitions/ /:lang:/guides/view-transitions/
/:lang/reference/components-reference/ /:lang/guides/syntax-highlighting/
/:lang/tutorials/add-content-collections/ /:lang/tutorial/6-islands/4/
/:lang/tutorials/add-view-transitions/ /:lang/guides/view-transitions/
/:lang/guides/rss/ /:lang/recipes/rss/
/:lang/basics/astro-syntax/ /:lang/reference/astro-syntax/

# Very old docs site redirects
# Once upon a time these URLs existed, so we try to keep them meaning something.
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/ar/basics/astro-components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const data = await fetch('SOME_SECRET_API_URL/users').then(r => r.json());

اذا قمت بكتابة HTML العادي هنا، فسيقوم المكوّن الخاص بك بتصيير ذلك الـ HTML في أي صفحة أسترو يتم استيرادها واستخدامها.

ومع ذلك، يدعم [ بناء قالب المكوّن لأسترو](/ar/basics/astro-syntax/) كذلك **تعابير جافاسكربت**، وسوم [`<style>`](/ar/guides/styling/#styling-in-astro) و[`<script>`](/ar/guides/client-side-scripts/#using-script-in-astro) لأسترو والمكوّنات المستوردة و[توجيهات أسترو الخاصة](/ar/reference/directives-reference/). البيانات والقيم المعرّفة في البرنامج النصي للمكوّن يمكن إستخدامها في قالب المكوّن لإنتاج HTML مُنشأ ديناميكيًا.
ومع ذلك، يدعم [ بناء قالب المكوّن لأسترو](/ar/reference/astro-syntax/) كذلك **تعابير جافاسكربت**، وسوم [`<style>`](/ar/guides/styling/#styling-in-astro) و[`<script>`](/ar/guides/client-side-scripts/#using-script-in-astro) لأسترو والمكوّنات المستوردة و[توجيهات أسترو الخاصة](/ar/reference/directives-reference/). البيانات والقيم المعرّفة في البرنامج النصي للمكوّن يمكن إستخدامها في قالب المكوّن لإنتاج HTML مُنشأ ديناميكيًا.

```astro title="src/components/MyFavoritePokemon.astro"
---
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/ar/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import Discord from '~/components/Landing/Discord.astro'
- [ميزات أسترو الرئيسية](/ar/concepts/why-astro/)
- [معمارية جزر أسترو](/ar/concepts/islands/)
- [مكونات أسترو](/ar/basics/astro-components/)
- [بناء جملة قالب أسترو](/ar/basics/astro-syntax/)
- [بناء جملة قالب أسترو](/ar/reference/astro-syntax/)
</ListCard>

<ListCard title="امتداد" icon="puzzle">
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/de/basics/astro-components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Unterhalb des Komponentenskripts befindet sich die Komponentenvorlage. Sie besti

Wenn du hier einfaches HTML schreibst, wird deine Komponente dieses HTML auf jeder Astro-Seite rendern, auf der sie importiert und verwendet wird.

Die [Syntax der Astro-Komponentenvorlage](/de/basics/astro-syntax/) unterstützt jedoch auch **JavaScript-Ausdrücke**, Astro-[`<style>`](/de/guides/styling/#styles-stile-in-astro) und [`<script>`](/de/guides/client-side-scripts/#verwendung-von-script-in-astro)-Tags, **importierte Komponenten** und [**spezielle Astro-Direktiven**](/de/reference/directives-reference/). Daten und Werte, die im Komponentenskript definiert werden, können in der Komponentenvorlage verwendet werden, um dynamisch erstelltes HTML zu erzeugen.
Die [Syntax der Astro-Komponentenvorlage](/de/reference/astro-syntax/) unterstützt jedoch auch **JavaScript-Ausdrücke**, Astro-[`<style>`](/de/guides/styling/#styles-stile-in-astro) und [`<script>`](/de/guides/client-side-scripts/#verwendung-von-script-in-astro)-Tags, **importierte Komponenten** und [**spezielle Astro-Direktiven**](/de/reference/directives-reference/). Daten und Werte, die im Komponentenskript definiert werden, können in der Komponentenvorlage verwendet werden, um dynamisch erstelltes HTML zu erzeugen.

```astro title="src/components/MeineLieblingspokemon.astro"
---
Expand Down Expand Up @@ -251,7 +251,7 @@ import Wrapper from '../components/Wrapper.astro';
Verwende ein `slot="mein-slot"`-Attribut auf dem untergeordneten Element, das du an einen passenden `<slot name="mein-slot" />`-Platzhalter in deiner Komponente weiterleiten willst.
:::

Um mehrere HTML-Elemente ohne ein umschließendes `<div>` in den `<slot/>`-Platzhalter einer Komponente zu übergeben, verwende das `slot=""`-Attribut auf [Astros <Fragment/>-Komponente](/de/basics/astro-syntax/#fragmente):
Um mehrere HTML-Elemente ohne ein umschließendes `<div>` in den `<slot/>`-Platzhalter einer Komponente zu übergeben, verwende das `slot=""`-Attribut auf [Astros <Fragment/>-Komponente](/de/reference/astro-syntax/#fragmente):


```astro title="src/components/CustomTable.astro" '<slot name="header" />' '<slot name="body" />'
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/de/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import Discord from '~/components/Landing/Discord.astro'
- [Astros Hauptmerkmale](/de/concepts/why-astro/)
- [Insel-Architektur](/de/concepts/islands/)
- [Astro Komponenten](/de/basics/astro-components/)
- [Die Astro Vorlagen-Syntax](/de/basics/astro-syntax/)
- [Die Astro Vorlagen-Syntax](/de/reference/astro-syntax/)
</ListCard>

<ListCard title="Erweitere" icon="puzzle">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Hier sind ein paar grundlegende Konzepte und Migrations&shy;strategien, die dir

## Wesentliche Gemeinsamkeiten zwischen CRA und Astro

- Die [Syntax von `.astro`-Dateien ist ähnlich zu JSX](/de/basics/astro-syntax/#unterschiede-zwischen-astro-und-jsx). Astro zu schreiben sollte sich also gewohnt anfühlen.
- Die [Syntax von `.astro`-Dateien ist ähnlich zu JSX](/de/reference/astro-syntax/#unterschiede-zwischen-astro-und-jsx). Astro zu schreiben sollte sich also gewohnt anfühlen.

- Astro verwendet dateienbasierts Routing, und [erlaubt spezielle Dateinamen, um dynamische Routen zu erstellen](/de/guides/routing/#dynamische-routen).

Expand Down Expand Up @@ -266,7 +266,7 @@ Hier sind ein paar Tipps für das Umwandeln von CRA-`.js`-Komponenten in `.astro

2. Tausche jeden [CRA oder JSX Syntax gegen Astro](#referenz-wandle-cra-syntax-in-astro-um) oder gegen HTML-Web-Standards. Damit ist zum Beispiel `{children}` oder `className` gemeint.

3. Verschiebe sämtliches JavaScript, inklusive `import`-Statements, in einen ["Code-Zaun" (`---`)](/de/basics/astro-components/#das-komponentenskript). Beachte: JavaScript, welches für das [bedingte Rendern von Inhalten](/de/basics/astro-syntax/#dynamisches-html) benötigt wird, wird oftmals in der HTML-Vorlage direkt in Astro geschrieben.
3. Verschiebe sämtliches JavaScript, inklusive `import`-Statements, in einen ["Code-Zaun" (`---`)](/de/basics/astro-components/#das-komponentenskript). Beachte: JavaScript, welches für das [bedingte Rendern von Inhalten](/de/reference/astro-syntax/#dynamisches-html) benötigt wird, wird oftmals in der HTML-Vorlage direkt in Astro geschrieben.

4. Verwende [`Astro.props`](/de/reference/api-reference/#astroprops), um auf die Komponenten&shy;attribute, die zuvor deiner CRA-Komponenten&shy;funktionen weitergegeben worden sind, zuzugreifen.

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/de/guides/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Dann überprüfe deine Importanweisung:

- Verweist dein Import auf den falschen Ort? (Überprüfe deinen Importpfad.)

- Hat dein Import den gleichen Namen wie die importierte Komponente? (Überprüfe deinen Komponentennamen und dass er der [`.astro`-Syntax folgt](/de/basics/astro-syntax/#unterschiede-zwischen-astro-und-jsx).)
- Hat dein Import den gleichen Namen wie die importierte Komponente? (Überprüfe deinen Komponentennamen und dass er der [`.astro`-Syntax folgt](/de/reference/astro-syntax/#unterschiede-zwischen-astro-und-jsx).)

- Hast du die Erweiterung in den Import aufgenommen? (Überprüfe, ob deine importierte Datei eine Erweiterung enthält, z.B. `.astro`, `.md`, `.vue`, `.svelte`. Hinweis: Dateierweiterungen sind nur für `.js(x)` und `.ts(x)` Dateien **nicht** erforderlich.)

Expand Down Expand Up @@ -138,7 +138,7 @@ In Astro funktioniert der `<head>`-Tag wie jeder andere HTML-Tag: Er wird nicht

### Ein unerwartetes `<script>`- oder `<style>`-Tag ist enthalten

Es kann vorkommen, dass die `<script>`- oder `<style>`-Tags einer importierten Komponente in deinem HTML-Quelltext enthalten sind, auch wenn die Komponente in der endgültigen Ausgabe nicht erscheint. Dies ist zum Beispiel der Fall bei [bedingt gerenderten](/de/basics/astro-syntax/#dynamisches-html) Komponenten, die nicht angezeigt werden.
Es kann vorkommen, dass die `<script>`- oder `<style>`-Tags einer importierten Komponente in deinem HTML-Quelltext enthalten sind, auch wenn die Komponente in der endgültigen Ausgabe nicht erscheint. Dies ist zum Beispiel der Fall bei [bedingt gerenderten](/de/reference/astro-syntax/#dynamisches-html) Komponenten, die nicht angezeigt werden.

Der Build-Prozess von Astro arbeitet mit dem Modul-Graph: Sobald eine Komponente in der Vorlage enthalten ist, werden ihre `<script>`- und `<style>`-Tags verarbeitet, optimiert und gebündelt, unabhängig davon, ob sie in der endgültigen Ausgabe erscheint oder nicht. Dies gilt nicht für Skripte, wenn die Direktive "is:inline" angewendet wird.

Expand Down
22 changes: 15 additions & 7 deletions src/content/docs/en/basics/astro-components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ description: An introduction to Astro components.
i18nReady: true
---

**Astro components** are the basic building blocks of any Astro project. They are HTML-only templating components with no client-side runtime. You can spot an Astro component by its file extension: `.astro`.
import ReadMore from '~/components/ReadMore.astro';

**Astro components** are the basic building blocks of any Astro project. They are HTML-only templating components with no client-side runtime and use the `.astro` file extension.

:::note
If you know HTML, you already know enough to write your first Astro component.

<ReadMore>Learn more in the [Astro syntax reference](/en/reference/astro-syntax/).</ReadMore>
:::

Astro components are extremely flexible. An Astro component can be as small as a snippet of HTML, like a collection of common `<meta>` tags that make SEO easy to work with. Components can be reusable UI elements, like a header or a profile card. Astro components can even contain an entire page layout or, when located in the special `src/pages/` folder, be an entire page itself.

Expand Down Expand Up @@ -54,8 +62,10 @@ const data = await fetch('SOME_SECRET_API_URL/users').then(r => r.json());

The code fence is designed to guarantee that the JavaScript that you write in it is "fenced in." It won't escape into your frontend application, or fall into your user's hands. You can safely write code here that is expensive or sensitive (like a call to your private database) without worrying about it ever ending up in your user's browser.

:::tip
You can even write TypeScript in your component script!
:::note
The Astro component script is TypeScript, which allows you to add additional syntax to JavaScript for editor tooling, and error checking.

<ReadMore>Read more about Astro's [built-in TypeScript support](/en/guides/typescript/).</ReadMore>
:::

### The Component Template
Expand All @@ -64,7 +74,7 @@ The component template is below the code fence and determines the HTML output of

If you write plain HTML here, your component will render that HTML in any Astro page it is imported and used.

However, [Astro's component template syntax](/en/basics/astro-syntax/) also supports **JavaScript expressions**, Astro [`<style>`](/en/guides/styling/#styling-in-astro) and [`<script>`](/en/guides/client-side-scripts/#using-script-in-astro) tags, **imported components**, and [**special Astro directives**](/en/reference/directives-reference/). Data and values defined in the component script can be used in the component template to produce dynamically-created HTML.
However, [Astro's component template syntax](/en/reference/astro-syntax/) also supports **JavaScript expressions**, Astro [`<style>`](/en/guides/styling/#styling-in-astro) and [`<script>`](/en/guides/client-side-scripts/#using-script-in-astro) tags, **imported components**, and [**special Astro directives**](/en/reference/directives-reference/). Data and values defined in the component script can be used in the component template to produce dynamically-created HTML.

```astro title="src/components/MyFavoritePokemon.astro"
---
Expand Down Expand Up @@ -259,7 +269,7 @@ import Wrapper from '../components/Wrapper.astro';
Use a `slot="my-slot"` attribute on the child element that you want to pass through to a matching `<slot name="my-slot" />` placeholder in your component.
:::

To pass multiple HTML elements into a component's `<slot/>` placeholder without a wrapping `<div>`, use the `slot=""` attribute on [Astro's `<Fragment/>` component](/en/basics/astro-syntax/#fragments):
To pass multiple HTML elements into a component's `<slot/>` placeholder without a wrapping `<div>`, use the `slot=""` attribute on [Astro's `<Fragment/>` component](/en/reference/astro-syntax/#fragments):

```astro title="src/components/CustomTable.astro" "<slot name="header"/>" "<slot name="body"/>"
---
Expand Down Expand Up @@ -393,6 +403,4 @@ A [`<slot />` element](/en/basics/astro-components/#slots) inside an HTML compon

## Next Steps

import ReadMore from '~/components/ReadMore.astro';

<ReadMore>Read more about using [UI framework components](/en/guides/framework-components/) in your Astro project.</ReadMore>
9 changes: 1 addition & 8 deletions src/content/docs/en/basics/astro-pages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,7 @@ However, because they are located in the special `src/pages/` directory, the gen

Partials, when combined with a rendering library, provide an alternative to [Astro islands](/en/concepts/islands/) and [`<script>` tags](/en/guides/client-side-scripts/) for building dynamic content in Astro.

Page files that can export a value (e.g. `.astro` , `.mdx`) can be marked as partials.

Configure a file within the `src/pages/` directory to be a partial by adding the following export:
Page files that can export a value for [`partial`](/en/reference/routing-reference/#partial) (e.g. `.astro` and `.mdx`, but not `.md`) can be marked as partials.

```astro title="src/pages/partial.astro" ins={2}
---
Expand All @@ -164,11 +162,6 @@ export const partial = true;
<li>I'm a partial!</li>
```

The `export const partial` must be identifiable statically. It can have the value of:

- The boolean __`true`__.
- An environment variable using import.meta.env such as `import.meta.env.USE_PARTIALS`.

### Using with a library

Partials are used to dynamically update a section of a page using a library such as [htmx](https://htmx.org/).
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import Discord from '~/components/Landing/Discord.astro'
- [Astro's main features](/en/concepts/why-astro/)
- [Islands architecture](/en/concepts/islands/)
- [Astro components](/en/basics/astro-components/)
- [The Astro template syntax](/en/basics/astro-syntax/)
- [The Astro template syntax](/en/reference/astro-syntax/)
</ListCard>

<ListCard title="Extend" icon="puzzle">
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ Pages must be on-demand rendered when calling actions using a form action. [Ensu

You can enable zero-JS form submissions with standard attributes on any `<form>` element. Form submissions without client-side JavaScript may be useful both as a fallback for when JavaScript fails to load, or if you prefer to handle forms entirely from the server.

Calling [Astro.getActionResult()](/en/reference/api-reference/#astrogetactionresult) on the server returns the result of your form submission (`data` or `error`), and can be used to dynamically redirect, handle form errors, update the UI, and more.
Calling [Astro.getActionResult()](/en/reference/api-reference/#getactionresult) on the server returns the result of your form submission (`data` or `error`), and can be used to dynamically redirect, handle form errors, update the UI, and more.

To call an action from an HTML form, add `method="POST"` to your `<form>`, then set the form's `action` attribute using your action, for example `action={actions.logout}`. This will set the `action` attribute to use a query string that is handled by the server automatically.

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/en/guides/cms/builderio.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ Create the page `src/pages/posts/[slug].astro` that will [dynamically generate a
</FileTree>

This file must contain:
- A [`getStaticPaths()`](/en/reference/api-reference/#getstaticpaths) function to fetch `slug` information from Builder and create a static route for each blog post.
- A [`getStaticPaths()`](/en/reference/routing-reference/#getstaticpaths) function to fetch `slug` information from Builder and create a static route for each blog post.
- A `fetch()` to the Builder API using the `slug` identifier to return post content and metadata (e.g. a `title`).
- A `<Fragment />` in the template to render the post content as HTML.

Expand Down Expand Up @@ -322,7 +322,7 @@ const { html: postHTML } = await fetch(
```

:::note
The variables `builderModel` and `builderAPIpublicKey` need to be created twice, since [`getStaticPaths()` runs in its own isolated scope](/en/reference/api-reference/#getstaticpaths).
The variables `builderModel` and `builderAPIpublicKey` need to be created twice, since [`getStaticPaths()` runs in its own isolated scope](/en/reference/routing-reference/#getstaticpaths).
:::

Now when you click on a link on your index route, you will be taken to the individual blog post page.
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/cms/contentful.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ Navigate to http://localhost:4321/ and click on one of your posts to make sure y

If you've [opted in to SSR mode](/en/guides/on-demand-rendering/), you will use a dynamic route that uses a `slug` parameter to fetch the data from Contentful.

Create a `[slug].astro` page in `src/pages/posts`. Use [`Astro.params`](/en/reference/api-reference/#astroparams) to get the slug from the URL, then pass that to `getEntries`:
Create a `[slug].astro` page in `src/pages/posts`. Use [`Astro.params`](/en/reference/api-reference/#params) to get the slug from the URL, then pass that to `getEntries`:

```astro title="src/pages/posts/[slug].astro"
---
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/cms/strapi.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ Create the file `src/pages/blog/[slug].astro` to [dynamically generate a page](/

#### Static site generation

In Astro's default static mode (SSG), use [`getStaticPaths()`](/en/reference/api-reference/#getstaticpaths) to fetch your list of articles from Strapi.
In Astro's default static mode (SSG), use [`getStaticPaths()`](/en/reference/routing-reference/#getstaticpaths) to fetch your list of articles from Strapi.

```astro title="src/pages/blog/[slug].astro
---
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/content-collections.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ The exact method for generating routes will depend on whether your pages are pre

### Building for static output (default)

If you are building a static website (Astro's default behavior), use the [`getStaticPaths()`](/en/reference/api-reference/#getstaticpaths) function to create multiple pages from a single page component (e.g. `src/pages/[slug]`) during your build.
If you are building a static website (Astro's default behavior), use the [`getStaticPaths()`](/en/reference/routing-reference/#getstaticpaths) function to create multiple pages from a single page component (e.g. `src/pages/[slug]`) during your build.

Call `getCollection()` inside of `getStaticPaths()` to have your collection data available for building static routes. Then, create the individual URL paths using the `id` property of each content entry. Each page is passed the entire collection entry as a prop for [use in your page template](#using-content-in-astro-templates).

Expand Down
Loading
Loading