Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/upstream'
Browse files Browse the repository at this point in the history
  • Loading branch information
ikxin committed Oct 1, 2024
2 parents 655bd83 + e55a239 commit 82e7062
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 40 deletions.
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/cms/tina-cms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,5 @@ To get started, you'll need an existing Astro project.
## Themes

<Grid>
<Card title="Resume01" href="https://astro.build/themes/details/resume-01/" thumbnail="resume01.png"/>
<Card title="Resume01" href="https://astro.build/themes/details/resume01/" thumbnail="resume01.png"/>
</Grid>
25 changes: 14 additions & 11 deletions src/content/docs/en/reference/container-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ If your Astro component renders one default slot, pass an object with `default`
import Card from "../src/components/Card.astro";

const result = await container.renderToString(Card, {
slots: { default: "Some value"}
slots: { default: "Some value" }
});
```

Expand All @@ -185,7 +185,10 @@ If your component renders named slots, use the slot names as the object keys:
import Card from "../src/components/Card.astro";

const result = await container.renderToString(Card, {
slots: { "header": "Header content", "footer": "Footer" }
slots: {
header: "Header content",
footer: "Footer"
}
});
```

Expand All @@ -207,8 +210,8 @@ import CardFooter from "../src/components/CardFooter.astro";

const result = await container.renderToString(Card, {
slots: {
"header": await container.renderToString(CardHeader),
"footer": await container.renderToString(CardFooter),
header: await container.renderToString(CardHeader),
footer: await container.renderToString(CardFooter)
}
});
```
Expand All @@ -223,7 +226,7 @@ An option to pass [properties](/en/basics/astro-components/#component-props) for
import Card from "../src/components/Card.astro";

const result = await container.renderToString(Card, {
props: { name: "Hello, world!" },
props: { name: "Hello, world!" }
});
```

Expand Down Expand Up @@ -257,7 +260,7 @@ import Card from "../src/components/Card.astro";
const result = await container.renderToString(Card, {
request: new Request("https://example.com/blog", {
headers: {
"X-some-secret-header": "test-value"
"x-some-secret-header": "test-value"
}
})
});
Expand Down Expand Up @@ -311,23 +314,23 @@ import Card from "../src/components/Card.astro";
test("User is in", async () => {
const result = await container.renderToString(Card, {
locals: {
checkAuth() { return true }
checkAuth() { return true; }
}
});

// assert result contains "You're in"
})
});


test("User is out", async () => {
const result = await container.renderToString(Card, {
locals: {
checkAuth() { return false }
checkAuth() { return false; }
}
});

// assert result contains "You're out"
})
});
```

### `routeType` option
Expand Down Expand Up @@ -364,7 +367,7 @@ import * as Endpoint from "../src/pages/api/endpoint.js";
const response = await container.renderToResponse(Endpoint, {
routeType: "endpoint",
request: new Request("https://example.com", {
method: "POST" //
method: "POST" // Specify POST method for testing
})
});
const json = await response.json();
Expand Down
5 changes: 3 additions & 2 deletions src/content/docs/en/reference/image-service-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,13 @@ const service: LocalImageService = {
loading: attributes.loading ?? 'lazy',
decoding: attributes.decoding ?? 'async',
};
}
},
propertiesToHash: ['src', 'width', 'height', 'format', 'quality'],
};
export default service;
```
At build time for static sites and pre-rendered routes, both `<Image />` and `getImage(options)` call the `transform()` function. They pass options either through component attributes or an `options` argument, respectively. The transformed images will be built to a `dist/_astro` folder.
At build time for static sites and pre-rendered routes, both `<Image />` and `getImage(options)` call the `transform()` function. They pass options either through component attributes or an `options` argument, respectively. The transformed images will be built to a `dist/_astro` folder. Their file names will contain a hash of the properties passed to `propertiesToHash`. This property is optional and will default to `['src', 'width', 'height', 'format', 'quality']`. If your custom image service has more options that change the generated images, add these to the array.
In dev mode and SSR mode, Astro doesn't know ahead of time which images need to be optimized. Astro uses a GET endpoint (by default, `/_image`) to process the images at runtime. `<Image />` and `getImage()` pass their options to `getURL()`, which will return the endpoint URL. Then, the endpoint calls `parseURL()` and passes the resulting properties to `transform()`.
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/es/guides/cms/tina-cms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,5 @@ Para empezar, necesitarás un proyecto Astro existente.
## Temas

<Grid>
<Card title="Resume01" href="https://astro.build/themes/details/resume-01/" thumbnail="resume01.png"/>
</Grid>
<Card title="Resume01" href="https://astro.build/themes/details/resume01/" thumbnail="resume01.png"/>
</Grid>
4 changes: 2 additions & 2 deletions src/content/docs/fr/guides/cms/tina-cms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,5 @@ Pour commencer, vous aurez besoin d'un projet Astro existant.
## Thèmes

