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

[i18nIgnore] Add tab component to recipes and deploy.mdx #5305

Merged
merged 16 commits into from
Nov 13, 2023
Merged
37 changes: 33 additions & 4 deletions src/content/docs/de/guides/deploy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ description: Wie du deine Astro-Website im Internet veröffentlichst.
i18nReady: true
---
import DeployGuidesNav from '~/components/DeployGuidesNav.astro';
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'

**Bist du bereit, deine Astro-Website zu erzeugen und zu veröffentlichen?**
Folge einer unserer Anleitungen zu den verschiedenen Hosting-Anbietern, oder scrolle weiter nach unten, um allgemeine Informationen zur Veröffentlichung einer Astro-Website zu erhalten.
Expand Down Expand Up @@ -41,9 +42,23 @@ Manche Hosting-Anbieter stellen eine eigene Kommandozeilen­schnittstelle (CL

1. Installiere die CLI deines Hosting-Anbieters global, zum Beispiel:

```bash
<PackageManagerTabs>
<Fragment slot="npm">
```shell
npm install --global netlify-cli
```
</Fragment>
<Fragment slot="pnpm">
```shell
pnpm add --global netlify-cli
```
</Fragment>
<Fragment slot="yarn">
```shell
yarn global add netlify-cli
```
</Fragment>
</PackageManagerTabs>

1. Starte die CLI und folge den Anweisungen zur Authentifizierung, Einrichtung usw.

Expand All @@ -66,9 +81,23 @@ Vielleicht möchtest du deine Website auch lokal erzeugen, um sie dir als Vorsch

Nutze den Befehl `npm run build`, um deine Astro-Website zu erzeugen:

```bash
npm run build
```
<PackageManagerTabs>
<Fragment slot="npm">
```shell
npm run build
```
</Fragment>
<Fragment slot="pnpm">
```shell
pnpm run build
```
</Fragment>
<Fragment slot="yarn">
```shell
yarn run build
```
</Fragment>
</PackageManagerTabs>

Die Build-Ausgabe wird standardmäßig ins Verzeichnis `dist/` geschrieben. Dieses Ziel kann über die [`outDir`-Konfigurationsoption](/de/reference/configuration-reference/#outdir) geändert werden.

Expand Down
18 changes: 17 additions & 1 deletion src/content/docs/de/recipes/add-yaml-support.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,31 @@ i18nReady: false
type: recipe
---

import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'

Astro baut auf Vite auf und unterstützt sowohl Vite- als auch Rollup-Plugins. Dieses Rezept verwendet ein Rollup-Plugin, um eine YAML-Datei (`.yml`) in Astro importieren zu können.

## Rezept

1. Installiere `@rollup/plugin-yaml`:

```bash
<PackageManagerTabs>
<Fragment slot="npm">
```shell
npm install @rollup/plugin-yaml --save-dev
```
</Fragment>
<Fragment slot="pnpm">
```shell
pnpm add @rollup/plugin-yaml --save-dev
```
</Fragment>
<Fragment slot="yarn">
```shell
yarn add @rollup/plugin-yaml --save-dev
```
</Fragment>
</PackageManagerTabs>

2. Importiere das Plugin in deine `astro.config.mjs` und füge es dem Vite Plugins-Array hinzu:

Expand Down
37 changes: 33 additions & 4 deletions src/content/docs/en/guides/deploy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ description: How to deploy your Astro site to the web.
i18nReady: true
---
import DeployGuidesNav from '~/components/DeployGuidesNav.astro';
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'

**Ready to build and deploy your Astro site?** Follow one of our guides to different deployment services or scroll down for general guidance about deploying an Astro site.

Expand Down Expand Up @@ -41,9 +42,23 @@ Some hosts will have their own command line interface (CLI) you can install glob

1. Install your host's CLI globally, for example:

```bash
<PackageManagerTabs>
<Fragment slot="npm">
```shell
npm install --global netlify-cli
```
</Fragment>
<Fragment slot="pnpm">
```shell
pnpm add --global netlify-cli
```
</Fragment>
<Fragment slot="yarn">
```shell
yarn global add netlify-cli
```
</Fragment>
</PackageManagerTabs>

1. Run the CLI and follow any instructions for authorization, setup etc.

Expand All @@ -67,9 +82,23 @@ You may also wish to build locally to preview your site, or to catch any potenti

Run the command `npm run build` to build your Astro site.

```bash
npm run build
```
<PackageManagerTabs>
<Fragment slot="npm">
```shell
npm run build
```
</Fragment>
<Fragment slot="pnpm">
```shell
pnpm run build
```
</Fragment>
<Fragment slot="yarn">
```shell
yarn run build
```
</Fragment>
</PackageManagerTabs>

By default, the build output will be placed at `dist/`. This location can be changed using the [`outDir` configuration option](/en/reference/configuration-reference/#outdir).

Expand Down
21 changes: 19 additions & 2 deletions src/content/docs/en/recipes/add-yaml-support.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,32 @@ i18nReady: true
type: recipe
---

import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'

Astro builds on top of Vite, and supports both Vite and Rollup plugins. This recipe uses a Rollup plugin to add the ability to import a YAML (`.yml`) file in Astro.

## Recipe

1. Install `@rollup/plugin-yaml`:
```bash

<PackageManagerTabs>
<Fragment slot="npm">
```shell
npm install @rollup/plugin-yaml --save-dev
```

</Fragment>
<Fragment slot="pnpm">
```shell
pnpm add @rollup/plugin-yaml --save-dev
```
</Fragment>
<Fragment slot="yarn">
```shell
yarn add @rollup/plugin-yaml --save-dev
```
</Fragment>
</PackageManagerTabs>

2. Import the plugin in your `astro.config.mjs` and add it to the Vite plugins array:

```js title="astro.config.mjs" ins={2,5-7}
Expand Down
16 changes: 16 additions & 0 deletions src/content/docs/en/recipes/external-links.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ i18nReady: true
type: recipe
---

import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'

Using a rehype plugin, you can identify and modify links in your Markdown files that point to external sites. This example adds icons to the end of each external link, so that visitors will know they are leaving your site.

## Prerequisites
Expand All @@ -14,9 +16,23 @@ Using a rehype plugin, you can identify and modify links in your Markdown files

1. Install the `rehype-external-links` plugin.

<PackageManagerTabs>
<Fragment slot="npm">
```shell
npm install rehype-external-links
```
</Fragment>
<Fragment slot="pnpm">
```shell
pnpm add rehype-external-links
```
</Fragment>
<Fragment slot="yarn">
```shell
yarn add rehype-external-links
```
</Fragment>
</PackageManagerTabs>

2. Import the plugin into your `astro.config.mjs` file.

Expand Down
37 changes: 33 additions & 4 deletions src/content/docs/es/guides/deploy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ description: Cómo desplegar tu sitio Astro en la web.
i18nReady: true
---
import DeployGuidesNav from '~/components/DeployGuidesNav.astro';
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'

**¿Listo para construir y desplegar tu proyecto Astro?** Sigue una de nuestras guías para diferentes servicios de despliegue o desplázate hacia abajo para obtener orientación general sobre el despliegue de un proyecto de Astro.

Expand Down Expand Up @@ -41,9 +42,23 @@ Algunos hosts tendrán su propia interfaz de línea de comandos (CLI) que puedes

1. Instala la CLI del host globalmente, por ejemplo:

```bash
<PackageManagerTabs>
<Fragment slot="npm">
```shell
npm install --global netlify-cli
```
</Fragment>
<Fragment slot="pnpm">
```shell
pnpm add --global netlify-cli
```
</Fragment>
<Fragment slot="yarn">
```shell
yarn global add netlify-cli
```
</Fragment>
</PackageManagerTabs>

1. Ejecuta la CLI y sigue las instrucciones de autorización, configuración, etc.

Expand All @@ -67,9 +82,23 @@ También es posible que desees compilar tu proyecto localmente para obtener una

Ejecuta el comando `npm run build` para construir tu proyecto Astro.

```bash
npm run build
```
<PackageManagerTabs>
<Fragment slot="npm">
```shell
npm run build
```
</Fragment>
<Fragment slot="pnpm">
```shell
pnpm run build
```
</Fragment>
<Fragment slot="yarn">
```shell
yarn run build
```
</Fragment>
</PackageManagerTabs>

De forma predeterminada, el resultado de compilación se colocará en `dist/`. Esta ubicación se puede cambiar usando la [opción de configuración `outDir`](/es/reference/configuration-reference/#outdir).

Expand Down
18 changes: 17 additions & 1 deletion src/content/docs/es/recipes/add-yaml-support.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,31 @@ i18nReady: true
type: recipe
---

import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'

Astro esta construido sobre Vite, y soporta plugins de Vite y Rollup. Esta receta usa un plugin de Rollup para añadir la habilidad de importar un archivo YAML (`.yml`) en Astro.

## Receta

1. Instala `@rollup/plugin-yaml`:

```bash
<PackageManagerTabs>
<Fragment slot="npm">
```shell
npm install @rollup/plugin-yaml --save-dev
```
</Fragment>
<Fragment slot="pnpm">
```shell
pnpm add @rollup/plugin-yaml --save-dev
```
</Fragment>
<Fragment slot="yarn">
```shell
yarn add @rollup/plugin-yaml --save-dev
```
</Fragment>
</PackageManagerTabs>

2. Importa el plugin en tu `astro.config.mjs` y añade el arreglo de plugins de Vite:

Expand Down
20 changes: 18 additions & 2 deletions src/content/docs/es/recipes/external-links.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ i18nReady: true
type: recipe
---

import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'

Usando un plugin de rehype, puedes identificar y modificar los enlaces en tus archivos Markdown que apuntan a sitios externos. Este ejemplo agrega iconos al final de cada enlace externo, para que los visitantes sepan que están saliendo de tu sitio.

## Prerrequesitos
Expand All @@ -14,11 +16,25 @@ Usando un plugin de rehype, puedes identificar y modificar los enlaces en tus ar

1. Instala el plugin `rehype-external-links`.

<PackageManagerTabs>
<Fragment slot="npm">
```shell
npm install rehype-external-links
```
</Fragment>
<Fragment slot="pnpm">
```shell
pnpm add rehype-external-links
```
</Fragment>
<Fragment slot="yarn">
```shell
yarn add rehype-external-links
```
</Fragment>
</PackageManagerTabs>

2. Importa el plugin en tu archivo `astro.config.mjs`.
2. Importa el plugin en tu archivo `astro.config.mjs`.

Pasa `rehypeExternalLinks` al array `rehypePlugins`, junto con un objeto de opciones que incluya una propiedad `content`. Si deseas agregar texto sin formato al final del enlace, establece el `type` de esta propiedad como `text`. Para agregar HTML en lugar de texto al final del enlace, establece el `type` de la propiedad como `raw`.

Expand Down Expand Up @@ -46,4 +62,4 @@ Usando un plugin de rehype, puedes identificar y modificar los enlaces en tus ar
:::

## Recursos
- [rehype-external-links](https://www.npmjs.com/package/rehype-external-links)
- [rehype-external-links](https://www.npmjs.com/package/rehype-external-links)
Loading
Loading