19 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/reference/errors/unknown-vite-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Unknown Vite Error.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | ## O que deu errado?
8 |
9 | Vite encontrou um erro desconhecido enquanto renderizava seu projeto. Nós infelizmente não sabemos o que aconteceu (senão teríamos contado!)
10 |
11 | Se você pode confiavelmente fazer com que esse erro aconteça, nós apreciaríamos se você pudesse [abrir uma issue](https://astro.build/issues/).
12 |
13 | **Veja Também:**
14 | - [Guia de solução de problemas do Vite](https://vitejs.dev/guide/troubleshooting.html)
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/reference/errors/unknown-compiler-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Unknown compiler error.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > Erro desconhecido do compilador. (E01000)
8 |
9 | ## O que deu errado?
10 |
11 | Astro encontrou um erro desconhecido enquanto compilava seus arquivos. Na maioria dos casos, isso não é sua culpa, mas sim um problema em nosso compilador.
12 |
13 | Se já não houver, por favor [crie uma issue](https://astro.build/issues/compiler).
14 |
15 | **Veja Também:**
16 | - [lista de issues de withastro/compiler](https://astro.build/issues/compiler)
17 |
18 |
19 |
--------------------------------------------------------------------------------
/public/logos/storyblok.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/public/logos/netlify.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/tutorial/puzzle-piece.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/src/content/docs/en/guides/cms/directus.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Directus & Astro
3 | description: Add content to your Astro project using Directus as a CMS
4 | type: cms
5 | stub: true
6 | service: Directus
7 | ---
8 |
9 | [Directus](https://directus.io/) is a backend-as-a-service which can be used to host data and content for your Astro project.
10 |
11 | ## Official Resources
12 | - Check out the official guide, [Get Started Building an Astro Website with Directus](https://directus.io/guides/get-started-building-an-astro-website-with-directus/).
13 | - Directus provides an [example Astro blog template](https://github.com/directus/examples/tree/main/astro).
14 |
15 | ## Community Resources
16 |
17 | - Add yours!
18 |
--------------------------------------------------------------------------------
/src/layouts/RecipeLayout.astro:
--------------------------------------------------------------------------------
1 | ---
2 | import type { MarkdownHeading } from 'astro';
3 | import RecipesNav from '~/components/RecipesNav.astro';
4 | import UIString from '~/components/UIString.astro';
5 | import type { RecipeEntry } from '~/content/config';
6 | import MainLayout from './MainLayout.astro';
7 |
8 | export interface Props {
9 | content: RecipeEntry['data'];
10 | headings: MarkdownHeading[];
11 | }
12 | ---
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
28 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/reference/errors/get-static-paths-removed-rsshelper.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: getStaticPaths RSS helper is not available anymore.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > **GetStaticPathsRemovedRSSHelper**: O utilitário de RSS foi removido de `getStaticPaths`. Tente o novo pacote @astrojs/rss no lugar. (E03012)
8 |
9 | ## O que deu errado?
10 |
11 | `getStaticPaths` não expõe mais um utilitário para gerar um feed RSS. Nós recomendamos migrar para a integração [@astrojs/rss](/pt-br/guides/rss/#configurando-astrojsrss) no lugar.
12 |
13 | **Veja Também:**
14 | - [Guia de RSS](/pt-br/guides/rss/)
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/components/tabs/UIFrameworkTabs.astro:
--------------------------------------------------------------------------------
1 | ---
2 | import Tabs from './Tabs';
3 | ---
4 |
5 |
6 | Preact
7 | React
8 | Solid
9 | Svelte
10 | Vue
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/components/tutorial/StackblitzIntro.astro:
--------------------------------------------------------------------------------
1 | ---
2 | interface Props {
3 | tree: string;
4 | compact?: boolean;
5 | }
6 |
7 | const { tree, compact } = Astro.props as Props;
8 |
9 | const file = 'src/pages/index.astro';
10 | const github = `https://github.com/${tree}`;
11 | const stackblitz = `https://stackblitz.com/github/${tree}?file=${file}`;
12 | ---
13 |
14 |
15 | You can find the code at this point in the tutorial on GitHub or
16 | StackBlitz.
17 |
18 | {
19 | compact !== true && (
20 |
21 | Check your code against this example, or if you've just joined us, fork on StackBlitz to start
22 | coding along in your browser from here.
23 |
24 | )
25 | }
26 |
--------------------------------------------------------------------------------
/public/logos/node.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/reference/errors/unknown-config-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Unknown configuration error.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | ## O que deu errado?
8 |
9 | Astro encontrou um erro desconhecido ao carregar seu arquivo de configuração Astro.
10 | Isso geralmenteo corre por um erro de sintaxe em sua configuração e a mensagem deve oferecer mais informações.
11 |
12 | Se você pode confiavelmente fazer com que esse erro aconteça, nós apreciaríamos se você pudesse [abrir uma issue](https://astro.build/issues/).
13 |
14 | **Veja Também:**
15 | - [Referência da Configuração](/pt-br/reference/configuration-reference/)
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/pages/[lang]/[...slug].astro:
--------------------------------------------------------------------------------
1 | ---
2 | import type { CollectionEntry } from 'astro:content';
3 | import { allPages } from '~/content';
4 | import LayoutSwitcher from '~/layouts/LayoutSwitcher.astro';
5 | import { getLangFromSlug, stripLangFromSlug } from '~/util';
6 |
7 | export async function getStaticPaths() {
8 | return allPages.map((page) => {
9 | const lang = getLangFromSlug(page.slug);
10 | const slug = stripLangFromSlug(page.slug);
11 | return { params: { lang, slug }, props: page };
12 | });
13 | }
14 |
15 | export type Props = CollectionEntry<'docs'>;
16 | const { data, render } = Astro.props;
17 | const { Content, headings } = await render();
18 | ---
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/components/tutorial/RightSidebar.astro:
--------------------------------------------------------------------------------
1 | ---
2 | import UIString from '../UIString.astro';
3 | import FeedbackButton from './FeedbackButton.astro';
4 | import TutorialNav from './TutorialNav.astro';
5 | ---
6 |
7 |
14 |
15 |
33 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/reference/errors/invalid-prerender-export.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Invalid prerender export.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > **Mensagens de erro de exemplo:**
8 | InvalidPrerenderExport: Uma exportação de `prerender` foi detectada, mas seu valor não pode ser analisado estaticamente. (E03019)
9 |
10 | ## O que deu errado?
11 |
12 | A funcionalidade `prerender` apenas suporta um subconjunto de JavaScript válido — certifique-se de usar exatamente `export const prerender = true` para que nosso compilador possa detectar essa diretiva em tempo de build. Variáveis e declarações `let` e `var` não são suportadas.
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/public/logos/contentful.svg:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/src/content/docs/ja/guides/deploy/surge.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: AstroサイトをSurgeにデプロイする
3 | description: surge.shを使ってAstroサイトをWebにデプロイする方法
4 | type: deploy
5 | i18nReady: true
6 | ---
7 |
8 | フロントエンド開発者向けに設計されたシングルコマンドのWeb公開プラットフォームである[Surge](https://surge.sh/)に、Astroサイトをデプロイできます。
9 |
10 | ## デプロイ方法
11 |
12 | 1. [Surge CLI](https://www.npmjs.com/package/surge)のインストールがまだであれば、ターミナルからグローバルにインストールします。
13 |
14 | ```shell
15 | npm install -g surge
16 | ```
17 |
18 | 2. プロジェクトのルートディレクトリからAstroサイトをビルドします。
19 |
20 | ```shell
21 | npm run build
22 | ```
23 |
24 | 3. CLIを使用してSurgeにデプロイします。
25 |
26 | ```shell
27 | surge dist
28 | ```
29 |
30 | デプロイ時に `surge dist yourdomain.com` を実行すると、[カスタムドメイン](http://surge.sh/help/adding-a-custom-domain) を使用できます。
31 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/reference/errors/client-address-not-available.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Astro.clientAddress is not available in current adapter.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > **ClientAddressNotAvailable**: `Astro.clientAddress` não está disponível no adaptador `NOME_ADAPTADOR`. Crie uma issue com o adaptador para adicionar suporte. (E03002)
8 |
9 | ## O que deu errado?
10 |
11 | O adaptador que você está utilizando infelizmente não suporta `Astro.clientAddress`.
12 |
13 | **Veja Também:**
14 | - [Integrações oficiais](/pt-br/guides/integrations-guide/#integrações-oficiais)
15 | - [Astro.clientAddress](/pt-br/reference/api-reference/#astroclientaddress)
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/unknown-markdown-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Unknown Markdown Error.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | ## ¿Qué salió mal?
13 | Astro encontró un error desconocido al analizar el Markdown. A menudo, esto se debe a un error de sintaxis y el mensaje de error debe contener más información.
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/reference/errors/content-schema-contains-slug-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Content Schema should not contain slug.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > O esquema de uma coleção de conteúdo não deve conter `slug` já que é reservado para a geração de slugs. Remova-o do esquema da coleção `NOME_COLEÇÃO`. (E09003)
8 |
9 | ## O que deu errado?
10 |
11 | O esquema de uma coleção de conteúdo não deve conter o campo `slug`. Ele é reservado pelo Astro para gerar slugs das entradas. Remova o campo `slug` do seu esquema ou escolha um nome diferente.
12 |
13 | **Veja Também:**
14 | - [O campo de entrada reservado `slug`](/pt-br/guides/content-collections/)
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/content/docs/zh-cn/reference/errors/only-response-can-be-returned.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Invalid type returned by Astro page.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > 路由页面返回了一个错误的返回值 `RETURNED_VALUE`。在 Astro 文件中只能返回 `Response`。(E03005)
8 |
9 | ## 哪里出了问题?
10 | 在 Astro 文件中只能返回 [Response](https://developer.mozilla.org/zh-CN/docs/Web/API/Response) 的实例。
11 | ```astro title="pages/login.astro"
12 | ---
13 | return new Response(null, {
14 | status: 404,
15 | statusText: 'Not found'
16 | });
17 |
18 | // 对于重定向,Astro.redirect 同样也会返回一个 Response 的实例
19 | return Astro.redirect('/login');
20 | ---
21 | ```
22 |
23 | **请参阅:**
24 | - [Response](/zh-cn/guides/server-side-rendering/#response)
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/content/docs/en/guides/cms/builderio.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Builder.io & Astro
3 | description: Add content to your Astro project using Builder.io’s visual CMS
4 | type: cms
5 | service: Builder.io
6 | stub: true
7 | ---
8 | import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro'
9 |
10 |
11 |
12 | [Builder.io](https://www.builder.io/) is a visual CMS that supports drag and drop content editing for building web sites.
13 |
14 | ## Official Resources
15 |
16 | - Check out [the official Builder.io starter project](https://github.com/BuilderIO/builder/tree/main/examples/astro-solidjs), which uses Astro and SolidJS
17 |
18 | ## Community Resources
19 |
20 | - Read [Connecting Builder.io's Visual CMS to Astro](https://www.hamatoyogi.dev/blog/astro-log/connecting-builderio-to-astro) by Yoav Ganbar
21 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/unknown-csserror.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Unknown CSS Error.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | ## ¿Qué salió mal?
13 | Astro encontró un error desconocido al analizar el CSS. A menudo, esto se debe a un error de sintaxis y el mensaje de error debe contener más información.
14 |
15 | **Ver también:**
16 | - [Estilos & CSS](/es/guides/styling/)
17 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/reference/errors/failed-to-load-module-ssr.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Could not import file.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > **FailedToLoadModuleSSR**: Não foi possível importar `NOME_IMPORT`. (E04001)
8 |
9 | ## O que deu errado?
10 |
11 | O Astro não podê importar o arquivo pedido. Frequentemente, isso é causado pelo caminho da importação estar errado (seja pelo arquivo não existir ou por um erro na digitação do caminho)
12 |
13 | Essa mensagem também pode aparecer quando um tipo é importado sem especificar de que é uma [importação de tipo](/pt-br/guides/typescript/#importações-de-tipos).
14 |
15 | **Veja Também:**
16 | - [Importações de Tipos](/pt-br/guides/typescript/#importações-de-tipos)
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/reference/errors/markdown-frontmatter-parse-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Failed to parse Markdown frontmatter.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > **Mensagens de erro de exemplo:**
8 | não é possível ler um par de mapeamento implícito; está faltando um dois pontos
9 | fim de stream inesperado em uma scalar entre aspas duplas
10 | não é possível ler uma entrada de mapeamento de bloco; uma chave multilinha não pode ser ser uma chave implícita (E06001)
11 |
12 | ## O que deu errado?
13 |
14 | Astro encontrou um erro enquanto fazia parse do frontmatter do seu arquivo Markdown.
15 | Isso é geralmente causado por um erro na sintaxe, como esquecer um dois pontos ou uma aspas final.
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/components/Badge.astro:
--------------------------------------------------------------------------------
1 | ---
2 | export interface Props {
3 | variant?: 'neutral' | 'accent';
4 | }
5 | const { variant = 'neutral' } = Astro.props as Props;
6 | ---
7 |
8 |
9 |
10 |
35 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/reference/errors/no-client-only-hint.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Missing hint on client:only directive.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > **NoClientOnlyHint**: Incapaz de renderizar `NOME_COMPONENTE`. Ao utilizar a estratégia de hidratação `client:only`, Astro precisa de uma dica para utilizar o renderizador correto. (E03009)
8 |
9 | ## O que deu errado?
10 |
11 | Componentes `client:only` não são executados no servidor, portanto o Astro não sabe (e não pode adivinhar) qual renderizador utilizar e precisa de uma dica. Desse jeito:
12 |
13 | ```astro
14 |
15 | ```
16 |
17 | **Veja Também:**
18 | - [`client:only`](/pt-br/reference/directives-reference/#clientonly)
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/content/docs/zh-cn/reference/errors/static-redirect-not-available.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Astro.redirect is not available in static mode.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > **StaticRedirectNotAvailable**: 重定向仅在设置 `output: 'server'` 时可用. 如果您需要使用 SSR 的功能,请更新您的 Astro 配置。(E03001)
8 |
9 | ## 哪里出了问题?
10 | 只有在启用[服务端渲染](/zh-cn/guides/server-side-rendering/)时,`Astro.redirect` 函数才可用。
11 |
12 | 如要在静态网站上重定向,可以使用 [meta 标签的 refresh 属性](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/meta)。某些站点托管平台也会提供基于配置的重定向(例如:[Netlify 重定向](https://docs.netlify.com/routing/redirects/))。
13 |
14 | **请参阅:**
15 | - [在您的项目中启用SSR](/zh-cn/guides/server-side-rendering/#启用-ssr)
16 | - [Astro.redirect](/zh-cn/guides/server-side-rendering/#astroredirect)
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/reference/errors/invalid-frontmatter-injection-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Invalid frontmatter injection.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > **InvalidFrontmatterInjectionError**: Um plugin remark ou rehype tentou injetar frontmatter inválido. Garanta que "astro.frontmatter" é definido como um objeto JSON válido que não é `null` nem `undefined`. (E06003)
8 |
9 | ## O que deu errado?
10 |
11 | Um plugin remark ou rehype tentou injetar frontmatter inválido. Isso ocorre quando "astro.frontmatter" é definido como `null`, `undefined` ou como um objeto JSON inválido.
12 |
13 | **Veja Também:**
14 | - [Modificando frontmatter programaticamente](/pt-br/guides/markdown-content/#modificando-frontmatter-programaticamente)
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/unknown-clierror.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Unknown CLI Error.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | ## ¿Qué salió mal?
13 | Astro encontró un error desconocido mientras iniciaba uno de tus comandos CLI. El mensaje de error debe contener más información.
14 |
15 | Si puedes reproducir este error de forma consistente, nos gustaría que [abrieras un issue](https://astro.build/issues/)
16 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/reference/errors/missing-media-query-directive.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Missing value for client:media directive.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > **MissingMediaQueryDirective**: Media query não foi providenciada para a diretiva `client:media`. Uma media query similar a `client:media="(max-width: 600px)"` deve ser providenciada (E03006)
8 |
9 | ## O que deu errado?
10 |
11 | Um parâmetro de [media query](https://developer.mozilla.org/pt-BR/docs/Web/CSS/Media_Queries/Using_media_queries) é obrigatório quando se utiliza a diretiva `client:media`.
12 |
13 | ```astro
14 |
15 | ```
16 |
17 | **Veja Também:**
18 | - [`client:media`](/pt-br/reference/directives-reference/#clientmedia)
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/reference/errors/no-matching-static-path-found.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: No static path found for requested path.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > **NoMatchingStaticPathFound**: Um padrão de rota `getStaticPaths()` foi correspondido, mas nenhum caminho estático correspondente foi encontrado para o caminho requisitado `NOME_CAMINHO`. (E03004)
8 |
9 | ## O que deu errado?
10 |
11 | Uma [rota dinâmica](/pt-br/core-concepts/routing/#rotas-dinâmicas) foi correspondida, mas nenhum caminho correspondente foi encontrado para o parâmetros requisitados. Isso é geralmente causado por um erro de digitação no caminho requisitado ou gerado.
12 |
13 | **Veja Também:**
14 | - [getStaticPaths()](/pt-br/reference/api-reference/#getstaticpaths)
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/util/getGithubEditUrl.ts:
--------------------------------------------------------------------------------
1 | import type { AstroGlobal } from 'astro';
2 | import { getLanguageFromURL } from '../util';
3 |
4 | /** Gets the URL to edit the page on GitHub */
5 |
6 | export function getGithubEditUrl(Astro: Readonly) {
7 | const { content = {} } = Astro.props;
8 | const isFallback = !!Astro.params.fallback;
9 | const currentPage = Astro.url.pathname;
10 | const lang = getLanguageFromURL(currentPage);
11 | const filePath = `src/content/docs${currentPage.replace(/\/$/, '')}.mdx`;
12 | const currentFile = isFallback ? filePath.replace(`/${lang}/`, '/en/') : filePath;
13 | const githubEditUrl =
14 | content.githubURL && (lang === 'en' || isFallback)
15 | ? `${content.githubURL}${content.hasREADME ? 'README.md' : ''}`
16 | : `https://github.com/withastro/docs/blob/main/${currentFile}`;
17 |
18 | return githubEditUrl;
19 | }
20 |
--------------------------------------------------------------------------------
/public/logos/gridsome.svg:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/reference/errors/no-client-entrypoint.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: No client entrypoint specified in renderer.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > **NoClientEntrypoint**: Componente `NOME_COMPONENTE` tem uma diretiva `client:DIRETIVA_CLIENTE`, mas nenhum entrypoint do cliente foi fornecido por `NOME_RENDERIZADOR`. (E03008)
8 |
9 | ## O que deu errado?
10 |
11 | Astro tentou hidratar um componente no cliente, mas o renderizador utilizado não fornece um entrypoint do cliente para utilizar para hidratação.
12 |
13 | **Veja Também:**
14 | - [Opção addRenderer](/pt-br/reference/integrations-reference/#opção-addrenderer)
15 | - [Hidratando componentes de frameworks](/pt-br/core-concepts/framework-components/#hidratando-componentes-interativos)
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/content/docs/zh-cn/reference/errors/static-client-address-not-available.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Astro.clientAddress is not available in static mode.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > **StaticClientAddressNotAvailable**: `Astro.clientAddress` 仅在设置 `output: 'server'` 时可用. 如果您需要使用 SSR 的功能,请更新您的 Astro 配置。(E03003)
8 |
9 | ## 哪里出了问题?
10 | 只有在启用[服务端渲染](/zh-cn/guides/server-side-rendering/)时,`Astro.clientAddress` 属性才可用。
11 |
12 | 如要在静态模式下获取用户的IP地址,您可以在[客户端脚本](/zh-cn/core-concepts/astro-components/#客户端脚本) 中使用类似于 [Ipify](https://www.ipify.org/) 等不同的API,或者您可以使用托管在服务提供商处的无服务器 (serverless) 函数来获取用户的IP。
13 |
14 | **请参阅:**
15 | - [在您的项目中启用SSR](/zh-cn/guides/server-side-rendering/#启用-ssr)
16 | - [Astro.clientAddress](/zh-cn/reference/api-reference/#astroclientaddress)
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/components/NavGrid/Grid.astro:
--------------------------------------------------------------------------------
1 | ---
2 | export interface Props {
3 | minimal?: boolean;
4 | }
5 |
6 | const { minimal } = Astro.props as Props;
7 | ---
8 |
9 |
10 |
11 |
12 |
13 |
37 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/reference/errors/no-adapter-installed.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cannot use Server-side Rendering without an adapter.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > **NoAdapterInstalled**: Não é possível utilizar `output: 'server'` sem um adaptador. Por favor instale e configure o adaptador de servidor apropriado para seu deploy. (E03017)
8 |
9 | ## O que deu errado?
10 |
11 | Para utilizar renderização no lado do servidor, um adaptador precisa ser instalado para que o Astro saiba como gerar o resultado apropriado para sua plataforma de deploy desejada.
12 |
13 | **Veja Também:**
14 | - [Renderização no lado do Servidor](/pt-br/guides/server-side-rendering/)
15 | - [Adicionando um Adaptador](/pt-br/guides/server-side-rendering/#adicionando-um-adaptador)
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/components/Footer/Footer.astro:
--------------------------------------------------------------------------------
1 | ---
2 | import UIString from '../UIString.astro';
3 | ---
4 |
5 |
14 |
15 |
42 |
--------------------------------------------------------------------------------
/public/logos/buttercms.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/public/logos/directus.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/csssyntax-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: CSS Syntax Error.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | > **Ejemplos de mensajes de error:**
13 | CSSSyntaxError: Missed semicolon
14 | CSSSyntaxError: Unclosed string (E05001)
15 |
16 | ## ¿Qué salió mal?
17 |
18 | Astro encontró un error al analizar el CSS debido a un error de sintaxis. Esto a menudo es causado por la falta de un punto y coma.
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/unknown-markdown-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Unknown Markdown Error.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | ## What went wrong?
17 | Astro encountered an unknown error while parsing your Markdown. Oftentimes, this is caused by a syntax error and the error message should contain more information.
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/reference/errors/invalid-get-static-paths-return.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Invalid value returned by getStaticPaths.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > **InvalidGetStaticPathsReturn**: Tipo inválido retornado por `getStaticPaths`. Esperava uma `array`, recebeu um `TIPO_RETORNO` (E03011)
8 |
9 | ## O que deu errado?
10 |
11 | O valor retornado por `getStaticPaths` deve ser um array de objetos.
12 |
13 | ```ts title="pages/blog/[id].astro"
14 | export async function getStaticPaths() {
15 | return [ // <-- Array
16 | { params: { slug: "blog" } },
17 | { params: { slug: "about" } }
18 | ];
19 | }
20 | ```
21 |
22 | **Veja Também:**
23 | - [`getStaticPaths()`](/pt-br/reference/api-reference/#getstaticpaths)
24 | - [`params`](/pt-br/reference/api-reference/#params)
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/config-legacy-key.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Legacy configuration detected
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | > **ConfigLegacyKey**: Configuración antigua detectada: `LEGACY_CONFIG_KEY`. (E07002)
13 |
14 | ## ¿Qué salió mal?
15 |
16 | Astro detectó una opción de configuración antigua en tu archivo de configuración.
17 |
18 | **Ver también:**
19 |
20 | - [Referencia de configuración](/es/reference/configuration-reference/)
21 |
22 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/page-number-param-not-found.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Page number param not found.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | > **PageNumberParamNotFound**: El parámetro número de página de [paginate()] no fue encontrado en su ruta de archivo. (E03021)
13 |
14 | ## ¿Qué salió mal?
15 | El parámetro número de página no fue encontrado en su ruta de archivo.
16 |
17 | **See Also:**
18 | - [Pagination](/es/core-concepts/routing/#paginación)
19 |
--------------------------------------------------------------------------------
/src/content/docs/en/guides/cms/sanity.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Sanity & Astro
3 | description: Add content to your Astro project using Sanity as a CMS
4 | type: cms
5 | stub: true
6 | service: Sanity
7 | ---
8 |
9 | [Sanity](http://sanity.io) is a headless content management system that focuses on [structured content](https://www.sanity.io/structured-content-platform).
10 |
11 | ## Official Resources
12 |
13 | - [Build your blog with Astro and Sanity](https://www.sanity.io/guides/sanity-astro-blog)
14 |
15 | ## Community Resources
16 |
17 | - Use the [`astro-sanity` integration](https://github.com/littlesticks/astro-sanity) to add Sanity to your project.
18 |
19 | - You can get started with the [Astro Sanity Minimal Starter](https://github.com/littlesticks/astro-sanity-minimal-starter).
20 |
21 | - Video: [Create your own Blog with Astro and Sanity.io](https://www.youtube.com/watch?v=-jAWLTfsSQw) by Jaydan Urwin
22 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/reference/errors/markdown-content-schema-validation-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Content collection frontmatter invalid.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > **Mensagens de erro de exemplo:**
8 | Não foi possível fazer parse do frontmatter em **blog** → **postagem.md**
9 | "titulo" é obrigatório.
10 | "data" deve ser uma data válida. (E06002)
11 |
12 | ## O que deu errado?
13 |
14 | O frontmatter de um documento Markdown em `src/content/` não corresponde ao esquema de sua coleção.
15 | Certifique-se de que todos os campos obrigatórios estão presentes e possuem os tipos corretos.
16 | Você pode verificar contra o esquema da coleção em seu arquivo `src/content/config.*`.
17 | Veja a [documentação de coleções de conteúdo](/pt-br/guides/content-collections/) para mais informação.
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/invalid-glob.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Invalid glob pattern.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | > **InvalidGlob**: Patrón glob inválido: `GLOB_PATTERN`. Los patrones glob deben comenzar con './', '../' o '/'. (E04002)
13 |
14 | ## ¿Qué salió mal?
15 |
16 | Astro encontró un patrón glob inválido. Esto se debe a que el patrón glob no es una ruta de archivo válida.
17 |
18 | **Ver también:**
19 |
20 | - [Patrónes glob](/es/guides/imports/#patrones-glob)
21 |
22 |
--------------------------------------------------------------------------------
/src/content/docs/zh-cn/guides/deploy/google-firebase.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: 部署你的 Astro 站点至 Google Firebase 托管
3 | description: How to deploy your Astro site to the web using Google’s Firebase Hosting.
4 | i18nReady: true
5 | ---
6 |
7 | [Firebase 托管](https://firebase.google.com/products/hosting) 是由 Google 的 [Firebase](https://firebase.google.com/) 应用开发平台提供的一项服务, 可用于部署 Astro 站点。
8 |
9 | ## 如何部署
10 |
11 | 1. 确保你已安装 [firebase-tools](https://www.npmjs.com/package/firebase-tools)。
12 |
13 | 2. 在你的项目根目录下分别创建 `firebase.json` 和 `.firebaserc` 两个文件,文件内容为:
14 |
15 | `firebase.json`:
16 |
17 | ```json
18 | {
19 | "hosting": {
20 | "public": "dist",
21 | "ignore": []
22 | }
23 | }
24 | ```
25 |
26 | `.firebaserc`:
27 |
28 | ```json
29 | {
30 | "projects": {
31 | "default": ""
32 | }
33 | }
34 | ```
35 |
36 | 3. 运行 `npm run build` 后,使用 `firebase deploy` 命令部署。
37 |
--------------------------------------------------------------------------------
/src/content/docs/en/guides/deploy/surge.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Deploy your Astro Site to Surge
3 | description: How to deploy your Astro site to the web using surge.sh
4 | type: deploy
5 | i18nReady: true
6 | ---
7 |
8 | You can deploy your Astro project to [Surge](https://surge.sh/) a single-command web publishing platform designed for front-end developers.
9 |
10 | ## How to deploy
11 |
12 | 1. Install [the Surge CLI](https://www.npmjs.com/package/surge) globally from the Terminal, if you haven't already.
13 |
14 | ```shell
15 | npm install -g surge
16 | ```
17 |
18 | 2. Build your Astro site from your project’s root directory.
19 |
20 | ```shell
21 | npm run build
22 | ```
23 |
24 | 3. Deploy to Surge using the CLI.
25 |
26 | ```shell
27 | surge dist
28 | ```
29 |
30 | You can use a [custom domain](http://surge.sh/help/adding-a-custom-domain) when deploying by running `surge dist yourdomain.com`.
31 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/unknown-csserror.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Unknown CSS Error.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | ## What went wrong?
17 | Astro encountered an unknown error while parsing your CSS. Oftentimes, this is caused by a syntax error and the error message should contain more information.
18 |
19 | **See Also:**
20 | - [Styles and CSS](/en/guides/styling/)
21 |
22 |
23 |
--------------------------------------------------------------------------------
/.github/workflows/format.yml:
--------------------------------------------------------------------------------
1 | name: 'Format Code'
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 |
8 | jobs:
9 | format:
10 | runs-on: ubuntu-latest
11 | env:
12 | NODE_OPTIONS: "--max_old_space_size=4096"
13 | steps:
14 | - name: Check out code using Git
15 | uses: actions/checkout@v3
16 | with:
17 | ref: ${{ github.head_ref }}
18 | # Needs access to push to main
19 | token: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
20 | - name: Install Tools & Dependencies
21 | uses: ./.github/actions/install
22 | - name: Format code
23 | run: pnpm run format:ci
24 | - name: Commit changes
25 | uses: stefanzweifel/git-auto-commit-action@v4
26 | with:
27 | commit_message: '[ci] format'
28 | branch: ${{ github.head_ref }}
29 | commit_user_name: fredkbot
30 | commit_user_email: fred+astrobot@astro.build
31 |
--------------------------------------------------------------------------------
/public/logos/svelte.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/generate-content-types-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Failed to generate content types.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | > **GenerateContentTypesError**: El comando `astro sync` no pudo generar tipos de colección de contenido. (E08001)
13 |
14 | ## ¿Qué salió mal?
15 |
16 | El comando `astro sync` no pudo generar tipos de colección de contenido.
17 |
18 | **Ver también:**
19 |
20 | - [Documentación de colecciones de contenido](/es/guides/content-collections/)
21 |
22 |
--------------------------------------------------------------------------------
/public/logos/gitlab.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/logos/sveltekit.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/public/logos/wordpress.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/reference/errors/invalid-content-entry-frontmatter-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Content entry frontmatter does not match schema.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > **Mensagens de erro de exemplo:**
8 | **blog** → **postagem.md** frontmatter não corresponde ao esquema da coleção.
9 | "titulo" é obrigatório.
10 | "data" deve ser uma data válida. (E09001)
11 |
12 | ## O que deu errado?
13 |
14 | Uma entrada Markdown ou MDX em `src/content/` não corresponde ao esquema de sua coleção.
15 | Certifique-se de que todos os campos obrigatórios estão presentes, e de que todos os campos estão com os tipos corretos.
16 | Você pode verificar contra o esquema da coleção no seu arquivo `src/content/config.*`.
17 | Veja a [documentação de coleções de conteúdo](/pt-br/guides/content-collections/) para mais informações.
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/reference/errors/only-response-can-be-returned.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Invalid type returned by Astro page.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > Rota retornou um `VALOR_RETORNADO`. Apenas uma Response pode ser retornada de arquivos Astro. (E03005)
8 |
9 | ## O que deu errado?
10 |
11 | Apenas instâncias de [Response](https://developer.mozilla.org/pt-BR/docs/Web/API/Response) podem ser retornadas dentro de arquivos Astro.
12 |
13 | ```astro title="pages/login.astro"
14 | ---
15 | return new Response(null, {
16 | status: 404,
17 | statusText: 'Não encontrado'
18 | });
19 |
20 | // Alternativamente, para redirecionamentos, Astro.redirect também retorna uma instância de Response
21 | return Astro.redirect('/login');
22 | ---
23 | ```
24 |
25 | **Veja Também:**
26 | - [Response](/pt-br/guides/server-side-rendering/#response)
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/config-not-found.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Specified configuration file not found.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | > **ConfigNotFound**: No se puede resolver `--config "CONFIG_FILE"`. ¿Existe este archivo? (E07001)
13 |
14 | ## ¿Qué salió mal?
15 |
16 | No se pudo encontrar el archivo de configuración especificado usando `--config`. Asegúrate que este existe o que la ruta es correcta.
17 |
18 | **Ver también:**
19 |
20 | - [--config](/es/reference/cli-reference/#--config-path)
21 |
22 |
--------------------------------------------------------------------------------
/src/content/docs/ja/guides/deploy/google-firebase.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: AstroサイトをGoogleのFirebase Hostingにデプロイする
3 | description: GoogleのFirebase HostingによりAstroサイトをウェブにデプロイする方法。
4 | type: deploy
5 | i18nReady: true
6 | ---
7 |
8 | Googleのアプリ開発プラットフォーム[Firebase](https://firebase.google.com/)が提供するサービス[Firebase Hosting](https://firebase.google.com/products/hosting)で、Astroサイトをデプロイできます。
9 |
10 | ## デプロイ方法
11 |
12 | 1. [firebase-tools](https://www.npmjs.com/package/firebase-tools)がインストールされていることを確認してください。
13 |
14 | 2. `firebase.json`と`.firebaserc`をプロジェクトのルートに作成し、次の内容を記入します。
15 |
16 | `firebase.json`:
17 |
18 | ```json
19 | {
20 | "hosting": {
21 | "public": "dist",
22 | "ignore": []
23 | }
24 | }
25 | ```
26 |
27 | `.firebaserc`:
28 |
29 | ```json
30 | {
31 | "projects": {
32 | "default": ""
33 | }
34 | }
35 | ```
36 |
37 | 3. `npm run build`の実行後、`firebase deploy`コマンドを使用してデプロイします。
38 |
--------------------------------------------------------------------------------
/scripts/lib/github-get.mjs:
--------------------------------------------------------------------------------
1 | import fetch from 'node-fetch';
2 | import pRetry, { AbortError } from 'p-retry';
3 |
4 | /**
5 | * Fetch a URL from the GitHub API and resolve its JSON response.
6 | * @param {{ url: string; githubToken?: string }} options
7 | * @returns {Promise}
8 | */
9 | export async function githubGet({ url, githubToken = undefined }) {
10 | return await pRetry(
11 | async () => {
12 | const headers = {
13 | Accept: 'application/vnd.github.v3+json',
14 | };
15 | if (githubToken) {
16 | headers.Authorization = `token ${githubToken}`;
17 | }
18 | const response = await fetch(url, { headers });
19 | const json = await response.json();
20 |
21 | if (!response.ok) {
22 | throw new AbortError(
23 | `GitHub API call failed: GET "${url}" returned status ${
24 | response.status
25 | }: ${JSON.stringify(json)}`
26 | );
27 | }
28 |
29 | return json;
30 | },
31 | { retries: 5 }
32 | );
33 | }
34 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/unknown-content-collection-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Unknown Content Collection Error.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | ## ¿Qué salió mal?
13 | Astro encontró un error desconocido al cargar tus colecciones de contenido.
14 | Esto pudo haber sido causado por ciertos errores dentro de tu archivo `src/content/config.ts` o algunos errores internos.
15 |
16 | Si puedes reproducir este error de forma consistente, nosotros apreciaríamos si pudieras [abrir un issue](https://astro.build/issues/)
17 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/reference/errors/invalid-get-static-path-param.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Invalid value returned by a getStaticPaths path.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > **InvalidGetStaticPathParam**: Parâmetros inválidos dados ao caminho de `getStaticPaths`. Esperava um `object`, recebeu um `TIPO_PARÂMETRO` (E03010)
8 |
9 | ## O que deu errado?
10 |
11 | A propriedade `params` no valor retornado de `getStaticPaths` (um array de objetos) também deve ser um objeto.
12 |
13 | ```astro title="pages/blog/[id].astro"
14 | ---
15 | export async function getStaticPaths() {
16 | return [
17 | { params: { slug: "blog" } },
18 | { params: { slug: "sobre" } }
19 | ];
20 | }
21 | ---
22 | ```
23 |
24 | **Veja Também:**
25 | - [`getStaticPaths()`](/pt-br/reference/api-reference/#getstaticpaths)
26 | - [`params`](/pt-br/reference/api-reference/#params)
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/csssyntax-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: CSS Syntax Error.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | > **Example error messages:**
17 | CSSSyntaxError: Missed semicolon
18 | CSSSyntaxError: Unclosed string (E05001)
19 |
20 | ## What went wrong?
21 | Astro encountered an error while parsing your CSS, due to a syntax error. This is often caused by a missing semicolon.
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/unknown-clierror.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Unknown CLI Error.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | ## What went wrong?
17 | Astro encountered an unknown error while starting one of its CLI commands. The error message should contain more information.
18 |
19 | If you can reliably cause this error to happen, we'd appreciate if you could [open an issue](https://astro.build/issues/)
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/util.ts:
--------------------------------------------------------------------------------
1 | import type { CollectionEntry } from 'astro:content';
2 |
3 | export function getLanguageFromURL(pathname: string) {
4 | const langCodeMatch = pathname.match(/\/([a-z]{2}-?[a-z]{0,2})\//);
5 | return langCodeMatch ? langCodeMatch[1] : 'en';
6 | }
7 |
8 | /** Remove \ and / from beginning of string */
9 | export function removeLeadingSlash(path: string) {
10 | return path.replace(/^[/\\]+/, '');
11 | }
12 |
13 | /** Remove \ and / from end of string */
14 | export function removeTrailingSlash(path: string) {
15 | return path.replace(/[/\\]+$/, '');
16 | }
17 |
18 | /** Get a page’s slug, without the language prefix (e.g. `'en/migrate'` => `'migrate'`). */
19 | export const stripLangFromSlug = (slug: CollectionEntry<'docs'>['slug']) =>
20 | slug.split('/').slice(1).join('/');
21 |
22 | /** Get a page’s lang tag from its slug (e.g. `'en/migrate'` => `'en'`). */
23 | export const getLangFromSlug = (slug: CollectionEntry<'docs'>['slug']) => slug.split('/')[0];
24 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/invalid-content-entry-slug-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Invalid content entry slug.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | STRING(COLLECTION) → STRING(ENTRY_ID) tiene un slug no válido. El campo `slug` debe ser un string. (E09002)
13 |
14 | ## ¿Qué salió mal?
15 | Un archivo en `src/content/` tiene un `slug` no válido. Este campo está reservado para generar slugs y debe ser un string cuando está presente.
16 |
17 | **Ver también:**
18 | - [La propipedad reservada `slug`](/es/guides/content-collections/)
19 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/unknown-vite-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Unknown Vite Error.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | ## ¿Qué salió mal?
13 | Vite encontró un error desconocido mientras renderizaba tu proyecto. Desafortunadamente no sabemos qué pasó (o ¡te lo diríamos!)
14 |
15 | Si puedes reproducir de forma confiable este error, nos gustaría que [abrieras una issue](https://astro.build/issues/)
16 |
17 | **Ver también:**
18 | - [Guía de solución de problemas de Vite](https://vitejs.dev/guide/troubleshooting.html)
19 |
20 |
--------------------------------------------------------------------------------
/scripts/lib/filter-warnings.cjs:
--------------------------------------------------------------------------------
1 | /**
2 | * When using custom loaders like `tsm` to add TypeScript & module support to scripts,
3 | * Node.js outputs a known set of warnings, which distract from the actual script output.
4 | *
5 | * By adding `--require=./scripts/lib/filter-warnings.cjs` to the `node` or `tsm` args,
6 | * this script filters those known warnings (but not any others) from the output.
7 | */
8 |
9 | // Remove Node's built-in `warning` listener which outputs all warnings to stderr
10 | process.removeAllListeners('warning');
11 |
12 | // Add our own version that skips known warnings
13 | process.on('warning', (warning) => {
14 | let { name, message } = warning;
15 | if (
16 | name === 'ExperimentalWarning' &&
17 | (message.indexOf('--experimental-loader') > -1 || message.indexOf('Custom ESM Loaders') > -1)
18 | )
19 | return;
20 | if (name === 'DeprecationWarning' && message.indexOf('Obsolete loader hook') > -1) return;
21 |
22 | console.warn(warning);
23 | });
24 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/config-legacy-key.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Legacy configuration detected.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | > **ConfigLegacyKey**: Legacy configuration detected: `LEGACY_CONFIG_KEY`. (E07002)
17 |
18 | ## What went wrong?
19 | Astro detected a legacy configuration option in your configuration file.
20 |
21 | **See Also:**
22 | - [Configuration reference](/en/reference/configuration-reference/)
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/no-matching-import.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: No import found for component.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | > **NoMatchingImport**: No se pudo procesar el `COMPONENT_NAME`. No se ha encontrado ninguna importación coincidente para `COMPONENT_NAME`. (E03018)
13 |
14 | ## ¿Qué salió mal?
15 |
16 | No se encontró ninguna declaración de importación para uno de los componentes. Si hay una declaración de importación, asegúrese de estar usando el mismo identificador tanto en las importaciones como en el componente.
17 |
--------------------------------------------------------------------------------
/src/content/docs/en/guides/cms/spinal.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Spinal & Astro
3 | description: Add content to your project using Spinal as your CMS.
4 | type: cms
5 | stub: true
6 | service: Spinal
7 | ---
8 |
9 | [Spinal](https://spinalcms.com/cms-for-astro/) is a commercial, SaaS-focused, Git-based CMS.
10 |
11 | ## Getting started
12 |
13 | 1. [Create a Spinal account](https://spinalcms.com/signup/).
14 | 2. Connect your GitHub account to Spinal.
15 | 3. Select your Astro repository when prompted.
16 |
17 | All Markdown content from the selected folder will be imported into your Spinal account and is ready to be edited.
18 |
19 | ## Official Resources
20 | - [Documentation theme built for Astro with Tailwind CSS](https://spinalcms.com/resources/astro-documentation-theme-with-tailwind-css/)
21 | ## Production Sites
22 |
23 | The following sites use Astro + Spinal in production:
24 |
25 | - [spinalcms.com](https://spinalcms.com/) (all blog articles, documentation, changelog, feature pages, etc.)
26 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/page-number-param-not-found.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Page number param not found.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | > **PageNumberParamNotFound**: [paginate()] page number param `PARAM_NAME` not found in your filepath. (E03021)
17 |
18 | ## What went wrong?
19 | The page number parameter was not found in your filepath.
20 |
21 | **See Also:**
22 | - [Pagination](/en/core-concepts/routing/#pagination)
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/reserved-slot-name.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Invalid slot name.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | > **ReservedSlotName**: No se puede crear un slot llamado `SLOT_NAME`. `SLOT_NAME` es un nombre de espacio reservado. Actualice el nombre de este espacio. (E03016)
13 |
14 | ## ¿Qué salió mal?
15 |
16 | Ciertas palabras no se pueden usar para los nombres de los slots debido a que ya se usan internamente.
17 |
18 | **Ver también:**
19 |
20 | - [Slots con nombre](/es/core-concepts/astro-components/#slots-con-nombre)
21 |
22 |
--------------------------------------------------------------------------------
/src/content/docs/es/guides/deploy/surge.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Despliega tu proyecto de Astro en Surge
3 | description: Cómo desplegar tu proyecto de Astro usando surge.sh
4 | type: deploy
5 | i18nReady: true
6 | ---
7 |
8 | Puedes desplegar tu proyecto de Astro en [Surge](https://surge.sh/), una plataforma diseñada para desarrolladores front-end para publicar sitios web usando solo un comando.
9 |
10 | ## Cómo desplegar
11 |
12 | 1. Instala [la CLI de Surge](https://www.npmjs.com/package/surge) de forma global desde la Terminal, si aún no lo has hecho.
13 |
14 | ```shell
15 | npm install -g surge
16 | ```
17 |
18 | 2. Construye tu sitio de Astro desde el directorio raíz de tu proyecto.
19 |
20 | ```shell
21 | npm run build
22 | ```
23 |
24 | 3. Despliega en Surge usando la CLI.
25 |
26 | ```shell
27 | surge dist
28 | ```
29 |
30 | Puedes usar un [dominio personalizado](http://surge.sh/help/adding-a-custom-domain) al hacer despliegues ejecutando `surge dist tudominio.com`.
31 |
--------------------------------------------------------------------------------
/src/components/tabs/useTabState.ts:
--------------------------------------------------------------------------------
1 | import { useStore } from '@nanostores/preact';
2 | import { useState } from 'preact/hooks';
3 | import { tabStore } from './store';
4 |
5 | export function useTabState(
6 | initialCurr: string,
7 | storeKey?: string
8 | ): [string, (curr: string) => void] {
9 | const $tabStore = useStore(tabStore);
10 | // Use localState when no storeKey is provided
11 | // Would be nice to conditionally create this but alas...
12 | // hooks can't use conditionals :(
13 | const localState = useState(initialCurr);
14 | if (!storeKey) return localState;
15 |
16 | const curr = $tabStore[storeKey]?.curr ?? initialCurr;
17 | function setCurr(newCurr: string) {
18 | if (storeKey) {
19 | tabStore.setKey(storeKey, { curr: newCurr });
20 | } else {
21 | throw new Error(
22 | '[Tabs] Looks like a sharedStore key is no longer present on your tab view! If your store key is dynamic, consider using a static string value instead.'
23 | );
24 | }
25 | }
26 |
27 | return [curr, setCurr];
28 | }
29 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/generate-content-types-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Failed to generate content types.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | > **GenerateContentTypesError**: `astro sync` command failed to generate content collection types. (E08001)
17 |
18 | ## What went wrong?
19 | `astro sync` command failed to generate content collection types.
20 |
21 | **See Also:**
22 | - [Content collections documentation](/en/guides/content-collections/)
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/mdx-integration-missing-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: MDX integration missing.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | > **MdxIntegrationMissingError**: No se puede procesar el ARCHIVO. Asegúrate de que la integración `@astrojs/mdx` esté instalada. (E06004)
13 |
14 | ## ¿Qué salió mal?
15 |
16 | No se pudo encontrar la integración oficial `@astrojs/mdx`. Este error se genera cuando se usan archivos MDX sin una integración para MDX instalada.
17 |
18 | **Ver también:**
19 |
20 | - [Instalación y uso de MDX](/es/guides/integrations-guide/mdx/)
21 |
22 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/guides/deploy/surge.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Faça o deploy do seu site Astro no Surge
3 | description: Como fazer o deploy do seu site Astro usando surge.sh
4 | type: deploy
5 | i18nReady: true
6 | ---
7 |
8 | Você pode fazer o deploy do seu projeto Astro para o [Surge](https://surge.sh/), uma plataforma de publicação em um só comando feita para desenvolvedores front-end.
9 |
10 | ## Como fazer o deploy
11 |
12 | 1. Instale [a CLI do Surge](https://www.npmjs.com/package/surge) globalmente pelo Terminal, se ainda não tiver instalado.
13 |
14 | ```shell
15 | npm install -g surge
16 | ```
17 |
18 | 2. Faça a build do seu site Astro a partir do diretório raiz do seu projeto.
19 |
20 | ```shell
21 | npm run build
22 | ```
23 |
24 | 3. Faça o deploy para o Surge usando a CLI.
25 |
26 | ```shell
27 | surge dist
28 | ```
29 |
30 | Você pode usar um [domínio customizado](http://surge.sh/help/adding-a-custom-domain) quando fizer o deploy executando `surge dist seu-dominio.com`.
31 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/reference/errors/get-static-paths-required.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: getStaticPaths() function required for dynamic routes.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > **GetStaticPathsRequired**: A função `getStaticPaths()` é necessário para rotas dinâmicas. Certifique-se de que você fez `export` de uma função `getStaticPaths` em sua rota dinâmica. (E03015)
8 |
9 | ## O que deu errado?
10 |
11 | No [Modo Estático](/pt-br/core-concepts/routing/#modo-estático-ssg), todas as rotas devem ser determinadas em tempo de build. Portanto, rotas dinâmicas devem fazer `export` de uma função `getStaticPaths` retornando os diferentes caminhos a serem gerados.
12 |
13 | **Veja Também:**
14 | - [Rotas Dinâmicas](/pt-br/core-concepts/routing/#rotas-dinâmicas)
15 | - [`getStaticPaths()`](/pt-br/reference/api-reference/#getstaticpaths)
16 | - [Renderização no lado do Servidor](/pt-br/guides/server-side-rendering/)
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/invalid-component-args.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Invalid component arguments.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 |
13 | > **Mensaje de error de ejemplo:**
14 | InvalidComponentArgs: Invalid arguments passed to `` component. (E03020)
15 | ## ¿Qué salió mal?
16 | Los componentes de Astro no pueden ser renderizados manualmente a través de una llamada a una función, como por ejemplo `Component()` o `{items.map(Component)}`. Preferiblemente usa la sintaxis de un componente `` o `{items.map(item => )}`.
17 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/invalid-glob.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Invalid glob pattern.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | > **InvalidGlob**: Invalid glob pattern: `GLOB_PATTERN`. Glob patterns must start with './', '../' or '/'. (E04002)
17 |
18 | ## What went wrong?
19 | Astro encountered an invalid glob pattern. This is often caused by the glob pattern not being a valid file path.
20 |
21 | **See Also:**
22 | - [Glob Patterns](/en/guides/imports/#glob-patterns)
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/unknown-compiler-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Unknown compiler error.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | > Error de compilador desconocido. (E01000)
13 |
14 | ## ¿Qué salió mal?
15 | Astro encontró un error desconocido mientras compilaba tus archivos. En la mayoría de los casos, esto no es culpa tuya, sino un problema en nuestro compilador.
16 |
17 | Si no hay uno ya creado, [crea un issue](https://astro.build/issues/compiler).
18 |
19 | **Ver también:**
20 |
21 | - [plantilla de issues de compilador/withastro](https://astro.build/issues/compiler)
22 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/reference/errors/get-static-paths-expected-params.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Missing params property on getStaticPaths route.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > **GetStaticPathsExpectedParams**: Propriedade obrigatória `params` faltando ou vazia em rota de `getStaticPaths`. (E03013)
8 |
9 | ## O que deu errado?
10 |
11 | Toda rota especificada em `getStaticPaths` precisa de uma propriedade `params` especificando os parâmetros de caminho necessários para corresponder a rota.
12 |
13 | Por exemplo, o seguinte código:
14 | ```astro title="pages/blog/[id].astro"
15 | ---
16 | export async function getStaticPaths() {
17 | return [
18 | { params: { id: '1' } }
19 | ];
20 | }
21 | ---
22 | ```
23 | Irá criar a seguinte rota: `site.com/blog/1`.
24 |
25 | **Veja Também:**
26 | - [`getStaticPaths()`](/pt-br/reference/api-reference/#getstaticpaths)
27 | - [`params`](/pt-br/reference/api-reference/#params)
28 |
29 |
30 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/no-matching-import.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: No import found for component.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | > **NoMatchingImport**: Could not render `COMPONENT_NAME`. No matching import has been found for `COMPONENT_NAME`. (E03018)
17 |
18 | ## What went wrong?
19 | No import statement was found for one of the components. If there is an import statement, make sure you are using the same identifier in both the imports and the component usage.
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/config-not-found.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Specified configuration file not found.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | > **ConfigNotFound**: Unable to resolve `--config "CONFIG_FILE"`. Does the file exist? (E07001)
17 |
18 | ## What went wrong?
19 | The specified configuration file using `--config` could not be found. Make sure that it exists or that the path is correct
20 |
21 | **See Also:**
22 | - [--config](/en/reference/cli-reference/#--config-path)
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/components/TabGroup/SidebarToggleTabGroup.tsx:
--------------------------------------------------------------------------------
1 | import { useState } from 'preact/hooks';
2 | import './TabGroup.css';
3 |
4 | type TabType = 'learn' | 'api';
5 | interface Props {
6 | defaultActiveTab: TabType;
7 | labels: Record;
8 | }
9 |
10 | const SidebarToggleTabGroup = ({ defaultActiveTab, labels }: Props) => {
11 | const [activeTab, setActiveTab] = useState(defaultActiveTab);
12 | function toggleType(type: TabType) {
13 | document.querySelectorAll(`li.nav-group`).forEach((el) => el.classList.remove('active'));
14 | document.querySelectorAll(`li.nav-group.${type}`).forEach((el) => el.classList.add('active'));
15 | setActiveTab(type);
16 | }
17 | return (
18 |
29 | );
30 | };
31 |
32 | export default SidebarToggleTabGroup;
33 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/reserved-slot-name.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Invalid slot name.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | > **ReservedSlotName**: Unable to create a slot named `SLOT_NAME`. `SLOT_NAME` is a reserved slot name. Please update the name of this slot. (E03016)
17 |
18 | ## What went wrong?
19 | Certain words cannot be used for slot names due to being already used internally.
20 |
21 | **See Also:**
22 | - [Named slots](/en/core-concepts/astro-components/#named-slots)
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/client-address-not-available.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 |
6 | title: Astro.clientAddress is not available in current adapter.
7 | i18nReady: true
8 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
9 | ---
10 |
11 | > **ClientAddressNotAvailable**: `Astro.clientAddress` no está disponible en el adaptador `ADAPTER_NAME`. Crea una issue con el nombre del adaptador para agregar soporte. (E03002)
12 |
13 | ## ¿Qué salió mal?
14 |
15 | Lamentablemente, el adaptador que estás utilizando no es compatible con `Astro.clientAddress`.
16 |
17 | **Ver también:**
18 | - [Integraciones oficiales](/es/guides/integrations-guide/#integraciones-oficiales)
19 | - [Astro.clientAddress](/es/reference/api-reference/#astroclientaddress)
20 |
21 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/unknown-content-collection-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Unknown Content Collection Error.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | ## What went wrong?
17 | Astro encountered an unknown error loading your content collections.
18 | This can be caused by certain errors inside your `src/content/config.ts` file or some internal errors.
19 |
20 | If you can reliably cause this error to happen, we'd appreciate if you could [open an issue](https://astro.build/issues/)
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/get-static-paths-removed-rsshelper.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: getStaticPaths RSS helper is not available anymore.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | > **GetStaticPathsRemovedRSSHelper**: El ayudante de RSS se ha eliminado de `getStaticPaths`. Prueba el nuevo paquete @astrojs/rss en su lugar. (E03012)
13 |
14 | ## ¿Qué salió mal?
15 |
16 | `getStaticPaths` ya no expone un asistente para generar un RSS feed. Recomendamos migrar a la integración [@astrojs/rss](/es/guides/rss/#configurando-astrojsrss) en su lugar.
17 |
18 | **Ver también:**
19 | - [Guía RSS](/es/guides/rss/)
20 |
21 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/invalid-content-entry-slug-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Invalid content entry slug.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | > `COLLECTION_NAME` → `ENTRY_ID` has an invalid slug. `slug` must be a string. (E09002)
17 |
18 | ## What went wrong?
19 | An entry in `src/content/` has an invalid `slug`. This field is reserved for generating entry slugs, and must be a string when present.
20 |
21 | **See Also:**
22 | - [The reserved entry `slug` field](/en/guides/content-collections/)
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/components/TabGroup/TabGroup.css:
--------------------------------------------------------------------------------
1 | .TabGroup {
2 | display: flex;
3 | border-bottom: 4px solid var(--theme-divider);
4 | }
5 |
6 | .TabGroup button,
7 | .TabGroup a {
8 | flex: 1;
9 | justify-content: center;
10 | white-space: nowrap;
11 | border-radius: 0;
12 | cursor: pointer;
13 | padding: 0.6rem 1rem;
14 | color: var(--theme-text-light);
15 | border-bottom: 4px solid transparent;
16 | margin-bottom: -4px;
17 | background-color: transparent;
18 | text-decoration: none;
19 | }
20 | .TabGroup .active,
21 | .TabGroup [aria-selected='true'] {
22 | color: var(--theme-text);
23 | border-bottom-color: var(--theme-accent);
24 | font-weight: bold;
25 | }
26 |
27 | @media (forced-colors: active) {
28 | .TabGroup {
29 | border-bottom-color: Canvas;
30 | }
31 |
32 | .TabGroup .active {
33 | color: ButtonText;
34 | border-bottom-color: ButtonText;
35 | }
36 |
37 | .TabGroup a,
38 | .TabGroup button {
39 | color: LinkText;
40 | border-bottom-color: Canvas;
41 | }
42 | }
43 |
44 | .TabGroup.no-flex button,
45 | .TabGroup.no-flex a {
46 | flex: 0;
47 | }
48 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/unknown-config-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Unknown configuration error.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | ## ¿Qué salió mal?
13 | Astro encontró un error desconocido al cargar tu archivo de configuración de Astro.
14 | Esto es a menudo causado por un error de sintaxis en tu configuración y el mensaje debe ofrecer más información.
15 |
16 | Si puedes reproducir este error de forma consistente, nosotros apreciaríamos si pudieras [abrir un issue](https://astro.build/issues/)
17 |
18 |
19 | **Ver también:**
20 | - [Referencia de Configuración](/es/reference/configuration-reference/)
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/components/Header/HeaderButton.css:
--------------------------------------------------------------------------------
1 | .header-button {
2 | --border-color-default: var(--theme-shade-subtle);
3 | --border-color-hocus: var(--theme-text-light);
4 | --text-color-default: var(--theme-text-light);
5 | --text-color-hocus: var(--theme-text);
6 | box-sizing: border-box;
7 | margin: 0;
8 | padding: 0.8rem;
9 | overflow: visible;
10 | background-color: var(--background-color-default, transparent);
11 | border-style: solid;
12 | border-width: 1px;
13 | border-color: var(--border-color-default);
14 | border-radius: 0.25rem;
15 | color: var(--text-color-default);
16 | font-size: 1rem;
17 | font-family: inherit;
18 | font-weight: 500;
19 | line-height: 1;
20 | cursor: pointer;
21 | transition-timing-function: ease-out;
22 | transition-duration: 0.2s;
23 | transition-property: border-color;
24 | -webkit-font-smoothing: antialiased;
25 | }
26 |
27 | @media (hover: hover) {
28 | .header-button {
29 | padding: 0.58rem;
30 | }
31 | .header-button:hover {
32 | color: var(--text-color-hocus);
33 | border-color: var(--border-color-hocus);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/components/tabs/Tabs.module.css:
--------------------------------------------------------------------------------
1 | .container {
2 | padding-block: 1rem;
3 | position: relative;
4 | }
5 |
6 | .tab-scroll-overflow {
7 | overflow-x: scroll;
8 | /* Hide scrollbar on firefox */
9 | scrollbar-width: none;
10 | }
11 |
12 | .tab-scroll-overflow::-webkit-scrollbar {
13 | /* Hide scrollbar on chrome / safari */
14 | display: none;
15 | }
16 |
17 | .tab:focus {
18 | outline: 2px solid var(--theme-accent);
19 | outline-offset: -2px;
20 | }
21 |
22 | .tab:not(:focus-visible) {
23 | outline: 0;
24 | }
25 |
26 | .tabpanel {
27 | padding-block-start: 1rem;
28 | }
29 |
30 | .tablist {
31 | position: relative;
32 | }
33 |
34 | .selectedIndicator {
35 | position: absolute;
36 | transform-origin: left;
37 | left: 0;
38 | bottom: -4px;
39 | height: 4px;
40 | background-color: var(--theme-accent);
41 | }
42 |
43 | @media (forced-colors: active) {
44 | .selectedIndicator {
45 | background-color: ButtonText;
46 | }
47 | }
48 |
49 | @media (prefers-reduced-motion: no-preference) {
50 | .selectedIndicator {
51 | transition-duration: 200ms;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/invalid-prerender-export.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Invalid prerender export.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | > **Mensaje de error de ejemplo:**
13 | InvalidPrerenderExport: Se ha detectado una exportación `prerender`, pero su valor no se puede analizar estáticamente. (E03019)
14 |
15 | ## ¿Qué salió mal?
16 |
17 | La función `prerender` solo admite un subconjunto de JavaScript válido; asegúrate de usar exactamente `export const prerender = true` para que nuestro compilador pueda detectar esta directiva en el momento de la compilación. No se admiten las declaraciones de variables, `let` y `var`.
18 |
--------------------------------------------------------------------------------
/src/components/RightSidebar/RightSidebar.astro:
--------------------------------------------------------------------------------
1 | ---
2 | import TableOfContents from './TableOfContents';
3 | import ContributeMenu from './ContributeMenu.astro';
4 | import CommunityMenu from './CommunityMenu.astro';
5 | import { useTranslations } from '../../i18n/util';
6 | import generateToc from '../../util/generateToc';
7 |
8 | const t = useTranslations(Astro);
9 |
10 | const { content, githubEditUrl, headings } = Astro.props;
11 | const overview = t('rightSidebar.overview');
12 | ---
13 |
14 |
28 |
29 |
37 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/invalid-component-args.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Invalid component arguments.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | > **Example error messages:**
17 | InvalidComponentArgs: Invalid arguments passed to `` component. (E03020)
18 |
19 | ## What went wrong?
20 | Astro components cannot be rendered manually via a function call, such as `Component()` or `{items.map(Component)}`. Prefer the component syntax `` or `{items.map(item => )}`.
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/unknown-vite-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Unknown Vite Error.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | ## What went wrong?
17 | Vite encountered an unknown error while rendering your project. We unfortunately do not know what happened (or we would tell you!)
18 |
19 | If you can reliably cause this error to happen, we'd appreciate if you could [open an issue](https://astro.build/issues/)
20 |
21 | **See Also:**
22 | - [Vite troubleshooting guide](https://vitejs.dev/guide/troubleshooting.html)
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/content/docs/en/recipes/add-yaml-support.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Installing a Vite or Rollup plugin
3 | description: Learn how you can import YAML data by adding a Rollup plugin to your project.
4 | i18nReady: false
5 | type: recipe
6 | ---
7 |
8 | 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.
9 |
10 | ## Recipe
11 |
12 | 1. Install `@rollup/plugin-yaml`:
13 |
14 | ```bash
15 | npm install @rollup/plugin-yaml --save-dev
16 | ```
17 |
18 | 2. Import the plugin in your `astro.config.mjs` and add it to the Vite plugins array:
19 |
20 | ```js title="astro.config.mjs" ins={2,5-7}
21 | import { defineConfig } from 'astro/config';
22 | import yaml from '@rollup/plugin-yaml';
23 |
24 | export default defineConfig({
25 | vite: {
26 | plugins: [yaml()]
27 | }
28 | });
29 | ```
30 |
31 |
32 | 3. Finally, you can import YAML data using an `import` statement:
33 |
34 | ```js
35 | import yml from './data.yml';
36 | ```
37 |
--------------------------------------------------------------------------------
/src/components/RightSidebar/EditButton.astro:
--------------------------------------------------------------------------------
1 | ---
2 | export interface Props {
3 | editHref: string;
4 | }
5 | import UIString from '../UIString.astro';
6 | const { editHref } = Astro.props;
7 | ---
8 |
9 |
10 |
27 |
28 |
29 |
30 |
37 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/mdx-integration-missing-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: MDX integration missing.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | > **MdxIntegrationMissingError**: Unable to render FILE. Ensure that the `@astrojs/mdx` integration is installed. (E06004)
17 |
18 | ## What went wrong?
19 | Unable to find the official `@astrojs/mdx` integration. This error is raised when using MDX files without an MDX integration installed.
20 |
21 | **See Also:**
22 | - [MDX installation and usage](/en/guides/integrations-guide/mdx/)
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/util/getOgImageUrl.ts:
--------------------------------------------------------------------------------
1 | import type { GetStaticPathsOptions, GetStaticPathsResult } from 'astro';
2 | import { getStaticPaths } from '../pages/open-graph/[...path]';
3 |
4 | const routes = (await getStaticPaths({} as GetStaticPathsOptions)) as GetStaticPathsResult;
5 |
6 | /** All the OpenGraph image paths as generated by our `getStaticPaths`. */
7 | const paths = new Set(routes.map(({ params }) => params.path));
8 |
9 | /**
10 | * Get the path to the OpenGraph image for a page
11 | * @param path Pathname of the page URL.
12 | * @param isFallback Whether or not this page is displaying fallback content.
13 | * @returns Path to the OpenGraph image if found. Otherwise, `undefined`.
14 | */
15 | export function getOgImageUrl(path: string, isFallback: boolean): string | undefined {
16 | let imagePath = path.replace(/^\//, '').replace(/\/$/, '') + '.png';
17 | if (isFallback) {
18 | // Replace the language segment with 'en' for fallback pages.
19 | imagePath = 'en' + imagePath.slice(imagePath.indexOf('/'));
20 | }
21 | if (paths.has(imagePath)) return '/open-graph/' + imagePath;
22 | }
23 |
--------------------------------------------------------------------------------
/src/components/CodeSnippet/types.ts:
--------------------------------------------------------------------------------
1 | export type MarkerType = 'mark' | 'ins' | 'del' | undefined;
2 |
3 | /** When markers overlap, those with higher indices override lower ones. */
4 | export const MarkerTypeOrder: MarkerType[] = ['mark', 'del', 'ins'];
5 |
6 | export type LineMarkingDefinition = {
7 | markerType: MarkerType;
8 | lines: number[];
9 | };
10 |
11 | export type InlineMarkingDefinition = {
12 | markerType: MarkerType;
13 | text?: string;
14 | regExp?: RegExp;
15 | };
16 |
17 | export type MarkedRange = {
18 | markerType: MarkerType;
19 | start: number;
20 | end: number;
21 | };
22 |
23 | export type SyntaxToken = {
24 | tokenType: 'syntax';
25 | color: string;
26 | otherStyles: string;
27 | innerHtml: string;
28 | text: string;
29 | textStart: number;
30 | textEnd: number;
31 | };
32 |
33 | export type MarkerToken = {
34 | tokenType: 'marker';
35 | markerType: MarkerType;
36 | closing?: boolean;
37 | };
38 |
39 | export type InlineToken = SyntaxToken | MarkerToken;
40 |
41 | export type InsertionPoint = {
42 | tokenIndex: number;
43 | innerHtmlOffset: number;
44 | };
45 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/unknown-compiler-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Unknown compiler error.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | > Unknown compiler error. (E01000)
17 |
18 | ## What went wrong?
19 | Astro encountered an unknown error while compiling your files. In most cases, this is not your fault, but an issue in our compiler.
20 |
21 | If there isn't one already, please [create an issue](https://astro.build/issues/compiler).
22 |
23 | **See Also:**
24 | - [withastro/compiler issues list](https://astro.build/issues/compiler)
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/markdown-frontmatter-parse-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Failed to parse Markdown frontmatter.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | > **Mensaje de error de ejemplo:**
13 | No puedes leer un mapeo implícito; faltan dos puntos
14 | Final inesperado de la secuencia dentro de un escalar entre comillas dobles
15 | No se puede leer un bloque; una clave multilínea puede no ser una clave implícita (E06001)
16 |
17 | ## ¿Qué salió mal?
18 |
19 | Astro encontró un error al analizar la frontmatter de tu archivo Markdown.
20 | Esto a menudo se debe a un error en la sintaxis, como la falta de dos puntos o una comilla final faltante.
21 |
--------------------------------------------------------------------------------
/src/content/docs/ja/guides/deploy/flightcontrol.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: FlightcontrolでAstroサイトをAWSにデプロイする
3 | description: FlightcontrolでAstroサイトをAWSにデプロイする方法
4 | type: deploy
5 | i18nReady: true
6 | ---
7 |
8 | AWSアカウントへの完全自動デプロイを提供する[Flightcontrol](https://www.flightcontrol.dev?ref=astro)を使用して、Astroサイトをデプロイできます。
9 |
10 | 静的サイトとSSRサイトの両方をサポートします。
11 |
12 | ## デプロイ方法
13 |
14 | 1. [app.flightcontrol.dev/signup](https://app.flightcontrol.dev/signup?ref=astro)でFlightcontrolアカウントを作成します。
15 | 1. [app.flightcontrol.dev/projects/new/1](https://app.flightcontrol.dev/projects/new/1)に移動します。
16 | 1. GitHubアカウントを接続し、リポジトリを選択します。
17 | 1. 希望する「Config Type」を選択します。
18 | - (すべての設定をflightcontrolのダッシュボードから管理する)`GUI`では、`Astro Static`または`Astro SSR`プリセットを選択します。
19 | - (すべての設定をリポジトリに含める"infrastructure as code"オプションである)`flightcontrol.json`では、Astroのサンプル設定を選択し、それを`flightcontrol.json`としてコードベースに追加します。
20 | 1. 必要に応じて設定を調整します。
21 | 1. 「Create Project」をクリックし、AWSアカウントのリンクなどの必要な手順を進めます。
22 |
23 | ### SSRの設定
24 |
25 | SSRに対応してデプロイするには、まず[`@astro/node`](/ja/guides/integrations-guide/node/)アダプターを設定する必要があります。その後、上記した手順でAstroのSSRに適した設定を選択します。
26 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/content-schema-contains-slug-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Content Schema should not contain slug.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | Un esquema de colección de contenido no debe contener el `slug` ya que está reservado para la generación de slugs. Elimina esto de tu esquema de colección de contenido.
13 | (E09003)
14 |
15 | ## ¿Qué salió mal?
16 | Un esquema de colección de contenido no debe contener la propiedad `slug`. Esto está reservado por Astro para generar slugs. Elimine el campo `slug` de su esquema o elija un nombre diferente.
17 |
18 | **Ver también:**
19 | - [La propiedad reservada `slug`](/es/guides/content-collections/)
20 |
--------------------------------------------------------------------------------
/src/content/docs/fr/guides/deploy/render.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Déployer votre site Astro sur Render
3 | description: Comment déployer votre site Astro sur le Web avec Render.
4 | type: deploy
5 | i18nReady: true
6 | ---
7 |
8 | Vous pouvez déployer votre projet Astro sur [Render](https://render.com/), un service pour build des sites web avec des certificats libres TLS, un CDN global, une protection DDoS, des réseaux privés et des déploiements automatiques depuis Git.
9 |
10 | ## Comment déployer
11 |
12 | 1. Créer un [compte render.com](https://dashboard.render.com/) et se connecter
13 | 2. Cliquer sur le bouton **Nouveau +** du tableau de bord et sélectionner **Site Statique**
14 | 3. Connecter votre dépôt [GitHub](https://github.com/) ou [GitLab](https://about.gitlab.com/) ou, alternativement saisir l'adresse publique d'un dépôt publique
15 | 4. Donner à votre site web un nom, sélectionner la branche et spécifier la commande de génération et le dossier de publication
16 | - **commande de génération:** `npm run build`
17 | - **dossier de publication:** `dist`
18 | 5. Cliquer sur le bouton **Créer un Site Statique**
19 |
--------------------------------------------------------------------------------
/src/util/getPageCategory.ts:
--------------------------------------------------------------------------------
1 | // TODO: Move this data to our i18n system to support localized category labels.
2 | const defaultCategory = 'Learn';
3 |
4 | // Order is important here. Pages are tested to see if they *start* with one of
5 | // these paths and will return early when one matches. This means more specific
6 | // paths need to be earlier in the array, e.g. `reference/errors/` before `reference/`.
7 | const categories = [
8 | ['guides/deploy/', 'Deploy Guides'],
9 | ['guides/integrations-guide/', 'Integration Guides'],
10 | ['reference/errors/', 'Error Reference'],
11 | ['reference/', 'Reference'],
12 | ['tutorial/', 'Tutorials'],
13 | ] as const;
14 |
15 | /**
16 | * @param url URL for the current page.
17 | * @returns The category for the current page as used by Algolia DocSearch to group search results.
18 | */
19 | export function getPageCategory(url: { pathname: string }) {
20 | const langAgnosticPath = url.pathname.replace(/\/\w\w(-\w\w)?\//, '');
21 | for (const [path, label] of categories) {
22 | if (langAgnosticPath.startsWith(path)) return label;
23 | }
24 | return defaultCategory;
25 | }
26 |
--------------------------------------------------------------------------------
/src/content/docs/en/guides/deploy/google-firebase.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Deploy your Astro Site to Google’s Firebase Hosting
3 | description: How to deploy your Astro site to the web using Google’s Firebase Hosting.
4 | type: deploy
5 | i18nReady: true
6 | ---
7 |
8 | [Firebase Hosting](https://firebase.google.com/products/hosting) is a service provided by Google’s [Firebase](https://firebase.google.com/) app development platform, which can be used to deploy an Astro site.
9 |
10 | ## How to deploy
11 |
12 | 1. Make sure you have [firebase-tools](https://www.npmjs.com/package/firebase-tools) installed.
13 |
14 | 2. Create `firebase.json` and `.firebaserc` at the root of your project with the following content:
15 |
16 | `firebase.json`:
17 |
18 | ```json
19 | {
20 | "hosting": {
21 | "public": "dist",
22 | "ignore": []
23 | }
24 | }
25 | ```
26 |
27 | `.firebaserc`:
28 |
29 | ```json
30 | {
31 | "projects": {
32 | "default": ""
33 | }
34 | }
35 | ```
36 |
37 | 3. After running `npm run build`, deploy using the command `firebase deploy`.
38 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/unknown-config-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Unknown configuration error.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | ## What went wrong?
17 | Astro encountered an unknown error loading your Astro configuration file.
18 | This is often caused by a syntax error in your config and the message should offer more information.
19 |
20 | If you can reliably cause this error to happen, we'd appreciate if you could [open an issue](https://astro.build/issues/)
21 |
22 | **See Also:**
23 | - [Configuration Reference](/en/reference/configuration-reference/)
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/content/docs/zh-cn/guides/aliases.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: 别名
3 | description: 对 Astro 别名的介绍。
4 | ---
5 |
6 | **别名**可以用于创建简洁的导入。
7 |
8 | 别名有助于改善在项目中大量使用绝对或相对引用的体验。
9 |
10 | ```astro
11 | ---
12 | // my-project/src/pages/about/company.astro
13 |
14 | import Button from '../../components/controls/Button.astro';
15 | import logoUrl from '../../assets/logo.png?url';
16 | ---
17 | ```
18 |
19 | 在这个示例中,开发者需要理解 `src/pages/about/company.astro`, `src/components/controls/Button.astro` 和 `src/assets/logo.png` 间的关系。如果移动了 `company.astro` 文件,那么这些导入也都需要更新。
20 |
21 | 你可以在 `tsconfig.json` 或 `jsconfig.json` 中添加导入别名。
22 |
23 | ```json
24 | {
25 | "compilerOptions": {
26 | "baseUrl": ".",
27 | "paths": {
28 | "@components/*": ["src/components/*"],
29 | "@assets/*": ["src/assets/*"]
30 | }
31 | }
32 | }
33 | ```
34 |
35 | 完成后你就可以在项目中任意一处使用别名了:
36 |
37 | ```astro
38 | ---
39 | // my-project/src/pages/about/company.astro
40 |
41 | import Button from '@components/Button.astro';
42 | import logoUrl from '@assets/logo.png';
43 | ---
44 | ```
45 |
46 | [VSCode](https://code.visualstudio.com/docs/languages/jsconfig) 或其他编辑器会自动集成这些别名。
47 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 withastro
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/invalid-prerender-export.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Invalid prerender export.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | > **Example error messages:**
17 | InvalidPrerenderExport: A `prerender` export has been detected, but its value cannot be statically analyzed. (E03019)
18 |
19 | ## What went wrong?
20 | The `prerender` feature only supports a subset of valid JavaScript — be sure to use exactly `export const prerender = true` so that our compiler can detect this directive at build time. Variables, `let`, and `var` declarations are not supported.
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/get-static-paths-removed-rsshelper.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: getStaticPaths RSS helper is not available anymore.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | > **GetStaticPathsRemovedRSSHelper**: The RSS helper has been removed from `getStaticPaths`. Try the new @astrojs/rss package instead. (E03012)
17 |
18 | ## What went wrong?
19 | `getStaticPaths` no longer expose an helper for generating a RSS feed. We recommend migrating to the [@astrojs/rss](/en/guides/rss/#setting-up-astrojsrss)integration instead.
20 |
21 | **See Also:**
22 | - [RSS Guide](/en/guides/rss/)
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/no-adapter-installed.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Cannot use Server-side Rendering without an adapter.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | > **NoAdapterInstalled**: No se puede usar `output: 'server'` sin un adaptador. Instale y configure el adaptador adecuado para el despliegue final. (E03017)
13 |
14 | ## ¿Qué salió mal?
15 |
16 | Para usar el renderizado en el servidor, se debe instalar un adaptador para que Astro sepa cómo generar la salida adecuada para la plataforma de despliegue específica.
17 |
18 | **Ver también:**
19 |
20 | - [Renderizado en el servidor](/es/guides/server-side-rendering/)
21 | - [Adding an Adapter](/es/guides/server-side-rendering/#añadiendo-un-adaptador)
22 |
23 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/failed-to-load-module-ssr.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Could not import file.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | > **FailedToLoadModuleSSR**: No se pudo importar `IMPORT_NAME`. (E04001)
13 |
14 | ## ¿Qué salió mal?
15 |
16 | Astro no pudo importar el archivo solicitado. A menudo, esto se debe a que la ruta de importación es incorrecta (ya sea porque el archivo no existe o hay un error ortográficos en la ruta)
17 |
18 | Este mensaje también puede aparecer cuando se importa un tipo sin especificar que se trata de una [importación de tipo](/es/guides/typescript/#importación-de-tipos).
19 |
20 | **Ver también:**
21 |
22 | - [Importación de tipos](/es/guides/typescript/#importación-de-tipos)
23 |
24 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/no-client-only-hint.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Missing hint on client:only directive.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | > **NoClientOnlyHint**: No se puede renderizar el `COMPONENT_NAME`. Al usar la estrategia de hidratación `client:only`, Astro necesita una pista para usar el renderizador correcto. (E03009)
13 |
14 | ## ¿Qué salió mal?
15 |
16 | Los componentes `client:only` no se ejecutan en el servidor, por lo que Astro no sabe (y no puede adivinar) qué renderizador usar y requiere una pista. Como tal:
17 |
18 | ```astro
19 |
20 | ```
21 |
22 | **Ver también:**
23 |
24 | - [`client:only`](/es/reference/directives-reference/#clientonly)
25 |
26 |
--------------------------------------------------------------------------------
/src/content/docs/zh-cn/guides/cms.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: 在 Astro 中使用 CMS
3 | description: 如何在 Astro 中使用一个 CMS 添加内容
4 | ---
5 | import CMSGuidesNav from '~/components/CMSGuidesNav.astro';
6 |
7 |
8 |
9 | **准备好将一个无头 CMS(Headless CMS) 连接到你的 Astro 项目了吗?** 按照我们的一个指南来集成 CMS(Content Management System,内容管理系统)。
10 |
11 | ## CMS 指南
12 |
13 |
14 |
15 | 请注意,其中许多页面都是 **断续的**:这些资源等着你来贡献!
16 |
17 | ## 为什么使用一个 CMS?
18 |
19 | 内容管理系统(CMS)可让你在 Astro 项目之外编写内容和管理资源。
20 |
21 | 这解锁了处理内容的新方式。大多数 CMS 为你提供可视化内容编辑器、指定内容类型的能力以及与他人协作的方式。
22 |
23 | CMS 在处理遵循特定结构的内容时特别有用,通常为你提供类似仪表板的体验和所见即所得(WYSIWYG)的编辑工具。 你可以使用 CMS 提供的富文本编辑器而不是 Markdown 文件来编写博客文章,或者你可以使用 CMS 来维护电子商务商店的产品列表,使某些字段成为必填字段以避免不完整的列表。
24 |
25 | 然后,你的 Astro 项目可以从你的 CMS 中获取你的内容,并将其显示在你网站上的任何位置。
26 |
27 | ## 哪些 CMS 与 Astro 天然融合
28 |
29 | 由于 Astro 会处理你的内容的 _呈现_,因此你需要选择 _无头_ CMS,就像上面列表中的那些。这意味着 CMS 可以帮助你编写内容,但不会生成显示内容的站点。相反,你将自己在 Astro 项目中获取内容数据并使用这些数据。
30 |
31 | 一些无头 CMS,比如 Storyblok,提供了专门的 [Astro 集成](/zh-cn/guides/integrations-guide/),帮助为 Astro 站点获取内容。其他 CMS 会提供 JavaScript 软件包(SDK),这是一个你用于获取远程内容的库。
32 |
33 | ## 我可以在没有 CMS 的情况下使用 Astro 吗?
34 |
35 | 当然! Astro 提供了 [创作内容内容](/zh-cn/guides/content/) 的内置方法,包括对 Markdown 页面的支持。
36 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | #### What kind of changes does this PR include?
4 |
5 |
6 | - Minor content fixes (broken links, typos, etc.)
7 | - New or updated content
8 | - Translated content
9 | - Changes to the docs site code
10 | - Something else!
11 |
12 | #### Description
13 |
14 | - Closes #
15 | - What does this PR change? Give us a brief description.
16 | - Did you change something visual? A before/after screenshot can be helpful.
17 |
18 |
30 |
--------------------------------------------------------------------------------
/public/logos/buddy.svg:
--------------------------------------------------------------------------------
1 |
13 |
--------------------------------------------------------------------------------
/src/content/docs/es/guides/deploy/google-firebase.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Despliega tu proyecto de Astro usando Firebase Hosting de Google
3 | description: Cómo desplegar tu proyecto de Astro usando Firebase Hosting de Google.
4 | type: deploy
5 | i18nReady: true
6 | ---
7 |
8 | [Firebase Hosting](https://firebase.google.com/products/hosting) es un servicio provisto por la plataforma de desarrollo de Google [Firebase](https://firebase.google.com/), el cual puede ser usado para desplegar un proyecto de Astro.
9 |
10 | ## Cómo desplegar
11 |
12 | 1. Asegúrate de tener [firebase-tools](https://www.npmjs.com/package/firebase-tools) instalado.
13 |
14 | 2. Crea un archivo `firebase.json` y `.firebaserc` en la raíz de tu proyecto con el siguiente contenido:
15 |
16 | ```json title="firebase.json"
17 | {
18 | "hosting": {
19 | "public": "dist",
20 | "ignore": []
21 | }
22 | }
23 | ```
24 |
25 |
26 | ```json title=".firebaserc"
27 | {
28 | "projects": {
29 | "default": ""
30 | }
31 | }
32 | ```
33 |
34 | 3. Después de ejecutar `npm run build`, realiza un despliegue usando el comando `firebase deploy`.
35 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/no-matching-static-path-found.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: No static path found for requested path.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | > **NoMatchingStaticPathFound**: Se hizo coincidir un patrón de ruta `getStaticPaths()`, pero no se encontró ninguna ruta estática coincidente a la ruta solicitada `PATH_NAME`. (E03004)
13 |
14 | ## ¿Qué salió mal?
15 |
16 | Se encontró una [ruta dinámica](/es/core-concepts/routing/#rutas-dinámicas), pero no se encontró la ruta correspondiente para los parámetros solicitados. Esto a menudo es causado por un error tipográfico en la ruta generada o solicitada.
17 |
18 | **Ver también:**
19 |
20 | - [getStaticPaths()](/es/reference/api-reference/#getstaticpaths)
21 |
22 |
--------------------------------------------------------------------------------
/src/content/docs/en/guides/cms/netlify-cms.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Netlify CMS & Astro
3 | description: Add content to your Astro project using Netlify as a CMS
4 | type: cms
5 | stub: true
6 | service: Netlify CMS
7 | ---
8 |
9 | [Netlify CMS](https://www.netlifycms.org/) is an open-source, Git-based content management system.
10 | ## Community Resources
11 |
12 | - Use the [`astro-netlify-cms`](https://github.com/delucis/astro-netlify-cms) Astro integration to add Netlify CMS to your project.
13 |
14 | - You can get started with the [Astro Blog Starter with Netlify CMS](https://github.com/delucis/astro-netlify-cms-starter).
15 |
16 | - Blog Post: [Author your Astro site's content with Git-based CMSs](https://aalam.vercel.app/blog/astro-and-git-cms-netlify) by Aftab Alam
17 |
18 | - Youtube Tutorial: [Create a Custom Blog with Astro & NetlifyCMS in MINUTES!](https://www.youtube.com/watch?v=3yip2wSRX_4) by Kumail Pirzada
19 |
20 | ## Production Sites
21 |
22 | The following sites use Astro + Netlify CMS in production:
23 |
24 | - [yunielacosta.com](https://www.yunielacosta.com/) by Yuniel Acosta — [source code on GitHub](https://github.com/yacosta738/yacosta738.github.io)
25 |
26 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/invalid-frontmatter-injection-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Invalid frontmatter injection.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | > **InvalidFrontmatterInjectionError**: Un plugin de remark o rehype intentó inyectar frontmatter inválido. Asegúrate que "astro.frontmatter" esté configurado en un objeto JSON válido que no sea `null` o `undefined`. (E06003)
13 |
14 | ## ¿Qué salió mal?
15 |
16 | Un plugin de remark o rehype intentó inyectar frontmatter inválido. Esto ocurre cuando "astro.frontmatter" es `null`, `undefined` o un objeto JSON inválido.
17 |
18 | **Ver también:**
19 |
20 | - [Modificación programática del frontmatter](/es/guides/markdown-content/#modificación-programática-del-frontmatter)
21 |
22 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/reference/errors/static-redirect-not-available.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Astro.redirect is not available in static mode.
3 | i18nReady: true
4 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | ---
6 |
7 | > **StaticRedirectNotAvailable**: Redirecionamentos só estão disponíveis ao utilizar `output: 'server'`. Atualize sua configuração do Astro se você precisa de funcionalidades de SSR. (E03001)
8 |
9 | ## O que deu errado?
10 |
11 | A função `Astro.redirect` está apenas disponível quando [Renderização no lado do servidor](/pt-br/guides/server-side-rendering/) está habilitada.
12 |
13 | Para redirecionar em um site estático, o [atributo meta refresh](https://developer.mozilla.org/pt-BR/docs/Web/HTML/Element/meta) pode ser utilizado. Certas hospedagens também providenciam redirecionamentos baseados em configuração (ex: [Netlify redirects](https://docs.netlify.com/routing/redirects/)).
14 |
15 | **Veja Também:**
16 | - [Habilitando SSR no seu projeto](/pt-br/guides/server-side-rendering/#habilitando-o-ssr-em-seu-projeto)
17 | - [Astro.redirect](/pt-br/guides/server-side-rendering/#astroredirect)
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/layouts/CMSLayout.astro:
--------------------------------------------------------------------------------
1 | ---
2 | import type { MarkdownHeading } from 'astro';
3 | import Aside from '~/components/Aside.astro';
4 | import CMSGuidesNav from '~/components/CMSGuidesNav.astro';
5 | import UIString from '~/components/UIString.astro';
6 | import type { CmsEntry } from '~/content/config';
7 | import { getGithubEditUrl } from '~/util/getGithubEditUrl';
8 | import MainLayout from './MainLayout.astro';
9 |
10 | export interface Props {
11 | content: CmsEntry['data'];
12 | headings: MarkdownHeading[];
13 | }
14 |
15 | const githubEditUrl = getGithubEditUrl(Astro);
16 | const {
17 | content: { stub },
18 | } = Astro.props;
19 | ---
20 |
21 |
22 |
23 | {
24 | stub && (
25 |
32 | )
33 | }
34 |
35 |
36 |
37 |
38 |
43 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/missing-media-query-directive.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Missing value for client:media directive.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | > **MissingMediaQueryDirective**: Media query no proporcionada para la directiva `client:media`. Se debe proporcionar una media query similar a `client:media="(max-width: 600px)"` (E03006)
13 |
14 | ## ¿Qué salió mal?
15 |
16 | Se requiere un parámetro [media query](https://developer.mozilla.org/es/docs/Web/CSS/Media_Queries/Using_media_queries) cuando se utiliza la directiva `client:media`.
17 |
18 | ```astro
19 |
20 | ```
21 |
22 | **Ver también:**
23 | - [`client:media`](/es/reference/directives-reference/#clientmedia)
24 |
25 |
--------------------------------------------------------------------------------
/src/components/tabs/TabPanel.astro:
--------------------------------------------------------------------------------
1 | ---
2 | export interface Props {
3 | id: string;
4 | initial?: boolean;
5 | }
6 | const { id, initial } = Astro.props;
7 | ---
8 |
9 |
10 |
11 |
12 |
13 |
47 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/client-address-not-available.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Astro.clientAddress is not available in current adapter.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | > **ClientAddressNotAvailable**: `Astro.clientAddress` is not available in the `ADAPTER_NAME` adapter. File an issue with the adapter to add support. (E03002)
17 |
18 | ## What went wrong?
19 | The adapter you're using unfortunately does not support `Astro.clientAddress`.
20 |
21 | **See Also:**
22 | - [Official integrations](/en/guides/integrations-guide/#official-integrations)
23 | - [Astro.clientAddress](/en/reference/api-reference/#astroclientaddress)
24 |
25 |
26 |
--------------------------------------------------------------------------------
/scripts/lib/linkcheck/base/issue.ts:
--------------------------------------------------------------------------------
1 | import type { AnnotationProperties } from '@actions/core';
2 | import { formatCount } from '../../output.mjs';
3 | import type { CheckBase } from './check';
4 | import type { HtmlPage } from './page';
5 |
6 | export interface LinkIssue {
7 | type: IssueType;
8 | linkHref: string;
9 | autofixHref?: string;
10 | annotationText?: string;
11 | page: HtmlPage;
12 | check: CheckBase;
13 | sourceFileAnnotations: SourceFileAnnotation[];
14 | }
15 |
16 | export interface SourceFileAnnotation {
17 | message: string;
18 | location: AnnotationProperties;
19 | autofixed?: boolean;
20 | }
21 |
22 | export class IssueType {
23 | readonly title: string;
24 | readonly prefix: string;
25 | readonly sortOrder: number;
26 |
27 | constructor({ title, prefix, sortOrder }: { title: string; prefix: string; sortOrder: number }) {
28 | this.title = title;
29 | this.prefix = prefix;
30 | this.sortOrder = sortOrder;
31 | }
32 |
33 | /**
34 | * Formats the issue `title` template based on `count`.
35 | *
36 | * See {@link formatCount} for full formatting logic.
37 | */
38 | formatTitle(count?: number) {
39 | return formatCount(count, this.title);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/markdown-frontmatter-parse-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Failed to parse Markdown frontmatter.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | > **Example error messages:**
17 | can not read an implicit mapping pair; a colon is missed
18 | unexpected end of the stream within a double quoted scalar
19 | can not read a block mapping entry; a multiline key may not be an implicit key (E06001)
20 |
21 | ## What went wrong?
22 | Astro encountered an error while parsing the frontmatter of your Markdown file.
23 | This is often caused by a mistake in the syntax, such as a missing colon or a missing end quote.
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/unsupported-image-format.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Unsupported image format
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | > **UnsupportedImageFormat**: Recibí un formato no admitido `FORMAT` de `IMAGE_PATH`. Actualmente solo se admiten SUPPORTED_FORMATS.JOIN(', ') para optimización. (E03025)
13 |
14 | ## ¿Qué salió mal?
15 | Los servicios precargados de imagen no tienen soporte para optimizar todos los formatos de imagen.
16 |
17 | Para formatos no admitidos como SVG y GIF, puedes usar una etiqueta `img` directamente:
18 | ```astro
19 | ---
20 | import rocket from '../assets/images/rocket.svg'
21 | ---
22 |
23 |
24 | ```
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/content/docs/pt-br/guides/deploy/google-firebase.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Faça o deploy do seu site Astro para o Google Firebase Hosting
3 | description: Como fazer o deploy do seu site Astro usando o Google Firebase Hosting.
4 | type: deploy
5 | i18nReady: true
6 | ---
7 |
8 | [Firebase Hosting](https://firebase.google.com/products/hosting) é uma serviço provido pela plataforma de desenvolvimento de aplicativos da Google, chamado [Firebase](https://firebase.google.com/), que pode ser usado para fazer o deploy de um site Astro.
9 |
10 | ## Como fazer o deploy
11 |
12 | 1. Verifique se o [firebase-tools](https://www.npmjs.com/package/firebase-tools) está instalado.
13 |
14 | 2. Crie os arquivos `firebase.json` e `.firebaserc` na raiz do seu projeto com os seguintes conteúdos:
15 |
16 | `firebase.json`:
17 |
18 | ```json
19 | {
20 | "hosting": {
21 | "public": "dist",
22 | "ignore": []
23 | }
24 | }
25 | ```
26 |
27 | `.firebaserc`:
28 |
29 | ```json
30 | {
31 | "projects": {
32 | "default": ""
33 | }
34 | }
35 | ```
36 |
37 | 3. Depois de executar `npm run build`, faça o deploy usando o comando `firebase deploy`.
38 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/content-schema-contains-slug-error.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Content Schema should not contain slug.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | > A content collection schema should not contain `slug` since it is reserved for slug generation. Remove this from your `COLLECTION_NAME` collection schema. (E09003)
17 |
18 | ## What went wrong?
19 | A content collection schema should not contain the `slug` field. This is reserved by Astro for generating entry slugs. Remove the `slug` field from your schema, or choose a different name.
20 |
21 | **See Also:**
22 | - [The reserved entry `slug` field](/en/guides/content-collections/)
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/failed-to-load-module-ssr.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Could not import file.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | > **FailedToLoadModuleSSR**: Could not import `IMPORT_NAME`. (E04001)
17 |
18 | ## What went wrong?
19 | Astro could not import the requested file. Oftentimes, this is caused by the import path being wrong (either because the file does not exist, or there is a typo in the path)
20 |
21 | This message can also appear when a type is imported without specifying that it is a [type import](/en/guides/typescript/#type-imports).
22 |
23 | **See Also:**
24 | - [Type Imports](/en/guides/typescript/#type-imports)
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/no-client-entrypoint.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: No client entrypoint specified in renderer.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | > **NoClientEntrypoint**: El componente `COMPONENT_NAME` tiene una directiva `client:CLIENT_DIRECTIVE`, pero `RENDERER_NAME` no proporcionó ningún punto de entrada del cliente. (E03008)
13 |
14 | ## ¿Qué salió mal?
15 |
16 | Astro intentó hidratar un componente en el cliente, pero el renderizador utilizado no proporciona un punto de entrada del cliente para hidratar.
17 |
18 | **Ver también:**
19 |
20 | - [Opción addRenderer](/es/reference/integrations-reference/#opción-addrenderer)
21 | - [Hidratando componentes de framework](/es/core-concepts/framework-components/#hidratando-componentes-interactivos)
22 |
23 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/no-matching-static-path-found.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: No static path found for requested path.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | > **NoMatchingStaticPathFound**: A `getStaticPaths()` route pattern was matched, but no matching static path was found for requested path `PATH_NAME`. (E03004)
17 |
18 | ## What went wrong?
19 | A [dynamic route](/en/core-concepts/routing/#dynamic-routes) was matched, but no corresponding path was found for the requested parameters. This is often caused by a typo in either the generated or the requested path.
20 |
21 | **See Also:**
22 | - [getStaticPaths()](/en/reference/api-reference/#getstaticpaths)
23 |
24 |
25 |
--------------------------------------------------------------------------------
/public/favicon.svg:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/no-client-only-hint.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Missing hint on client:only directive.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | > **NoClientOnlyHint**: Unable to render `COMPONENT_NAME`. When using the `client:only` hydration strategy, Astro needs a hint to use the correct renderer. (E03009)
17 |
18 | ## What went wrong?
19 | `client:only` components are not run on the server, as such Astro does not know (and cannot guess) which renderer to use and require a hint. Like such:
20 |
21 | ```astro
22 |
23 | ```
24 |
25 | **See Also:**
26 | - [`client:only`](/en/reference/directives-reference/#clientonly)
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/content/docs/es/reference/errors/invalid-get-static-paths-return.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Invalid value returned by getStaticPaths.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 |
12 | > **InvalidGetStaticPathsReturn**: Tipo no válido devuelto por `getStaticPaths`. Se esperaba un `array`, pero se obtuvo `RETURN_TYPE` (E03011)
13 |
14 | ## ¿Qué salió mal?
15 |
16 | El valor retornado por `getStaticPaths` debe ser un array de objetos.
17 |
18 | ```ts title="pages/blog/[id].astro"
19 | export async function getStaticPaths() {
20 | return [ // <-- Array
21 | { params: { slug: "blog" } },
22 | { params: { slug: "about" } }
23 | ];
24 | }
25 | ```
26 |
27 | **Ver también:**
28 |
29 | - [`getStaticPaths()`](/es/reference/api-reference/#getstaticpaths)
30 | - [`params`](/es/reference/api-reference/#params)
31 |
32 |
--------------------------------------------------------------------------------
/src/content/docs/de/guides/deploy/google-firebase.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Veröffentliche deine Astro-Website auf Google's Firebase Hosting
3 | description: Wie du deine Astro-Website auf Firebase-Hosting von Google im Internet veröffentlichst.
4 | type: deploy
5 | i18nReady: true
6 | ---
7 |
8 | [Firebase Hosting](https://firebase.google.com/products/hosting) ist ein Dienst der App-Entwicklungsplattform [Firebase](https://firebase.google.com/) von Google, der für die Veröffentlichung einer Astro-Website genutzt werden kann.
9 |
10 | ## So funktioniert die Veröffentlichung
11 |
12 | 1. Stelle sicher, dass du [firebase-tools](https://www.npmjs.com/package/firebase-tools) installiert hast.
13 |
14 | 2. Erstelle `firebase.json` und `.firebaserc` im Stammverzeichnis deines Projekts mit dem folgenden Inhalt:
15 |
16 | `firebase.json`:
17 |
18 | ```json
19 | {
20 | "hosting": {
21 | "public": "dist",
22 | "ignore": []
23 | }
24 | }
25 | ```
26 |
27 | `.firebaserc`:
28 |
29 | ```json
30 | {
31 | "projects": {
32 | "default": ""
33 | }
34 | }
35 | ```
36 |
37 | 3. Nachdem du `npm run build` ausgeführt hast, veröffentliche deine Website mit dem Befehl `firebase deploy`.
38 |
--------------------------------------------------------------------------------
/src/content/docs/en/guides/cms/crystallize.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Crystallize & Astro
3 | description: Add content to your Astro project using Crystallize as a CMS
4 | type: cms
5 | stub: true
6 | service: Crystallize
7 | ---
8 | [Crystallize](https://crystallize.com/) is a headless content management system for eCommerce that exposes a GraphQL API.
9 | ## Example
10 |
11 | ```astro title="src/pages/index.astro"
12 | ---
13 | // Fetch your catalogue paths from Crystallize GraphQL API
14 |
15 | import BaseLayout from '../../layouts/BaseLayout.astro';
16 | import { createClient } from '@crystallize/js-api-client';
17 |
18 | const apiClient = createClient({
19 | tenantIdentifier: 'furniture'
20 | });
21 |
22 | const query = `
23 | query getCataloguePaths{
24 | catalogue(language: "en", path: "/shop") {
25 | name
26 | children {
27 | name
28 | path
29 | }
30 | }
31 | }
32 | `
33 | const { data: { catalogue } } = await apiClient.catalogueApi(query)
34 | ---
35 |
36 |
{catalogue.name}
37 |
44 |
45 | ```
46 |
--------------------------------------------------------------------------------
/src/content/docs/en/reference/errors/no-adapter-installed.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | # NOTE: This file is auto-generated from 'scripts/error-docgen.mjs'
3 | # Do not make edits to it directly, they will be overwritten.
4 | # Instead, change this file: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
5 | # Translators, please remove this note and the component.
6 |
7 | title: Cannot use Server-side Rendering without an adapter.
8 | i18nReady: true
9 | githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
10 | ---
11 | import DontEditWarning from '~/components/DontEditWarning.astro'
12 |
13 |
14 |
15 |
16 | > **NoAdapterInstalled**: Cannot use `output: 'server'` without an adapter. Please install and configure the appropriate server adapter for your final deployment. (E03017)
17 |
18 | ## What went wrong?
19 | To use server-side rendering, an adapter needs to be installed so Astro knows how to generate the proper output for your targeted deployment platform.
20 |
21 | **See Also:**
22 | - [Server-side Rendering](/en/guides/server-side-rendering/)
23 | - [Adding an Adapter](/en/guides/server-side-rendering/#adding-an-adapter)
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/content/docs/ja/guides/deploy/google-cloud.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: AstroサイトをGoogle Cloudにデプロイする
3 | description: Google CloudでAstroサイトをウェブにデプロイする方法。
4 | type: deploy
5 | i18nReady: true
6 | ---
7 |
8 | フル機能のWebアプリホスティングプラットフォーム[Google Cloud](https://cloud.google.com/)で、Astroサイトをデプロイできます。
9 |
10 | ## デプロイ方法
11 |
12 | プロジェクトをGoogle Cloudにデプロイするには、いくつかのUIクリックが必要です(これらのアクションのほとんどは、[gcloud CLI](https://cloud.google.com/sdk/gcloud/)を使用しても実行可能です)。
13 |
14 | ### Cloud Run
15 |
16 | 1. 新しいGCPプロジェクトを作成するか、既存のプロジェクトを選択します。
17 |
18 | 2. Cloud Run APIが有効になっていることを確認します。
19 |
20 | 3. 新しいサービスを作成します。
21 |
22 | 4. Docker Hub上のコンテナを使用するか、[Cloud Build](https://cloud.google.com/build)を使用して独自のコンテナをビルドします。
23 |
24 | 5. ファイルが提供されるポートを設定します。
25 |
26 | 6. `allUsers`に`Cloud Run Invoker`という権限を新たに追加することで、パブリックアクセスを有効にします。
27 |
28 | ### Cloud Storage
29 |
30 | 1. 新しいGCPプロジェクトを作成するか、既存のプロジェクトを選択します。
31 |
32 | 2. [Cloud Storage](https://cloud.google.com/storage)に新しいバケットを作成します。
33 |
34 | 3. バケットに名前を付け、他の必要な設定を行います。
35 |
36 | 4. `dist`フォルダをバケットにアップロードするか、[Cloud Build](https://cloud.google.com/build)を使用してアップロードします。
37 |
38 | 5. `allUsers`に`Storage Object Viewer`という権限を新たに追加することで、パブリックアクセスを有効にします。
39 |
40 | 6. ウェブサイトの設定を編集し、エントリポイントとして`ìndex.html`を、エラーページとして`404.html`を追加します。
41 |
--------------------------------------------------------------------------------
/public/logos/markdoc.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------