<Grid>
<Card title="Resume01" href="https://astro.build/themes/details/resume-01/" thumbnail="resume01.png"/>
</Grid>
<Card title="Resume01" href="https://astro.build/themes/details/resume01/" thumbnail="resume01.png"/>
</Grid>
2 changes: 1 addition & 1 deletion src/content/docs/fr/guides/framework-components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: 'Apprenez à utiliser React, Svelte, etc.. avec Astro'
import IntegrationsNav from '~/components/IntegrationsNav.astro'
import ReadMore from '~/components/ReadMore.astro'

Construisez votre site Astro sans sacrifier votre Framework favori. Créez des iles Astro](/fr/concepts/islands/) avec le framework UI de votre choix.
Construisez votre site Astro sans sacrifier votre Framework favori. Créez des [îles](/fr/concepts/islands/) Astro avec le framework UI de votre choix.

## Intégrations officielles de Framework UI

Expand Down
5 changes: 3 additions & 2 deletions src/content/docs/fr/reference/image-service-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,13 @@ const service: LocalImageService = {
loading: attributes.loading ?? 'lazy',
decoding: attributes.decoding ?? 'async',
};
}
},
propertiesToHash: ['src', 'width', 'height', 'format', 'quality'],
};
export default service;
```
Au moment de la construction des sites statiques et des routes pré-rendues, `<Image />` et `getImage(options)` appellent la fonction `transform()`. Elles passent les options soit par les attributs du composant, soit par un argument `options`. Les images transformées seront compilées dans un dossier `dist/_astro`.
Au moment de la construction des sites statiques et des routes pré-rendues, `<Image />` et `getImage(options)` appellent la fonction `transform()`. Ces derniers transmettent les options soit par les attributs du composant, soit par un argument `options`, respectivement. Les images transformées seront compilées dans un dossier `dist/_astro`. Leurs noms de fichiers contiendront un hachage des propriétés passées à `propertiesToHash`. Cette propriété est optionnelle et sera par défaut `['src', 'width', 'height', 'format', 'quality']`. Si votre service d'image personnalisé a plus d'options qui modifient les images générées, ajoutez-les dans le tableau.
En mode dev et en mode SSR, Astro ne sait pas à l'avance quelles images doivent être optimisées. Astro utilise un point d'accès GET (par défaut, `/_image`) pour traiter les images au moment de l'exécution. `<Image />` et `getImage()` transmettent leurs options à `getURL()`, qui renvoie l'URL du point d'accès. Ensuite, le point d'accès appelle `parseURL()` et transmet les propriétés résultantes à `transform()`.
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/ko/guides/cms/tina-cms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -163,5 +163,5 @@ import { Steps } from '@astrojs/starlight/components';
## 테마

<Grid>
<Card title="Resume01" href="https://astro.build/themes/details/resume-01/" thumbnail="resume01.png"/>
</Grid>
<Card title="Resume01" href="https://astro.build/themes/details/resume01/" thumbnail="resume01.png"/>
</Grid>
13 changes: 7 additions & 6 deletions src/content/docs/pt-br/tutorial/1-setup/1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Box from '~/components/tutorial/Box.astro';
import MultipleChoice from '~/components/tutorial/MultipleChoice.astro';
import Option from '~/components/tutorial/Option.astro';
import PreCheck from '~/components/tutorial/PreCheck.astro';
import { Steps } from '@astrojs/starlight/components';
import Badge from "~/components/Badge.astro"

<PreCheck>
Expand All @@ -35,12 +36,12 @@ Para verificar se você já tem uma versão compatível instalada, execute o seg
node -v

// Resultado de exemplo
v18.14.1
v18.17.1
```

Se o comando retorna um número de versão maior que `v18.14.1`, você está pronto para continuar!
Se o comando retornar um número de versão maior que `v18.17.1` ou `v20.3.0` (excluindo qualquer `v19`), você pode continuar!

