From f398c78727a131871d0a829d9692453c3d2514e7 Mon Sep 17 00:00:00 2001 From: Shane Date: Mon, 28 Aug 2023 17:22:27 +0800 Subject: [PATCH 01/27] Update code in `tutorial/5-astro-api/3.mdx` (#4284) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Elian ☕️ --- src/content/docs/en/tutorial/5-astro-api/3.mdx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/content/docs/en/tutorial/5-astro-api/3.mdx b/src/content/docs/en/tutorial/5-astro-api/3.mdx index 725a13c070958..5752df8e371dd 100644 --- a/src/content/docs/en/tutorial/5-astro-api/3.mdx +++ b/src/content/docs/en/tutorial/5-astro-api/3.mdx @@ -90,7 +90,8 @@ You have previously displayed items in a list from an array using `map()`. What ```astro title="src/pages/tags/index.astro" --- import BaseLayout from '../../layouts/BaseLayout.astro'; - const tags = ["astro", "successes", "community", "setbacks", "learning in public"]; + const allPosts = await Astro.glob("../posts/*.md"); + const tags = [...new Set(allPosts.map((post) => post.frontmatter.tags).flat())]; const pageTitle = "Tag Index"; --- @@ -182,7 +183,6 @@ Instead of creating items in an unordered list this time, create one `

` for e .tags { display: flex; flex-wrap: wrap; - margin: 0 auto; } .tag { @@ -224,7 +224,6 @@ const pageTitle = "Tag Index"; .tags { display: flex; flex-wrap: wrap; - margin: 0 auto; } .tag { @@ -295,7 +294,6 @@ Follow the steps below, then check your work by comparing it to the [final code .tags { display: flex; flex-wrap: wrap; - margin: 0 auto; } .tag { @@ -370,7 +368,6 @@ const { frontmatter } = Astro.props; .tags { display: flex; flex-wrap: wrap; - margin: 0 auto; } .tag { From 364da0e7fe927da92cea877445d079e7854189e0 Mon Sep 17 00:00:00 2001 From: Trent Howard Date: Mon, 28 Aug 2023 22:36:00 +1000 Subject: [PATCH 02/27] add note on draft with content collection support (#4357) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Elian ☕️ --- src/content/docs/en/guides/markdown-content.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/content/docs/en/guides/markdown-content.mdx b/src/content/docs/en/guides/markdown-content.mdx index 9877dd1cd5738..b4e9b0d231ddd 100644 --- a/src/content/docs/en/guides/markdown-content.mdx +++ b/src/content/docs/en/guides/markdown-content.mdx @@ -93,6 +93,10 @@ const posts = await Astro.glob('../pages/post/*.md'); const nonDraftPosts = posts.filter((post) => !post.frontmatter.draft); ``` +:::note[Using content collections?] +This feature is not supported for content collections, however you can use a [collection query filter](/en/guides/content-collections/#filtering-collection-queries) to filter your draft posts. +::: + #### Enable building draft pages To enable building draft pages by default, update `astro.config.mjs` by adding `drafts: true` to `markdown` or to the `mdx` integration: From 4d68b33efb7b1c48f6080f31f49cc1c7454b80e3 Mon Sep 17 00:00:00 2001 From: Xiaoyue Lin <36526527+100gle@users.noreply.github.com> Date: Tue, 29 Aug 2023 01:07:33 +0800 Subject: [PATCH 03/27] i18n(zh-cn): Update `guides/integrations-guide/cloudflare.mdx` (#4388) Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com> --- .../guides/integrations-guide/cloudflare.mdx | 52 +++++++++++++++++-- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/src/content/docs/zh-cn/guides/integrations-guide/cloudflare.mdx b/src/content/docs/zh-cn/guides/integrations-guide/cloudflare.mdx index 0d2dc3fcc2a23..88bebd49d91f5 100644 --- a/src/content/docs/zh-cn/guides/integrations-guide/cloudflare.mdx +++ b/src/content/docs/zh-cn/guides/integrations-guide/cloudflare.mdx @@ -84,16 +84,62 @@ pnpm install wrangler --save-dev ## 访问 Cloudflare 运行时 -你可以通过适配器 API,在 Astro 组件和 API 路由中访问所有的 Cloudflare 绑定和环境变量。 +你可以通过 `Astro.locals` 在 Astro 组件和 API 路由中访问所有的 Cloudflare 绑定和环境变量。 + +如果你是在 `.astro` 文件中,那么你可以直接通过 `Astro.locals` 全局变量访问运行时: + +```astro +const env = Astro.locals.runtime.env; +``` + +或者,从一个端点中访问: ```js -import { getRuntime } from '@astrojs/cloudflare/runtime'; +// src/pages/api/someFile.js +export function get(context) { + const runtime = context.locals.runtime; -getRuntime(Astro.request); + return new Response('Some body'); +} ``` 由于适配器的模式(advanced = worker,directory = pages)以及 Cloudflare API 的差异,运行时项目的外观会有所不同。 + +如果你正在使用 `advanced` 运行时,那么你可以按以下方式声明 `runtime` 对象: + +```ts +// src/env.d.ts +/// +import type { AdvancedRuntime } from '@astrojs/cloudflare'; + +declare namespace App { + interface Locals extends AdvancedRuntime { + user: { + name: string; + surname: string; + }; + } +} +``` + +如果你正在使用 `directory` 运行时,那么你可以按以下方式声明 `runtime` 对象: + +```ts +// src/env.d.ts +/// +import type { DirectoryRuntime } from '@astrojs/cloudflare'; + +declare namespace App { + interface Locals extends DirectoryRuntime { + user: { + name: string; + surname: string; + }; + } +} +``` + ## 环境变量 请参阅 Cloudflare 的文档了解 [如何使用环境变量](https://developers.cloudflare.com/pages/platform/functions/bindings/#environment-variables)。 From 29927ca897f2c0bae2d45566af968eeddfa7dc85 Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Mon, 28 Aug 2023 21:14:18 +0200 Subject: [PATCH 04/27] Add Vercel logo to sponsors in sidebar (#4405) --- src/components/LeftSidebar/Sponsors.astro | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/components/LeftSidebar/Sponsors.astro b/src/components/LeftSidebar/Sponsors.astro index 9a70d765c6aa7..e2ceefecbe8a3 100644 --- a/src/components/LeftSidebar/Sponsors.astro +++ b/src/components/LeftSidebar/Sponsors.astro @@ -4,15 +4,9 @@ import UIString from '../UIString.astro';

- -

What is Astro?

Astro is an **all-in-one** **web framework** for building **fast,** **content-focused** websites. From 8d81953e898ecf52d4ef3b428ada5bb3f46179db Mon Sep 17 00:00:00 2001 From: Zercerium Date: Tue, 29 Aug 2023 12:35:58 +0200 Subject: [PATCH 06/27] fix brocken discord link (#4416) --- src/content/docs/ar/getting-started.mdx | 2 +- src/content/docs/de/getting-started.mdx | 2 +- src/content/docs/en/getting-started.mdx | 2 +- src/content/docs/en/reference/publish-to-npm.mdx | 4 ++-- src/content/docs/es/reference/publish-to-npm.mdx | 4 ++-- src/content/docs/fr/getting-started.mdx | 2 +- src/content/docs/fr/guides/troubleshooting.mdx | 2 +- src/content/docs/fr/reference/publish-to-npm.mdx | 2 +- src/content/docs/it/getting-started.mdx | 2 +- src/content/docs/ko/getting-started.mdx | 2 +- src/content/docs/pl/getting-started.mdx | 2 +- src/content/docs/pt-br/reference/publish-to-npm.mdx | 4 ++-- src/content/docs/zh-cn/getting-started.mdx | 2 +- src/content/docs/zh-cn/reference/publish-to-npm.mdx | 4 ++-- 14 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/content/docs/ar/getting-started.mdx b/src/content/docs/ar/getting-started.mdx index 02f36627938e3..714282cb9f7bd 100644 --- a/src/content/docs/ar/getting-started.mdx +++ b/src/content/docs/ar/getting-started.mdx @@ -81,7 +81,7 @@ import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro' ## انضم إلى مجتمعنا -انضم إلى مجتمع [أسترو على ديسكورد](https://astro.build/chat/) للمشاركة والحصول على المساعدة من مجتمع نشط وودود! +انضم إلى مجتمع [أسترو على ديسكورد](https://astro.build/chat) للمشاركة والحصول على المساعدة من مجتمع نشط وودود! 💬 رحّب وعرف بنفسك على قناة `#general`! diff --git a/src/content/docs/de/getting-started.mdx b/src/content/docs/de/getting-started.mdx index ddc3938f2a5f2..342c1994f05bd 100644 --- a/src/content/docs/de/getting-started.mdx +++ b/src/content/docs/de/getting-started.mdx @@ -92,7 +92,7 @@ Sieh dir Beispiele zu einigen grundlegenden Konzepten und Strukturen einer Astro ## Werde Teil unserer Community -Tritt dem [Astro-Discord](https://astro.build/chat/) bei, um deine Erfahrungen und Fragen rund um Astro mit unserer aktiven, freundlichen Community zu teilen! +Tritt dem [Astro-Discord](https://astro.build/chat) bei, um deine Erfahrungen und Fragen rund um Astro mit unserer aktiven, freundlichen Community zu teilen! 💬 Stell dich im Kanal `#general` vor! diff --git a/src/content/docs/en/getting-started.mdx b/src/content/docs/en/getting-started.mdx index ef7c2ed2b3cda..ddb82d40f7518 100644 --- a/src/content/docs/en/getting-started.mdx +++ b/src/content/docs/en/getting-started.mdx @@ -93,7 +93,7 @@ See examples of some of the key concepts and patterns of an Astro site! ## Join our Community -Join us in the [Astro Discord](https://astro.build/chat/) to share with and get help from an active, friendly community! +Join us in the [Astro Discord](https://astro.build/chat) to share with and get help from an active, friendly community! 💬 Say hi in our `#general` channel! diff --git a/src/content/docs/en/reference/publish-to-npm.mdx b/src/content/docs/en/reference/publish-to-npm.mdx index 11946d4be493c..c5791f2338543 100644 --- a/src/content/docs/en/reference/publish-to-npm.mdx +++ b/src/content/docs/en/reference/publish-to-npm.mdx @@ -229,7 +229,7 @@ If you are extracting components from an existing project, you can even continue ## Testing your component -Astro does not currently ship a test runner. _(If you are interested in helping out with this, [join us on Discord!](https://astro.build/chat/))_ +Astro does not currently ship a test runner. _(If you are interested in helping out with this, [join us on Discord!](https://astro.build/chat))_ In the meantime, our current recommendation for testing is: @@ -284,4 +284,4 @@ In addition to the required `astro-component` or `withastro` keyword, special ke ## Share -We encourage you to share your work, and we really do love seeing what our talented Astronauts create. Come and share what you create with us in our [Discord](https://astro.build/chat/) or mention [@astrodotbuild](https://twitter.com/astrodotbuild) in a Tweet! +We encourage you to share your work, and we really do love seeing what our talented Astronauts create. Come and share what you create with us in our [Discord](https://astro.build/chat) or mention [@astrodotbuild](https://twitter.com/astrodotbuild) in a Tweet! diff --git a/src/content/docs/es/reference/publish-to-npm.mdx b/src/content/docs/es/reference/publish-to-npm.mdx index e3eda7564f0f1..f6073445f2a06 100644 --- a/src/content/docs/es/reference/publish-to-npm.mdx +++ b/src/content/docs/es/reference/publish-to-npm.mdx @@ -230,7 +230,7 @@ Si estás extrayendo componentes de un proyecto existente, puedes incluso contin ## Probando tus componentes -Astro actualmente no incluye un test runner. Esto es algo que nos gustaría abordar. _(Si estás interesado en ayudar con esto, [¡únete a nosotros en Discord!](https://astro.build/chat/))_ +Astro actualmente no incluye un test runner. Esto es algo que nos gustaría abordar. _(Si estás interesado en ayudar con esto, [¡únete a nosotros en Discord!](https://astro.build/chat))_ Mientras tanto, nuestra recomendación actual para las pruebas es: @@ -286,4 +286,4 @@ Además de la palabra clave requerida `astro-component` o `withastro`, también ## Comparte -Te alentamos a compartir tu trabajo, y realmente nos encanta ver lo que crean nuestros talentosos Astronautas. ¡Ven y comparte lo que creas con nosotros en nuestro [Discord](https://astro.build/chat/) o menciona [@astrodotbuild](https://twitter.com/astrodotbuild) en un Tweet! +Te alentamos a compartir tu trabajo, y realmente nos encanta ver lo que crean nuestros talentosos Astronautas. ¡Ven y comparte lo que creas con nosotros en nuestro [Discord](https://astro.build/chat) o menciona [@astrodotbuild](https://twitter.com/astrodotbuild) en un Tweet! diff --git a/src/content/docs/fr/getting-started.mdx b/src/content/docs/fr/getting-started.mdx index 00a395ff3301c..9b448f2a0c97a 100644 --- a/src/content/docs/fr/getting-started.mdx +++ b/src/content/docs/fr/getting-started.mdx @@ -81,7 +81,7 @@ Voir des exemples de certains des concepts et modèles clés d'un site Astro ! ## Rejoignez notre Communauté -Rejoignez-nous dans le [Discord Astro](https://astro.build/chat/) afin de partager et obtenir de l'aide de la part d'une communauté active et accueillante ! +Rejoignez-nous dans le [Discord Astro](https://astro.build/chat) afin de partager et obtenir de l'aide de la part d'une communauté active et accueillante ! 💬 Dîtes bonjour dans notre channel `#general` ! diff --git a/src/content/docs/fr/guides/troubleshooting.mdx b/src/content/docs/fr/guides/troubleshooting.mdx index 55a4a1da487f3..b86c1104f72f9 100644 --- a/src/content/docs/fr/guides/troubleshooting.mdx +++ b/src/content/docs/fr/guides/troubleshooting.mdx @@ -184,7 +184,7 @@ const answer = sum(2, 4); ## Besoin de plus ? -Venez discuter avec nous sur [Discord](https://astro.build/chat/) et expliquez votre problème dans le salon `#support`. Nous sommes toujours heureux de pouvoir vous aider ! +Venez discuter avec nous sur [Discord](https://astro.build/chat) et expliquez votre problème dans le salon `#support`. Nous sommes toujours heureux de pouvoir vous aider ! Visitez les [_"Issues"_ GitHub ouvertes dans Astro](https://github.com/withastro/astro/issues/) pour voir si vous rencontrez un problème connu ou soumettre un rapport de bug. diff --git a/src/content/docs/fr/reference/publish-to-npm.mdx b/src/content/docs/fr/reference/publish-to-npm.mdx index ed8524015eafa..6d2892208a464 100644 --- a/src/content/docs/fr/reference/publish-to-npm.mdx +++ b/src/content/docs/fr/reference/publish-to-npm.mdx @@ -226,7 +226,7 @@ Si vous voulez extraire des composants d'un projet existant, vous pouvez aussi c ## Tester votre composant -Astro ne livre actuellement pas de suites de tests. C'est quelque chose que nous aimerions aborder. _(Si vous êtes intéressé·e·s pour aider, [rejoignez nous dans notre Discord !](https://astro.build/chat/))_ +Astro ne livre actuellement pas de suites de tests. C'est quelque chose que nous aimerions aborder. _(Si vous êtes intéressé·e·s pour aider, [rejoignez nous dans notre Discord !](https://astro.build/chat))_ En attendant, nos recommandations actuelles pour les tests sont : diff --git a/src/content/docs/it/getting-started.mdx b/src/content/docs/it/getting-started.mdx index 6aac784762e8c..7e32c36f2172c 100644 --- a/src/content/docs/it/getting-started.mdx +++ b/src/content/docs/it/getting-started.mdx @@ -87,7 +87,7 @@ Vedi esempi di alcuni concetti e pattern chiave di un sito web fatto con Astro! ## Unisciti alla nostra Community -Unisciti a noi nel server [Discord di Astro](https://astro.build/chat/) per condividere ed essere aiutato da una community attiva e amichevole! +Unisciti a noi nel server [Discord di Astro](https://astro.build/chat) per condividere ed essere aiutato da una community attiva e amichevole! 💬 Di' ciao nel nostro canale `#general`! diff --git a/src/content/docs/ko/getting-started.mdx b/src/content/docs/ko/getting-started.mdx index 2f0e376897d25..97acb5bb4cbbd 100644 --- a/src/content/docs/ko/getting-started.mdx +++ b/src/content/docs/ko/getting-started.mdx @@ -81,7 +81,7 @@ Astro 사이트 패턴과 몇 가지 주요 개념을 예제를 통해 살펴보 ## 커뮤니티에 참여하기 -[Astro 디스코드](https://astro.build/chat/)에 참여하여 활발하고 친근한 커뮤니티와 공유하고 도움을 받으세요! +[Astro 디스코드](https://astro.build/chat)에 참여하여 활발하고 친근한 커뮤니티와 공유하고 도움을 받으세요! 💬 `#general` 채널에서 인사해 주세요! diff --git a/src/content/docs/pl/getting-started.mdx b/src/content/docs/pl/getting-started.mdx index f4d3882ad58c5..027777d3aec07 100644 --- a/src/content/docs/pl/getting-started.mdx +++ b/src/content/docs/pl/getting-started.mdx @@ -87,7 +87,7 @@ Zobacz przykłady niektórych kluczowych pojęć i wzorców witryny Astro! ## Dołącz do naszej społeczności -Dołącz do nas na [Discordzie Astro](https://astro.build/chat/), aby podzielić się z i uzyskać pomoc od aktywnej, przyjaznej społeczności! +Dołącz do nas na [Discordzie Astro](https://astro.build/chat), aby podzielić się z i uzyskać pomoc od aktywnej, przyjaznej społeczności! 💬 Przywitaj się na naszym kanale `#general`! diff --git a/src/content/docs/pt-br/reference/publish-to-npm.mdx b/src/content/docs/pt-br/reference/publish-to-npm.mdx index d8f109e8307c4..a131880ee27b1 100644 --- a/src/content/docs/pt-br/reference/publish-to-npm.mdx +++ b/src/content/docs/pt-br/reference/publish-to-npm.mdx @@ -229,7 +229,7 @@ Se você estiver extraindo componentes de um projeto existente, você pode até ## Testando seu componente -Astro atualmente não vem com um executador de testes. _(Se você estiver interessado em ajudar com isso, [junte-se a nós no Discord!](https://astro.build/chat/))_ +Astro atualmente não vem com um executador de testes. _(Se você estiver interessado em ajudar com isso, [junte-se a nós no Discord!](https://astro.build/chat))_ Enquanto isso, nossas recomendações atuais para testes é: @@ -284,4 +284,4 @@ Em adição a palavra-chave obrigatória `astro-component` ou `withastro`, palav ## Compartilhe -Nós incentivamos que você compartilhe o seu trabalho, assim como amamos ver o que nossos talentosos Astronautas criaram. Venha e compartilhe o que você criou conosco em nosso [Discord](https://astro.build/chat/) ou mencione [@astrodotbuild](https://twitter.com/astrodotbuild) em um Tweet! +Nós incentivamos que você compartilhe o seu trabalho, assim como amamos ver o que nossos talentosos Astronautas criaram. Venha e compartilhe o que você criou conosco em nosso [Discord](https://astro.build/chat) ou mencione [@astrodotbuild](https://twitter.com/astrodotbuild) em um Tweet! diff --git a/src/content/docs/zh-cn/getting-started.mdx b/src/content/docs/zh-cn/getting-started.mdx index c27027f451932..e7d42836cf484 100644 --- a/src/content/docs/zh-cn/getting-started.mdx +++ b/src/content/docs/zh-cn/getting-started.mdx @@ -83,7 +83,7 @@ Astro 是**集多功能于一体的 Web 框架**,用于构建**快速、以内 ## 加入我们的社区 -加入我们的 [Astro Discord 服务器](https://astro.build/chat/),同活跃且友好的社区分享你的经验成果,也可以在那里寻求社区的帮助! +加入我们的 [Astro Discord 服务器](https://astro.build/chat),同活跃且友好的社区分享你的经验成果,也可以在那里寻求社区的帮助! 💬 在 `#general` 频道中打声招呼吧! diff --git a/src/content/docs/zh-cn/reference/publish-to-npm.mdx b/src/content/docs/zh-cn/reference/publish-to-npm.mdx index 3641b066e145d..ab3b88659dfbf 100644 --- a/src/content/docs/zh-cn/reference/publish-to-npm.mdx +++ b/src/content/docs/zh-cn/reference/publish-to-npm.mdx @@ -228,7 +228,7 @@ Astro 没有专门针对开发的模块模式。作为替代的是,你可以 ## 测试组件 -目前 Astro 并未提供测试运行器。**(如果你有兴趣帮忙,[欢迎加入我们的 Discord!](https://astro.build/chat/))**。 +目前 Astro 并未提供测试运行器。**(如果你有兴趣帮忙,[欢迎加入我们的 Discord!](https://astro.build/chat))**。 同时,我们目前对测试的建议有: @@ -284,4 +284,4 @@ Astro 没有专门针对开发的模块模式。作为替代的是,你可以 ## 分享 -我们鼓励你分享创造,我们真的很喜欢看到有才华的 Astronauts 创作。来吧,在我们的 [Discord 服务器](https://astro.build/chat/)中与我们分享你的创作,或者在 Twitter 中提及[@astrodotbuild](https://twitter.com/astrodotbuild)! +我们鼓励你分享创造,我们真的很喜欢看到有才华的 Astronauts 创作。来吧,在我们的 [Discord 服务器](https://astro.build/chat)中与我们分享你的创作,或者在 Twitter 中提及[@astrodotbuild](https://twitter.com/astrodotbuild)! From 8190f7e1c737de336a0aad046b06164c733395e0 Mon Sep 17 00:00:00 2001 From: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com> Date: Tue, 29 Aug 2023 15:18:50 -0300 Subject: [PATCH 07/27] backnit --- src/content/docs/en/reference/configuration-reference.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/reference/configuration-reference.mdx b/src/content/docs/en/reference/configuration-reference.mdx index 1eb46cff3df4b..d32890c906563 100644 --- a/src/content/docs/en/reference/configuration-reference.mdx +++ b/src/content/docs/en/reference/configuration-reference.mdx @@ -275,7 +275,7 @@ Specify the strategy used for scoping styles within Astro components. Choose fro Using `'class'` is helpful when you want to ensure that element selectors within an Astro component override global style defaults (e.g. from a global stylesheet). Using `'where'` gives you more control over specifity, but requires that you use higher-specifity selectors, layers, and other tools to control which selectors are applied. -Using 'attribute' is useful when you are manipulating the `class` attribute of elements and need to avoid conflicts between your own styling logic and Astro's application of styles. +Using `'attribute'` is useful when you are manipulating the `class` attribute of elements and need to avoid conflicts between your own styling logic and Astro's application of styles. ### adapter From 0895eaf87321e84e8da9094cf69e7e592e4b58cc Mon Sep 17 00:00:00 2001 From: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com> Date: Tue, 29 Aug 2023 15:19:05 -0300 Subject: [PATCH 08/27] put the v in the 2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 李瑞丰 --- src/content/docs/en/guides/upgrade-to/v3.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/upgrade-to/v3.mdx b/src/content/docs/en/guides/upgrade-to/v3.mdx index ca1f54a6681c7..fa3538117f996 100644 --- a/src/content/docs/en/guides/upgrade-to/v3.mdx +++ b/src/content/docs/en/guides/upgrade-to/v3.mdx @@ -182,7 +182,7 @@ If you are continuing to use v1.x APIs, use the new APIs for each feature instea ### Removed: `image` from `astro:content` in content collections schema -In Astro 2.x, the content collections API deprecated an `image` export from `astro:content` for use in your content collections schemas. +In Astro v2.x, the content collections API deprecated an `image` export from `astro:content` for use in your content collections schemas. Astro 3.0 removes this export entirely. From 333cdd5ee86c6aa44d93c997abd32f88276b8471 Mon Sep 17 00:00:00 2001 From: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com> Date: Tue, 29 Aug 2023 15:19:18 -0300 Subject: [PATCH 09/27] put the v in the 3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 李瑞丰 --- src/content/docs/en/guides/upgrade-to/v3.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/upgrade-to/v3.mdx b/src/content/docs/en/guides/upgrade-to/v3.mdx index fa3538117f996..91e11f043ff8f 100644 --- a/src/content/docs/en/guides/upgrade-to/v3.mdx +++ b/src/content/docs/en/guides/upgrade-to/v3.mdx @@ -184,7 +184,7 @@ If you are continuing to use v1.x APIs, use the new APIs for each feature instea In Astro v2.x, the content collections API deprecated an `image` export from `astro:content` for use in your content collections schemas. -Astro 3.0 removes this export entirely. +Astro v3.0 removes this export entirely. #### What should I do? From 7b89c400e5be15a0d5378be6c71645965b2a8f1c Mon Sep 17 00:00:00 2001 From: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com> Date: Tue, 29 Aug 2023 15:19:31 -0300 Subject: [PATCH 10/27] put the v in the 3 part 2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 李瑞丰 --- src/content/docs/en/guides/upgrade-to/v3.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/upgrade-to/v3.mdx b/src/content/docs/en/guides/upgrade-to/v3.mdx index 91e11f043ff8f..f68c856980ca6 100644 --- a/src/content/docs/en/guides/upgrade-to/v3.mdx +++ b/src/content/docs/en/guides/upgrade-to/v3.mdx @@ -263,7 +263,7 @@ const { class: className } = Astro.props; In Astro v2.x, camelCase [CSS variables](/en/guides/styling/#css-variables) passed to the `style` attribute were rendered as both camelCase (as written) and kebab-case (kept for backwards compatibility). -Astro 3.0 removes the kebab-case transform for these camelCase CSS variable names, and only the original camelCase CSS variable is rendered. +Astro v3.0 removes the kebab-case transform for these camelCase CSS variable names, and only the original camelCase CSS variable is rendered. ```astro "my-value" --- From 4bb5430a1d5f2abf1af2052e9b9f2baf3cd3811a Mon Sep 17 00:00:00 2001 From: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com> Date: Tue, 29 Aug 2023 15:19:41 -0300 Subject: [PATCH 11/27] wording --- src/content/docs/en/guides/upgrade-to/v3.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/upgrade-to/v3.mdx b/src/content/docs/en/guides/upgrade-to/v3.mdx index f68c856980ca6..fd3fba8213159 100644 --- a/src/content/docs/en/guides/upgrade-to/v3.mdx +++ b/src/content/docs/en/guides/upgrade-to/v3.mdx @@ -380,7 +380,7 @@ export async function GET() { } ``` -If you really need to keep previous format, you can use the `ResponseWithEncoding` object, but will be depricated in the future. +If you really need to keep the previous format, you can use the `ResponseWithEncoding` object but will be deprecated in the future. ```ts title="endpoint.json.ts" del={2} ins={3} export async function GET() { From c4d24997452599b85138582b2b3fa761753e76d8 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Tue, 29 Aug 2023 19:59:48 +0100 Subject: [PATCH 12/27] chore: supplement `functionPerRoute` docs (#4419) * chore: supplement `functionPerRoute` docs * Update src/content/docs/en/reference/adapter-reference.mdx Co-authored-by: Sarah Rainsberger --------- Co-authored-by: Sarah Rainsberger --- src/content/docs/en/reference/adapter-reference.mdx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/content/docs/en/reference/adapter-reference.mdx b/src/content/docs/en/reference/adapter-reference.mdx index 6d5eb92878d6a..e62b2cb248574 100644 --- a/src/content/docs/en/reference/adapter-reference.mdx +++ b/src/content/docs/en/reference/adapter-reference.mdx @@ -358,6 +358,18 @@ export default function createIntegration() { The `entryFile` is of type `URL` and represents the physical path of the file in the file system. This means that the paths change based on the OS where the code runs. ::: +#### Serverless environments + +Setting `functionPerRoute:true` in a serverless environment creates a JavaScript file (handler) for each route. A handler might have different names based on your hosting platform: lambda, function, page, etc. + +Each of these routes is subject to a [cold start](https://azure.microsoft.com/en-us/blog/understanding-serverless-cold-start/) when the handler runs, which may cause some delay. This delay is influenced by different factors. + +With `functionPerRoute: false`, there is only one single handler in charge of rendering all your routes. When this handler is first triggered, you will be subject to a cold start. Then, all other routes should function without delay. However, you will lose the benefit of code splitting that `functionPerRoute:true` provides. + +:::note +It's important that you understand your hosting platform, and how it works, in order to choose the appropriate `functionPerRoute` configuration for your project. +::: + ### `edgeMiddleware` Defines whether any SSR middleware code will be bundled when built. From 355b667be370620c87c204a2608a61bc55bd384e Mon Sep 17 00:00:00 2001 From: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com> Date: Tue, 29 Aug 2023 16:05:03 -0300 Subject: [PATCH 13/27] Add note about passing classes to children --- src/content/docs/en/guides/styling.mdx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/content/docs/en/guides/styling.mdx b/src/content/docs/en/guides/styling.mdx index 45749caee2244..19bc77b32f38b 100644 --- a/src/content/docs/en/guides/styling.mdx +++ b/src/content/docs/en/guides/styling.mdx @@ -159,8 +159,7 @@ import MyComponent from "../components/MyComponent.astro" This will be red! ``` -This pattern lets you style child components directly. Astro will pass the parent’s scoped class name (e.g. `astro-hhnqfkh6`) through the `class` prop automatically, including the child in its parent’s scope. - +This pattern lets you style child components directly. Astro will pass the parent’s scoped class name (e.g. `astro-hhnqfkh6`) through the `class` prop automatically, including the child in its parent’s scope. Note this pattern only works when your [`scopedStyleStrategy` option](/en/reference/configuration-reference/#scopedstylestrategy) is either `'where'` or `'class'`. :::note[Scoped classes from parent components] Because the `class` prop includes the child in its parent’s scope, it is possible for styles to cascade from parent to child. To avoid this having unintended side effects, ensure you use unique class names in the child component. ::: From 58230436ae08af2313647dc0d4514ba62fd363a4 Mon Sep 17 00:00:00 2001 From: Alisson Nunes Date: Tue, 29 Aug 2023 17:07:11 -0300 Subject: [PATCH 14/27] i18n(pt-BR): Updated `getting-started.mdx` (#4417) * Changes of 19fa02fbe282556a2747f1db79933bea28f9ddea * Changes of dd737e1099133f71132e74fd4a65e2f57c8dbb24 * Line sync --- src/content/docs/pt-br/getting-started.mdx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/content/docs/pt-br/getting-started.mdx b/src/content/docs/pt-br/getting-started.mdx index 212e18dcc6d1a..fad3437f387c3 100644 --- a/src/content/docs/pt-br/getting-started.mdx +++ b/src/content/docs/pt-br/getting-started.mdx @@ -8,9 +8,9 @@ import TranslatorList from '~/components/TranslatorList.astro' import ContributorList from '~/components/ContributorList.astro' import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro' -:::tip[A versão 2 do Astro está aqui!] -**O que tem de novo no Astro v2?** [Descubra na postagem de anúncio no blog](https://astro.build/blog/astro-2/). -**Pronto para atualizar?** [Siga nosso guia de atualização](/pt-br/guides/upgrade-to/v2/). +{/* TODO: Replace with 3.0 tip on 30 August 2023. */} +:::tip[Olá Astronautas!] +Nosso novo tema de documentação [Starlight está no Product Hunt hoje](https://www.producthunt.com/posts/starlight-by-astro). :::

O que é Astro?

@@ -28,6 +28,7 @@ Astro é um **framework web** **tudo em um** para criação de websites **rápid Veja o nosso guia detalhado [Por que Astro?](/pt-br/concepts/why-astro/) para aprender mais sobre o que faz Astro especial. ✨ + ## Experimente Astro no seu navegador Visite [astro.new](https://astro.new/) e escolha entre uma variedade de templates para começar. Se divirta com uma versão completa e funcional do Astro direto do seu navegador! @@ -107,7 +108,9 @@ Junte-se a nós no [Discord do Astro](https://astro.build/chat) para compartilha [Histórico de alterações do Astro](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md) + + ## Traduza Essa tradução da documentação é trazida até você por todas essas pessoas incríveis. [Nos ajude a traduzir!](https://github.com/withastro/docs/blob/main/contributor-guides/translating-astro-docs.md) From 9a8f0a3880bd75b89b4c1ff44e9c20c246e8b687 Mon Sep 17 00:00:00 2001 From: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com> Date: Tue, 29 Aug 2023 17:20:13 -0300 Subject: [PATCH 15/27] Add some whitespace --- src/content/docs/en/reference/adapter-reference.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/en/reference/adapter-reference.mdx b/src/content/docs/en/reference/adapter-reference.mdx index e62b2cb248574..980ee5590eff0 100644 --- a/src/content/docs/en/reference/adapter-reference.mdx +++ b/src/content/docs/en/reference/adapter-reference.mdx @@ -360,11 +360,11 @@ The `entryFile` is of type `URL` and represents the physical path of the file in #### Serverless environments -Setting `functionPerRoute:true` in a serverless environment creates a JavaScript file (handler) for each route. A handler might have different names based on your hosting platform: lambda, function, page, etc. +Setting `functionPerRoute: true` in a serverless environment creates a JavaScript file (handler) for each route. A handler might have different names based on your hosting platform: lambda, function, page, etc. Each of these routes is subject to a [cold start](https://azure.microsoft.com/en-us/blog/understanding-serverless-cold-start/) when the handler runs, which may cause some delay. This delay is influenced by different factors. -With `functionPerRoute: false`, there is only one single handler in charge of rendering all your routes. When this handler is first triggered, you will be subject to a cold start. Then, all other routes should function without delay. However, you will lose the benefit of code splitting that `functionPerRoute:true` provides. +With `functionPerRoute: false`, there is only one single handler in charge of rendering all your routes. When this handler is first triggered, you will be subject to a cold start. Then, all other routes should function without delay. However, you will lose the benefit of code splitting that `functionPerRoute: true` provides. :::note It's important that you understand your hosting platform, and how it works, in order to choose the appropriate `functionPerRoute` configuration for your project. From aeb79dab8c12aedb8f4137c924f6cfd2ddd2a4cc Mon Sep 17 00:00:00 2001 From: Alisson Nunes Date: Tue, 29 Aug 2023 17:21:08 -0300 Subject: [PATCH 16/27] i18n(pt-BR): Updated tutorial/5-astro-api/3.mdx (#4406) Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com> --- src/content/docs/pt-br/tutorial/5-astro-api/3.mdx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/content/docs/pt-br/tutorial/5-astro-api/3.mdx b/src/content/docs/pt-br/tutorial/5-astro-api/3.mdx index 65d383ca48a4d..5b978fb2f9686 100644 --- a/src/content/docs/pt-br/tutorial/5-astro-api/3.mdx +++ b/src/content/docs/pt-br/tutorial/5-astro-api/3.mdx @@ -89,7 +89,8 @@ Você havia anteriormente mostrado itens em uma lista de um array utilizando `ma ```astro title="src/pages/tags/index.astro" --- import LayoutBase from '../../layouts/LayoutBase.astro'; - const tags = ["astro", "sucessos", "comunidade", "contratempos", "aprendendo em público"]; + const todasPostagens = await Astro.glob("../posts/*.md"); + const tags = [...new Set(todasPostagens.map((post) => post.frontmatter.tags).flat())] const tituloPagina = "Índice de Tags"; --- @@ -181,7 +182,6 @@ Ao invés de criar items em uma lista desordenada dessa vez, crie um `

` para .tags { display: flex; flex-wrap: wrap; - margin: 0 auto; } .tag { @@ -223,7 +223,6 @@ const tituloPagina = "Índice de Tags"; .tags { display: flex; flex-wrap: wrap; - margin: 0 auto; } .tag { @@ -294,7 +293,6 @@ Siga as etapas abaixo, e então cheque seu trabalho o comparando com a [amostra .tags { display: flex; flex-wrap: wrap; - margin: 0 auto; } .tag { @@ -368,7 +366,6 @@ const { frontmatter } = Astro.props; .tags { display: flex; flex-wrap: wrap; - margin: 0 auto; } .tag { From d6034c9aff6c9d68ee973ea8daddc0c0aee6665c Mon Sep 17 00:00:00 2001 From: Alisson Nunes Date: Tue, 29 Aug 2023 17:36:31 -0300 Subject: [PATCH 17/27] i18n(pt-BR): Updated `guides/markdown-content.mdx` (#4404) * Changes of 364da0e7fe927da92cea877445d079e7854189e0 * Fix broken link * Fix broken link * One more fix broken link . --------- Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com> --- src/content/docs/pt-br/guides/markdown-content.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/content/docs/pt-br/guides/markdown-content.mdx b/src/content/docs/pt-br/guides/markdown-content.mdx index 80203208f53ee..6c41fa67c052f 100644 --- a/src/content/docs/pt-br/guides/markdown-content.mdx +++ b/src/content/docs/pt-br/guides/markdown-content.mdx @@ -93,6 +93,10 @@ const postagens = await Astro.glob('../pages/postagens/*.md'); const postagensSemRascunhos = postagens.filter((postagem) => !postagem.frontmatter.draft); ``` +:::note[Usando coleções de conteúdo?] +Essa funcionalidade não suporta coleções de conteúdo, entretanto você pode utilizar um [filtro de consulta de coleção](/pt-br/guides/content-collections/#filtrando-consultas-de-coleção) para filtrar seus rascunhos de postagens. +::: + #### Habilitando a build de páginas de rascunho Para habilitar a build de páginas de rascunho por padrão, atualize `astro.config.mjs` adicionando `drafts: true` em `markdown` ou na integração `mdx`: From 2973b8ecc1e6d66175b963e12b783595d03d8661 Mon Sep 17 00:00:00 2001 From: Shinya Fujino Date: Wed, 30 Aug 2023 09:30:00 +0900 Subject: [PATCH 18/27] i18n(ja): Update tutorial for v3 (#4415) Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com> --- src/content/docs/ja/tutorial/1-setup/1.mdx | 8 ++++---- src/content/docs/ja/tutorial/5-astro-api/4.mdx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/content/docs/ja/tutorial/1-setup/1.mdx b/src/content/docs/ja/tutorial/1-setup/1.mdx index 0260336462259..c679227efcee6 100644 --- a/src/content/docs/ja/tutorial/1-setup/1.mdx +++ b/src/content/docs/ja/tutorial/1-setup/1.mdx @@ -29,7 +29,7 @@ Astroプロジェクトを作成し、サイトをビルド、開発、テスト ### Node.js -Astroをシステム上で実行するには、バージョン`v16.12.0`以降の[**Node.js**](https://nodejs.org/ja/)をインストールする必要があります。 +Astroをシステム上で実行するには、バージョン`v18.14.1`以降の[**Node.js**](https://nodejs.org/ja/)をインストールする必要があります。 互換性のあるバージョンがインストール済みかどうかを確認するには、ターミナルで次のコマンドを実行します。 @@ -37,12 +37,12 @@ Astroをシステム上で実行するには、バージョン`v16.12.0`以降 node -v // 出力例 -v16.14.0 +v18.14.1 ``` -コマンドが`v16.12.0`よりも高いバージョン番号を返していれば、問題ありません! +コマンドが`v18.14.1`よりも高いバージョン番号を返していれば、問題ありません! -コマンドが`'node'コマンドが見つかりません`のようなエラーメッセージを返すか、バージョン番号が`v16.12.0`よりも低い場合は、[互換性のあるバージョンのNode.jsのインストール](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)が必要です。 +コマンドが`'node'コマンドが見つかりません`のようなエラーメッセージを返すか、バージョン番号が`v18.14.1`よりも低い場合は、[互換性のあるバージョンのNode.jsのインストール](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)が必要です。 ### コードエディタ diff --git a/src/content/docs/ja/tutorial/5-astro-api/4.mdx b/src/content/docs/ja/tutorial/5-astro-api/4.mdx index b052e64f8e80f..45437fc3aafb8 100644 --- a/src/content/docs/ja/tutorial/5-astro-api/4.mdx +++ b/src/content/docs/ja/tutorial/5-astro-api/4.mdx @@ -76,7 +76,7 @@ Astroは、ウェブサイトにRSSフィードを素早く追加するための import rss, { pagesGlobToRssItems } from '@astrojs/rss'; - export async function get() { + export async function GET() { return rss({ title: 'Astro学習者 | ブログ', description: 'Astroを学ぶ旅', From 585d2ad34c547321fbebe236022eb7b3a8758f26 Mon Sep 17 00:00:00 2001 From: Waxer59 <78129249+Waxer59@users.noreply.github.com> Date: Wed, 30 Aug 2023 02:39:59 +0200 Subject: [PATCH 19/27] i18n(es): Update `tutorial/` `V3` (#4372) * update tutorial * Update src/content/docs/es/tutorial/5-astro-api/4.mdx Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --------- Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com> --- src/content/docs/es/tutorial/1-setup/1.mdx | 8 ++++---- src/content/docs/es/tutorial/5-astro-api/4.mdx | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/content/docs/es/tutorial/1-setup/1.mdx b/src/content/docs/es/tutorial/1-setup/1.mdx index d6c68abf5567d..d2036ad9f446f 100644 --- a/src/content/docs/es/tutorial/1-setup/1.mdx +++ b/src/content/docs/es/tutorial/1-setup/1.mdx @@ -29,7 +29,7 @@ Puedes acceder a la línea de comandos a través de un programa de terminal loca ### Node.js -Para que Astro funcione en tu sistema, también necesitarás tener instalado [**Node.js**](https://nodejs.org/en/), versión `v16.12.0` o posterior. +Para que Astro funcione en tu sistema, también necesitarás tener instalado [**Node.js**](https://nodejs.org/en/), versión `v18.14.1` o posterior. Para comprobar si ya tienes instalada una versión compatible, ejecuta el siguiente comando en tu terminal: @@ -37,12 +37,12 @@ Para comprobar si ya tienes instalada una versión compatible, ejecuta el siguie node -v // Ejemplo de salida -v16.14.0 +v18.14.1 ``` -Si el comando devuelve un número de versión superior a `v16.12.0`, ¡ya está! +Si el comando devuelve un número de versión superior a `v18.14.1`, ¡ya está! -Si el comando devuelve un mensaje de error como `Command 'node' not found`, o un número de versión inferior a `v16.12.0`, entonces necesitas [instalar una versión compatible de Node.js](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm). +Si el comando devuelve un mensaje de error como `Command 'node' not found`, o un número de versión inferior a `v18.14.1`, entonces necesitas [instalar una versión compatible de Node.js](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm). ### Editor de código diff --git a/src/content/docs/es/tutorial/5-astro-api/4.mdx b/src/content/docs/es/tutorial/5-astro-api/4.mdx index e1e76830ce3c6..8c0dfe10f1efc 100644 --- a/src/content/docs/es/tutorial/5-astro-api/4.mdx +++ b/src/content/docs/es/tutorial/5-astro-api/4.mdx @@ -68,7 +68,7 @@ Las personas pueden suscribirse a tu feed en un lector de feeds y recibir una no -## Crear un documento de alimentación `.xml` +## Crear un documento de feed `.xml` 1. Crea un nuevo fichero en `src/pages/` llamado `rss.xml.js`. @@ -78,7 +78,7 @@ Las personas pueden suscribirse a tu feed en un lector de feeds y recibir una no import rss, { pagesGlobToRssItems } from '@astrojs/rss'; - export async function get() { + export async function GET() { return rss({ title: 'Astro alumno | Blog', description: 'Mi viaje de aprendizaje de Astro', From dc1c9cf78d104f4fa196311c87204e702752b580 Mon Sep 17 00:00:00 2001 From: Shinya Fujino Date: Wed, 30 Aug 2023 09:43:16 +0900 Subject: [PATCH 20/27] i18n(ja): Update installation guides for v3 (#4414) Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com> --- src/content/docs/ja/install/auto.mdx | 2 +- src/content/docs/ja/install/manual.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/ja/install/auto.mdx b/src/content/docs/ja/install/auto.mdx index 3f7ef05a01076..0b70b09881346 100644 --- a/src/content/docs/ja/install/auto.mdx +++ b/src/content/docs/ja/install/auto.mdx @@ -14,7 +14,7 @@ Astroをインストールする準備はできましたか?このガイドに #### 前提条件 -- **Node.js** - `v16.12.0` またはそれ以上。 +- **Node.js** - `v18.14.1` またはそれ以上。 - **テキストエディタ** - [VS Code](https://code.visualstudio.com/)と[公式Astro拡張機能](https://marketplace.visualstudio.com/items?itemName=astro-build.astro-vscode)を推奨します。 - **ターミナル** - Astroは、コマンドラインインターフェイス(CLI)からアクセスします。 diff --git a/src/content/docs/ja/install/manual.mdx b/src/content/docs/ja/install/manual.mdx index 2fef0082d10a3..45c3b28c223d4 100644 --- a/src/content/docs/ja/install/manual.mdx +++ b/src/content/docs/ja/install/manual.mdx @@ -15,7 +15,7 @@ import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro' #### 前提条件 -- **Node.js** - `v16.12.0` またはそれ以上。 +- **Node.js** - `v18.14.1` またはそれ以上。 - **テキストエディタ** - [VS Code](https://code.visualstudio.com/)と[公式Astro拡張機能](https://marketplace.visualstudio.com/items?itemName=astro-build.astro-vscode)を推奨します。 - **ターミナル** - Astroは、コマンドラインインターフェイス(CLI)からアクセスします。 From 8153981a4088c1589bb1ea6a6b80424e643b27c4 Mon Sep 17 00:00:00 2001 From: Waxer59 <78129249+Waxer59@users.noreply.github.com> Date: Wed, 30 Aug 2023 02:45:53 +0200 Subject: [PATCH 21/27] i18n(es): Update install/v3 (#4379) Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com> --- src/content/docs/es/install/auto.mdx | 2 +- src/content/docs/es/install/manual.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/es/install/auto.mdx b/src/content/docs/es/install/auto.mdx index 06d97d1d5da88..8bd42e2ef24ff 100644 --- a/src/content/docs/es/install/auto.mdx +++ b/src/content/docs/es/install/auto.mdx @@ -13,7 +13,7 @@ Lee nuestra [guía de instalación manual paso a paso](/es/install/manual/) en s #### Prerrequisitos -- **Node.js** - `v16.12.0` o mayor. +- **Node.js** - `v18.14.1` o mayor. - **Editor de código** - Recomendamos [VS Code](https://code.visualstudio.com/) con nuestra [extensión oficial de Astro](https://marketplace.visualstudio.com/items?itemName=astro-build.astro-vscode). - **Terminal** - Astro es usado a través de la interfaz de línea de comandos (CLI). diff --git a/src/content/docs/es/install/manual.mdx b/src/content/docs/es/install/manual.mdx index cb56f18cb5c61..aeb875c85606e 100644 --- a/src/content/docs/es/install/manual.mdx +++ b/src/content/docs/es/install/manual.mdx @@ -16,7 +16,7 @@ Esta guía te guíara paso a paso para instalar manualmente y configurar un nuev #### Prerrequisitos -- **Node.js** - `v16.12.0` o mayor. +- **Node.js** - `v18.14.1` o mayor. - **Editor de código** - Recomendamos [VS Code](https://code.visualstudio.com/) con nuestra [extensión oficial de Astro](https://marketplace.visualstudio.com/items?itemName=astro-build.astro-vscode). - **Terminal** - Astro es usado a través de la interfaz de línea de comandos (CLI). From 8f2b8fef73ae43e629f1b6e656e69206e4ee91c7 Mon Sep 17 00:00:00 2001 From: "Houston (Bot)" <108291165+astrobot-houston@users.noreply.github.com> Date: Tue, 29 Aug 2023 17:46:39 -0700 Subject: [PATCH 22/27] ci: update integration docs (#4400) Co-authored-by: delucis Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com> --- src/content/docs/en/guides/integrations-guide/react.mdx | 2 +- src/content/docs/en/guides/integrations-guide/vercel.mdx | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/content/docs/en/guides/integrations-guide/react.mdx b/src/content/docs/en/guides/integrations-guide/react.mdx index 11f07bb6446fc..633f6b417dde0 100644 --- a/src/content/docs/en/guides/integrations-guide/react.mdx +++ b/src/content/docs/en/guides/integrations-guide/react.mdx @@ -134,7 +134,7 @@ import ReactComponent from './ReactComponent'; ``` -If you are using a library that *expects* more than one child element element to be passed, for example so that it can slot certain elements in different places, you might find this to be a blocker. +If you are using a library that *expects* more than one child element to be passed, for example so that it can slot certain elements in different places, you might find this to be a blocker. You can set the experimental flag `experimentalReactChildren` to tell Astro to always pass children to React as React vnodes. There is some runtime cost to this, but it can help with compatibility. diff --git a/src/content/docs/en/guides/integrations-guide/vercel.mdx b/src/content/docs/en/guides/integrations-guide/vercel.mdx index bd2b68f2edb7e..2bf9dc3d1e185 100644 --- a/src/content/docs/en/guides/integrations-guide/vercel.mdx +++ b/src/content/docs/en/guides/integrations-guide/vercel.mdx @@ -223,9 +223,11 @@ export default defineConfig({ }); ``` -### Per-page functions +### Function bundling configuration -The Vercel adapter builds to a single function by default. Astro 2.7 added support for splitting your build into separate entry points per page. If you use this configuration the Vercel adapter will generate a separate function for each page. This can help reduce the size of each function so they are only bundling code used on that page. +The Vercel adapter splits builds into a separate function per route by default. This helps reduce the size of each function, as it only bundles code used on that page. + +You can disable this and build to a single function by setting the `functionPerRoute` configuration option to `false`: ```js // astro.config.mjs @@ -235,7 +237,7 @@ import vercel from '@astrojs/vercel/serverless'; export default defineConfig({ output: 'server', adapter: vercel({ - functionPerRoute: true, + functionPerRoute: false, }), }); ``` From 695855eb10d0abeeabe882c5fe950a5a63a68c0b Mon Sep 17 00:00:00 2001 From: Waxer59 <78129249+Waxer59@users.noreply.github.com> Date: Wed, 30 Aug 2023 02:53:34 +0200 Subject: [PATCH 23/27] i18n(es): Update `view-transitions.mdx v3` (#4370) * update page * fix broken links * fix broken note * fix typo * fix broken link * Apply suggestions from code review Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --------- Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com> --- .../docs/es/guides/view-transitions.mdx | 228 ++++++++++++++---- src/i18n/es/nav.ts | 2 +- 2 files changed, 181 insertions(+), 49 deletions(-) diff --git a/src/content/docs/es/guides/view-transitions.mdx b/src/content/docs/es/guides/view-transitions.mdx index 62bbf41f3eac6..bde73dd8adb22 100644 --- a/src/content/docs/es/guides/view-transitions.mdx +++ b/src/content/docs/es/guides/view-transitions.mdx @@ -1,51 +1,54 @@ --- -title: View Transitions (Experimental) +title: View Transitions description: >- - Cómo habilitar el soporte experimental para las view transitions en tu sitio de Astro + Habilita una navegación fluida entre páginas en Astro con las view transitions. i18nReady: true --- import Since from '~/components/Since.astro' -El soporte para **transiciones de vista opcionales por página** en proyectos Astro puede habilitarse utilizando una bandera experimental. Las transiciones de vista actualizan el contenido de tu página sin recargar la navegación completa normal del navegador, lo que proporciona animaciones fluidas entre páginas. +Astro admite **view transitions opcionales por página** con solo unas pocas líneas de código. Las view transitions actualizan el contenido de tu página sin recargar la navegación completa normal del navegador, lo que proporciona animaciones fluidas entre páginas. -Astro proporciona un componente de enrutamiento `` que se puede agregar al elemento `` de una página para controlar las transiciones de página al navegar a otra página. Proporciona un enrutador del lado del cliente ligero que intercepta la navegación y te permite personalizar la transición entre páginas. Agrega este componente a un componente `.astro` reutilizable, como una cabecera o diseño común, para obtener transiciones de página animadas en todo tu sitio (modo SPA). +Astro ofrece un componente de enrutamiento `` que se puede agregar dentro del `` de una sola página para controlar las transiciones de página mientras navegas hacia otra página. Proporciona un enrutador ligero del lado del cliente que [intercepta la navegación](#proceso-de-navegación-del-lado-del-cliente) y te permite personalizar la transición entre páginas. -El soporte de las transiciones de vistas en Astro está impulsado por la nueva API del navegador [View Transitions](https://developer.chrome.com/docs/web-platform/view-transitions/) y también incluye: +Agrega este componente a un componente `.astro` reutilizable, como un encabezado común o un diseño, para lograr [transiciones animadas de página en todo tu sitio (modo SPA)](#view-transitions-completas-en-todo-el-sitio-modo-spa). -- Algunas [animaciones integradas](#directivas-de-animación-integradas), como `slide` y `fade`. +El soporte de las view transitions en Astro está impulsado por la nueva API del navegador [View Transitions](https://developer.chrome.com/docs/web-platform/view-transitions/) y también incluye: + +- Algunas [opciones de animación integradas](#directivas-de-animación-integradas), como `fade`, `slice` y `none`. - Soporte para animaciones de navegación hacia adelante y hacia atrás. - La capacidad de [personalizar completamente todos los aspectos de la animación de transición](#personalizando-animaciones) y crear tus propias animaciones. -- [Control sobre el comportamiento de respaldo](#control-de-respaldo) para navegadores que aún no admiten las API de Transiciones de Vistas. +- La opción de [impedir la navegación del lado del cliente para enlaces que no sean de página](#previniendo-la-navegación-del-lado-del-cliente). +- [Control sobre el comportamiento de respaldo](#control-de-respaldo) para navegadores que aún no admiten las API de View Transitions. +- Soporte automático para [`prefers-reduced-motion`](#prefers-reduced-motion). -:::caution -Las transiciones de vistas son una función experimental habilitada en Astro 2.9. La API está sujeta a cambios antes de que sea marcada como estable. +:::note +Por defecto, cada página utilizará la navegación normal del navegador, ocupando toda la página. Debes optar por ver las view transitions y puedes usarlas por página o en todo el sitio. ::: -## Habilitando las transiciones de vistas en tu proyecto +## Agregando las View Transitions a una página -Puedes habilitar el soporte para transiciones de página animadas a través de la bandera experimental `viewTransitions` en la configuración de Astro: +Opta por utilizar view transitions en páginas individuales importando y añadiendo el componente de enrutamiento `` dentro del `` en cada página deseada. -```js title="astro.config.mjs" ins={4-6} -import { defineConfig } from 'astro/config'; - -export default defineConfig({ - experimental: { - viewTransitions: true - } -}); +```astro title="src/pages/index.astro" ins={2,7} +--- +import { ViewTransitions } from 'astro:transitions'; +--- + + + Mi página de inicio + + + +

¡Bienvenido a mi sitio web!

+ + ``` -:::note -Habilitar el soporte para las view transitions no convierte automáticamente todo tu sitio en una SPA (Aplicación de página única). Por defecto, cada página seguirá utilizando la navegación normal del navegador, es decir, recargando la página por completo. - -Para agregar transiciones de página en Astro, utiliza el componente de enrutamiento `` de forma específica para cada página o en todo el sitio. -::: - -## Transiciones completas de vistas en todo el sitio (modo SPA) +## View transitions completas en todo el sitio (modo SPA) Importa y agrega el componente `` a tu componente `` común o de diseño compartido. Astro creará animaciones de página predeterminadas basadas en las similitudes entre la página antigua y la nueva, y también proporcionará un comportamiento de respaldo para los navegadores que no lo admitan. -El ejemplo a continuación muestra cómo agregar transiciones de vista de página en todo el sitio importando y añadiendo este componente a un componente `` de Astro: +El ejemplo a continuación muestra cómo agregar las animaciones de navegación de página predeterminadas de Astro en todo el sitio, incluida la opción de control de respaldo predeterminado para navegadores que no las admiten, importando y agregando este componente a un componente `` de Astro: ```astro title="components/CommonHead.astro" ins={2,12} --- @@ -62,6 +65,10 @@ import { ViewTransitions } from 'astro:transitions'; ``` +¡No es necesario realizar ninguna otra configuración para habilitar la navegación predeterminada del lado del cliente en Astro! + +Utiliza [directivas de transición](#directivas-de-transición) o [anula la navegación predeterminada del lado del cliente](#previniendo-la-navegación-del-lado-del-cliente) en elementos individuales para un control más preciso. + ## Directivas de transición Astro asignará automáticamente a los elementos encontrados tanto en la página antigua como en la nueva un `view-transition-name` compartido y único. Esta pareja de elementos coincidentes es inferida por el tipo de elemento y su ubicación en el DOM. @@ -70,10 +77,10 @@ Utiliza las directivas opcionales `transition:*` en los elementos de la página - `transition:name`: Te permite anular la coincidencia de elementos predeterminada de Astro para la animación del contenido antiguo/nuevo y [especificar un nombre de transición](#nombrando-una-transición) para asociar un par de elementos DOM. - `transition:animate`: Te permite modificar la animación predeterminada de Astro mientras reemplaza el elemento antiguo por el nuevo especificando un tipo de animación. Utiliza las [directivas de animación integradas](#directivas-de-animación-integradas) de Astro o [crea animaciones de transición personalizadas](#personalizando-animaciones). -- `transition: persist`: Te permite anular el reemplazo predeterminado de los elementos antiguos por los nuevos de Astro y, en su lugar, [persistir los componentes y elementos HTML](#mantener-el-estado) al navegar a otra página. +- `transition: persist`: Te permite anular el reemplazo predeterminado de los elementos antiguos por los nuevos de Astro y, en su lugar, [persistir los componentes y elementos HTML](#manteniendo-el-estado) al navegar a otra página. -## Nombrando una transición +### Nombrando una transición En algunos casos, es posible que desees o necesites identificar los elementos de transición de vista correspondientes tú mismo. Puedes especificar un nombre para un par de elementos utilizando la directiva `transition:name`. @@ -85,9 +92,9 @@ En algunos casos, es posible que desees o necesites identificar los elementos de