Skip to content

Commit

Permalink
Merge branch 'main' into zh-cn/upgrade-tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
ElianCodes authored Sep 22, 2023
2 parents a7eea13 + d2c3e1d commit e0df9a5
Show file tree
Hide file tree
Showing 18 changed files with 153 additions and 79 deletions.
2 changes: 1 addition & 1 deletion src/content/docs/en/recipes/i18n.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ Create links to the different languages you support so users can choose the lang
```astro
---
// src/components/Nav.astro
import { getLangFromUrl, useTranslations } from '../i18n/utils';
import { getLangFromUrl, useTranslations, useTranslatedPath } from '../i18n/utils';
const lang = getLangFromUrl(Astro.url);
const t = useTranslations(lang);
Expand Down
24 changes: 17 additions & 7 deletions src/content/docs/en/tutorial/5-astro-api/4.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,34 @@ Individuals can subscribe to your feed in a feed reader, and receive a notificat

1. Create a new file in `src/pages/` called `rss.xml.js`

2. Copy the following code into this new document, replacing the `site` property with your site's own unique Netlify URL. Customize the `title` and `description` properties, and if necessary, specify a different language in `customData`:
2. Copy the following code into this new document. Customize the `title` and `description` properties, and if necessary, specify a different language in `customData`:

```js title="src/pages/rss.xml.js"

import rss, { pagesGlobToRssItems } from '@astrojs/rss';