Se o comando retorna uma mensagem de erro como `Command 'node' not found`, ou um número de versão inferior a `v18.14.1`, então você precisa [instalar uma versão compatível do Node.js](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
Se o comando retornar uma mensagem de erro como `Command 'node' not found`, ou um número de versão menor do que o exigido, então você precisa [instalar uma versão compatível do Node.js](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).

### Editor de Código

Expand All @@ -50,9 +51,9 @@ Adicionalmente, você irá precisar baixar e instalar um **editor de código** p
Este tutorial irá utilizar **VS Code**, porém você pode usar qualquer outro editor para seu sistema operacional.
:::

1. [Baixe e instale o VS Code](https://code.visualstudio.com/#alt-downloads) ou outro editor de código de sua escolha.


<Steps>
1. [Baixe e instale o VS Code](https://code.visualstudio.com/#alt-downloads) ou outro editor de código de sua escolha.
</Steps>


<Box icon="question-mark">
Expand Down
7 changes: 4 additions & 3 deletions src/content/docs/pt-br/tutorial/1-setup/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ description: |-
Faça suas primeiras mudanças a página inicial do projeto do tutorial
i18nReady: true
---

import Checklist from '~/components/Checklist.astro';
import Box from '~/components/tutorial/Box.astro';
import InstallGuideTabGroup from '~/components/TabGroup/InstallGuideTabGroup.astro';
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro';
import PreCheck from '~/components/tutorial/PreCheck.astro';


import { Steps } from '@astrojs/starlight/components';

<PreCheck>
- Fazer sua primeira mudança ao seu novo website
</PreCheck>

## Edite sua página inicial


<Steps>
1. No seu editor de código, navegue no painel Explorador de arquivos para `src/pages/index.astro` e clique nele para abrir os conteúdos do arquivo em uma aba editável.

Os conteúdos do seu arquivo `index.astro` devem se parecer com isso:
Expand Down Expand Up @@ -55,6 +55,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro';
```

3. Verifique a pré-visualização do navegador, você deve ver o conteúdo da sua página atualizado para o texto novo.
</Steps>

Parabéns! Você agora é um desenvolvedor Astro!

Expand Down
8 changes: 5 additions & 3 deletions src/content/docs/pt-br/tutorial/1-setup/4.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ i18nReady: true
import Checklist from '~/components/Checklist.astro';
import Box from '~/components/tutorial/Box.astro';
import PreCheck from '~/components/tutorial/PreCheck.astro';
import { Steps } from '@astrojs/starlight/components';
import Badge from "~/components/Badge.astro"

<PreCheck>
Expand All @@ -25,20 +26,21 @@ Se você já é familiar com git e tem seu próprio fluxo de trabalho, então cr

Apesar de terem algumas formas de conseguir armazenar o seu código local no GitHub, este tutorial irá te guiar através de um método que não precisa utilizar git na linha de comando.

<Steps>
1. Entre no GitHub.com em um navegador e clique no <kbd>+</kbd> no lado superior direito da tela para criar um novo repositório.

2. Escolha um nome para seu repositório. Não é necessário ser o mesmo nome que a pasta do seu projeto.

3. Você será apresentado opções, mas você não precisa mudar nenhuma das opções padrões. Role para baixo e clique no botão <kbd>Create Repository</kbd>.

4. Você será apresentado com vários próximos passos de configuração, mas você não precisará utilizar nenhum deles. Anote a URL do seu repositório. Você agora pode sair desta página sem fazer nada.

</Steps>

## Faça commit do seu código local para o GitHub

Na última seção, você fez uma mudança no conteúdo de uma página. Isso significa que os arquivos do seu projeto mudaram, e o VS Code deve mostrar um número acima do ícone do menu "Controle do Código-Fonte". Esta aba de código-fonte é onde você vai regularmente ir para atualizar seus arquivos no GitHub.


<Steps>
1. Clique na aba de Controle do Código no seu VS Code para ver uma lista de arquivos que foram modificados. Se você ver uma mensagem de que você precisa instalar `git`, siga as instruções fornecidas, e então recarregue o VS Code.

2. Clique no menu <kbd>•••</kbd> "3 pontos" acima da mensagem de commit e escolha <kbd>Remoto</kbd> > <kbd>Adicionar Remoto</kbd>.
Expand All @@ -52,7 +54,7 @@ Na última seção, você fez uma mudança no conteúdo de uma página. Isso sig
6. Você pode ver uma mensagem te dizendo que você não tem commits "preparados", e perguntando se você gostaria de prepará-los. Clique <kbd>Sempre</kbd> e continue.

7. Finalmente, a lista de arquivos modificados deve ser substituída com um botão de <kbd>Publicar</kbd>. Clique-o para enviar suas mudanças confirmadas ao GitHub.

</Steps>

### Veja seu projeto no GitHub

Expand Down
3 changes: 3 additions & 0 deletions src/content/docs/pt-br/tutorial/1-setup/5.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Box from '~/components/tutorial/Box.astro';
import MultipleChoice from '~/components/tutorial/MultipleChoice.astro';
import Option from '~/components/tutorial/Option.astro';
import PreCheck from '~/components/tutorial/PreCheck.astro';
import { Steps } from '@astrojs/starlight/components';
import Badge from "~/components/Badge.astro"

<PreCheck>
Expand All @@ -26,6 +27,7 @@ Este tutorial irá utilizar **Netlify**, porém você está livre para utilizar

## Crie um novo site Netlify

<Steps>
1. Crie uma conta gratuita em [Netlify](https://netlify.com) se você já não a tiver.

Anote o seu nome de usuário. Você irá ver seu painel de controle e quaisquer sites que criou em `https://app.netlify.com/teams/nome`
Expand All @@ -35,6 +37,7 @@ Este tutorial irá utilizar **Netlify**, porém você está livre para utilizar
Você será questionado a conectar com um provedor Git. Escolha o GitHub e siga os passos na tela para autenticar sua conta do GitHub. Então, escolha o repositório do GitHub do seu projeto Astro pela lista fornecida.

3. Na última etapa, Netlify irá te mostrar as opções do site do seu aplicativo. As opções padrões devem estar corretas para seu projeto Astro, então você pode rolar para baixo e clicar em <kbd>Deploy site</kbd>.
</Steps>

Parabéns, você tem um site Astro!

Expand Down
13 changes: 10 additions & 3 deletions src/content/docs/pt-br/tutorial/1-setup/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ unitTitle: Crie e faça deploy do seu primeiro site Astro
title: 'Check in: Unidade 1 - Configuração'
description: >-
Tutorial: Construa seu primeiro blog Astro —
Prepare seu ambiente de desenvolvimento, crie e faça deploy do seu primeiro site Astro
Prepare seu ambiente de desenvolvimento, crie e faça deploy
do seu primeiro site Astro
i18nReady: true
---

import Checklist from '~/components/Checklist.astro';
import Box from '~/components/tutorial/Box.astro';

import { Steps } from '@astrojs/starlight/components';

Agora que você sabe o que estará construindo, é hora de configurar todas as ferramentas que você vai precisar!

Expand All @@ -23,23 +24,28 @@ Quer completar este tutorial em um editor de código online ao invés disso?
<summary>Siga estas instruções, então vá diretamente para a Unidade 2!</summary>

**Configure o StackBlitz**

<Steps>
1. Visite [astro.new](https://astro.new) e clique no botão para abrir o template "Empty Project" no StackBlitz.

2. Clique em "Sign in" no lado superior direito para entrar com suas credenciais do GitHub.

3. No lado superior esquerdo da janela do editor do StackBlitz, clique em "fork" no template (salvar no painel da sua própria conta).

4. Espere o projeto carregar, e então você irá ver uma visualização ao vivo do template inicial "Empty Project".
</Steps>

**Faça uma Modificação**

No painel de arquivos, você deve ver `src/pages/index.astro`. Clique para abrí-lo, e então siga [Escreva sua primeira linha de Astro](/pt-br/tutorial/1-setup/3/) para modificar esse arquivo.

**Crie um Repositório no GitHub**

<Steps>
1. Clique no botão <kbd>Connect Repository</kbd> no topo da sua lista de arquivos, insira um novo nome para seu repositório, e clique em <kbd>Create repo & push</kbd>.

2. Quando você tiver chances para dar commit no GitHub, um botão "Commit" irá aparecer no lado superior esquerdo da sua área de trabalho. Clicar nele irá te permitir inserir uma mensagem de commit, e então atualizar seu repositório.
</Steps>

**Faça Deploy do seu Site**

Expand All @@ -58,6 +64,7 @@ Enquanto você escreve código, você irá periodicamente fazer commit de suas m
Toda vez que você fazer commit de uma mudança para o GitHub, uma notificação será enviada a Netlify. Então, a Netlify irá automaticamente refazer a build e republicar seu site ao vivo para refletir a essas mudanças.



<Box icon="check-list">
## Checklist

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/zh-cn/guides/cms/tina-cms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,5 @@ import { Steps } from '@astrojs/starlight/components';
## Themes

<Grid>
<Card title="Resume01" href="https://astro.build/themes/details/resume-01/" thumbnail="resume01.png"/>
</Grid>
<Card title="Resume01" href="https://astro.build/themes/details/resume01/" thumbnail="resume01.png"/>
</Grid>
2 changes: 2 additions & 0 deletions src/content/docs/zh-tw/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ hero:
tagline: 由 Astro 和開源貢獻者共同出品。
linkText: 加入我們!
link: /zh-tw/contribute/
banner:
content: 想要試試 Astro 5 beta? 閱讀我們的 <a href="https://5-0-0-beta.docs.astro.build/zh-tw/guides/upgrade-to/v5/">v5 升級指南</a>!
---

import { CardGrid } from '@astrojs/starlight/components'
Expand Down

0 comments on commit 82e7062

Please sign in to comment.