export async function get() {
export async function GET(context) {
return rss({
title: 'Astro Learner | Blog',
description: 'My journey learning Astro',
site: 'https://my-blog-site.netlify.app',
site: context.site,
items: await pagesGlobToRssItems(import.meta.glob('./**/*.md')),
customData: `<language>en-us</language>`,
});
}
```
3. This `rss.xml` document is only created when your site is built, so you won't be able to see this page in your browser during development. Quit the dev server and run the following commands to first, build your site locally and then, view a preview of your build:
3. Add the `site` property to the Astro config with your site's own unique Netlify URL.
```js title="astro.config.mjs" ins={4}
import { defineConfig } from "astro/config";

export default defineConfig({
site: "https://example.com"
});
```
4. This `rss.xml` document is only created when your site is built, so you won't be able to see this page in your browser during development. Quit the dev server and run the following commands to first, build your site locally and then, view a preview of your build:
<PackageManagerTabs>
<Fragment slot="npm">
Expand All @@ -114,14 +124,14 @@ Individuals can subscribe to your feed in a feed reader, and receive a notificat
```
</Fragment>
</PackageManagerTabs>
4. Visit `http://localhost:4321/rss.xml` and verify that you can see (unformatted) text on the page with an `item` for each of your `.md` files. Each item should contain blog post information such as `title`, `url`, and `description`.
5. Visit `http://localhost:4321/rss.xml` and verify that you can see (unformatted) text on the page with an `item` for each of your `.md` files. Each item should contain blog post information such as `title`, `url`, and `description`.

:::tip[view your rss feed in a reader]
Download a feed reader, or sign up for an online feed reader service and subscribe to your site by adding your own Netlify URL. You can also share this link with others so they can subscribe to your posts, and be notified when a new one is published.
:::

5. Be sure to quit the preview and restart the dev server when you want to view your site in development mode again.
6. Be sure to quit the preview and restart the dev server when you want to view your site in development mode again.



Expand Down
1 change: 0 additions & 1 deletion src/content/docs/en/tutorial/6-islands/1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ This component will take an array of greeting messages as a prop and randomly se
2. Add the following code to `Greeting.jsx`:

```jsx title="src/components/Greeting.jsx"
import { h } from 'preact';
import { useState } from 'preact/hooks';

export default function Greeting({messages}) {
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/es/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,6 @@ Estas traducciones de documentos te las traen todas estas personas increíbles.

## Contribuye

Estos docs fueron creados por toda esta gente maravillosa. [Únete a nosotros en GitHub!](https://github.com/withastro/docs)
Estos docs fueron creados por toda esta gente maravillosa. [¡Únete a nosotros en GitHub!](https://github.com/withastro/docs)

<ContributorList githubRepo="withastro/docs" />
1 change: 0 additions & 1 deletion src/content/docs/es/guides/integrations-guide/node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ Para obtener más ayuda, revisa el canal `#support` en [Discord](https://astro.b
También puedes revisar nuestra [Documentación de Integraciones de Astro][astro-integration] para más información sobre integraciones.
## Contribuyendo
Este paquete es mantenido por el equipo central de Astro. ¡Eres bienvenido a enviar un issue o PR!
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/es/guides/integrations-guide/tailwind.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,4 @@ Este paquete es mantenido por el equipo central de Astro. ¡Estás invitado a en

## Changelog

Consulta el [CHANGELOG.md](https://github.com/withastro/astro/tree/main/packages/integrations/tailwind/CHANGELOG.md) para un historial de cambios en esta integración.
Consulta el [CHANGELOG.md](https://github.com/withastro/astro/tree/main/packages/integrations/tailwind/CHANGELOG.md) para un historial de cambios en esta integración.
6 changes: 3 additions & 3 deletions src/content/docs/es/reference/integrations-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ interface AstroIntegration {
logger: AstroIntegrationLogger;
}) => void | Promise<void>;
'astro:build:generated'?: (options: { dir: URL; logger: AstroIntegrationLogger; }) => void | Promise<void>;
'astro:build:ssr'?: (options: {
manifest: SerializedSSRManifestm;
'astro:build:ssr'?: (options: {
manifest: SerializedSSRManifestm;
entryPoints: Map<RouteData, URL>;
logger: AstroIntegrationLogger;
}) => void | Promise<void>;
Expand Down Expand Up @@ -555,7 +555,7 @@ export function formatIntegration(): AstroIntegration {
return {
name: "astro-format",
hooks: {
"astro:build:done": (options, { logger }) => {
"astro:build:done": ({ logger }) => {
// hacer algo
logger.info("Integration ready.");
}
Expand Down
9 changes: 1 addition & 8 deletions src/content/docs/es/tutorial/3-components/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,7 @@ import Option from '~/components/tutorial/Option.astro';

Ahora que los archivos `.astro` y `.md` generan páginas enteras en tu sitio web, ¡es hora de crear y reutilizar fragmentos más pequeños de HTML con componentes Astro!

## ¿Dónde estás ahora?

Puedes encontrar el código en este punto del tutorial en [GitHub](https://github.com/withastro/blog-tutorial-demo/tree/unit-3/start) o en
[StackBlitz](https://stackblitz.com/github/withastro/blog-tutorial-demo/tree/unit-3/start?file=src/pages/index.astro).

Revisa tu código con este ejemplo, o si acabas de unirte a nosotros, haz un fork en StackBlitz para empezar a codificar en tu navegador desde aquí.

## ¿A dónde vas?
## Mirando hacia el futuro

En esta unidad, aprenderás a crear **componentes Astro** para reutilizar el código de los elementos comunes de tu sitio web.

Expand Down
9 changes: 1 addition & 8 deletions src/content/docs/es/tutorial/4-layouts/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,7 @@ import Checklist from '~/components/Checklist.astro';

Ahora que ya puedes construir con componentes, ¡es hora de crear algunas plantillas personalizadas!

## ¿Dónde estás ahora?

Puedes encontrar el código en este punto del tutorial en [GitHub](https://github.com/withastro/blog-tutorial-demo/tree/unit-4/start) o en
[StackBlitz](https://stackblitz.com/github/withastro/blog-tutorial-demo/tree/unit-4/start?file=src/pages/index.astro).

Revisa tu código con este ejemplo, o si acabas de unirte a nosotros, haz un fork en StackBlitz para empezar a codificar en tu navegador desde aquí.

## ¿A dónde vas?
## Mirando hacia el futuro

En esta unidad, crearás plantillas para compartir elementos y estilos comunes en tus páginas y publicaciones de blog.

Expand Down
9 changes: 1 addition & 8 deletions src/content/docs/es/tutorial/5-astro-api/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,7 @@ import Option from '~/components/tutorial/Option.astro';

Ahora que ya tienes algunas entradas de blog, ¡es hora de utilizar la API de Astro para trabajar con tus archivos!

## ¿Dónde estás ahora?

Puedes encontrar el código en este punto del tutorial en [GitHub](https://github.com/withastro/blog-tutorial-demo/tree/unit-5/start) o en
[StackBlitz](https://stackblitz.com/github/withastro/blog-tutorial-demo/tree/unit-5/start?file=src/pages/index.astro).

Revisa tu código con este ejemplo, o si acabas de unirte a nosotros, haz un fork en StackBlitz para empezar a codificar en tu navegador desde aquí.

## ¿A dónde vas?
## Mirando hacia el futuro

En esta unidad, mejorarás tu blog con una página de índice, páginas de etiquetas y un feed de RSS.

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/es/tutorial/6-islands/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const goal = 3;
const identity = {
firstName: "Sarah",
country: "Canada",
occupation: "Redactor técnico",
occupation: "Redactora técnica",
hobbies: ["fotografia", "observación de aves", "peñarol"],
};
const skills = ["HTML", "CSS", "JavaScript", "React", "Astro", "Redacción de documentos"];
Expand All @@ -40,7 +40,7 @@ const textCase = "uppercase";

Esperamos que hayas aprendido un poco sobre los fundamentos de Astro, ¡y que te hayas divertido por el camino!

Puedes encontrar el código en este punto del tutorial en [GitHub](https://github.com/withastro/blog-tutorial-demo/tree/complete) o en
Puedes encontrar el código del proyecto en este tutorial en [GitHub](https://github.com/withastro/blog-tutorial-demo/tree/complete) o en
[StackBlitz](https://stackblitz.com/github/withastro/blog-tutorial-demo/tree/complete?file=src/pages/index.astro).

Consulta nuestros documentos para obtener guías y material de referencia, y visita nuestro Discord para hacer preguntas, obtener ayuda o simplemente pasar el rato.
Expand Down
9 changes: 1 addition & 8 deletions src/content/docs/es/tutorial/6-islands/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,7 @@ import Option from '~/components/tutorial/Option.astro';

Ahora que ya tienes un blog en pleno funcionamiento, ¡es hora de añadir algunas islas interactivas a tu sitio!

## ¿Dónde estás ahora?

Puedes encontrar el código en este punto del tutorial en [GitHub](https://github.com/withastro/blog-tutorial-demo/tree/unit-6/start) o en
[StackBlitz](https://stackblitz.com/github/withastro/blog-tutorial-demo/tree/unit-6/start?file=src/pages/index.astro).

Revisa tu código con este ejemplo, o si acabas de unirte a nosotros, haz un fork en StackBlitz para empezar a codificar en tu navegador desde aquí.

## ¿A dónde vas?
## Mirando hacia el futuro

En esta unidad, utilizarás **Astro islands** para introducir componentes de frontend framework en tu sitio de Astro.

Expand Down
18 changes: 18 additions & 0 deletions src/content/docs/ja/reference/errors/get-static-paths-required.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: getStaticPaths() function required for dynamic routes.
i18nReady: true
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
---

> **GetStaticPathsRequired**: 動的なルートには`getStaticPaths()`関数が必要です。動的ルートから`getStaticPaths`関数を`export`していることを確認してください。
## 何が問題か?

[静的モード](/ja/core-concepts/routing/#静的ssgモード)では、すべてのルートをビルド時に決定する必要があります。そのため動的ルートは、生成対象の各パスを返す`getStaticPaths`関数を`export`する必要があります。

**以下も参照してください:**
- [動的ルーティング](/ja/core-concepts/routing/#動的ルーティング)
- [`getStaticPaths()`](/ja/reference/api-reference/#getstaticpaths)
- [サーバーサイドレンダリング](/ja/guides/server-side-rendering/)


2 changes: 1 addition & 1 deletion src/content/docs/zh-tw/concepts/why-astro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Astro 的奇妙之處就在於它如何將上述兩種價值(內容為中心

Astro 被設計成比其他 UI 框架及語言還簡單。一個重要原因是 Astro 是設計用來在伺服器而非瀏覽器上渲染。這就代表你無須擔心像是:hooks(React)、stale closures(還是 React)、refs(Vue)、observables(Svelte)、atoms、selectors、reactions 或 derivations。由於伺服器並沒有反應性,所以這些複雜性就不見了。

我們最喜歡的說法之一是:**選擇性地加入複雜度。** 我們在設計 Astro 時盡可能的在開發者體驗中移除「必須的複雜度」,特別是當你第一次使用這套框架。你可以在 Astro 中只用 HTML 和 CSS 建立一個「Hello World」範例網站。當你需要建立更強大的的東西時,你可以在使用過程中逐漸增加新功能及 API。
我們最喜歡的說法之一是:**選擇性地加入複雜度。** 我們在設計 Astro 時盡可能的在開發者體驗中去除「必須的複雜度」,特別是當你第一次使用這套框架。你可以在 Astro 中只用 HTML 和 CSS 建立一個「Hello World」範例網站。當你需要建立更強大的的東西時,你可以在使用過程中逐漸增加新功能及 API。


## 靈活且齊全
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/zh-tw/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Astro 是個**多合一**的**網頁框架**,用於打造**快速**且**以內

## 主要特色
- **組件群島:** 用於構建快速網站的新網頁架構。
- **伺服器優先的 API 設計:** 從使用者的設備上移除高開銷的水合過程
- **伺服器優先的 API 設計:** 從使用者的設備上去除高開銷的水合過程
- **預設零 JS:** 沒有 JavaScript 執行階段開銷來拖慢你的速度。
- **邊緣就緒:** 在任何地方部署,甚至像 Deno 或 Cloudflare 這樣的全球邊緣執行階段。
- **可自訂:** Tailwind、MDX 和其他 100 多個整合可供選擇。
Expand Down
Loading

0 comments on commit e0df9a5

Please sign in to comment.