Skip to content

Commit

Permalink
Merge branch 'main' into translate-page
Browse files Browse the repository at this point in the history
  • Loading branch information
yanthomasdev authored Nov 13, 2023
2 parents ecc3686 + abce1b0 commit c24313e
Show file tree
Hide file tree
Showing 442 changed files with 19,716 additions and 3,681 deletions.
4 changes: 1 addition & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<!-- Thank you for opening a PR! We really appreciate you taking the time to help out 🙌 -->

#### Description (required)
<!-- Please describe the change you are proposing, and why -->

<!-- TAKING PART IN HACKTOBERFEST? LET US KNOW! -->
<!-- See .github/hacktoberfest.md in this repo for more details. -->
<!-- Please describe the change you are proposing, and why -->

#### Related issues & labels (optional)

Expand Down
2 changes: 1 addition & 1 deletion .github/hacktoberfest.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ Reviewed a translation PR? We want you to get credit, too! **Create a PR followi

If you have any questions, just ask, and thank you for helping to translate the Astro Docs!

During Hacktoberfest 2023, we've received 2 translation PR reviews from helpful contributors. Thank you!
During Hacktoberfest 2023, we've received 4 translation PR reviews from helpful contributors. Thank you!
2 changes: 1 addition & 1 deletion contributor-guides/translating-astro-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Unfortunately, we cannot support all languages at this time, and must prioritize

We receive several translation PRs to our repository daily, meaning one of the most helpful and impactful ways to contribute is through **reviews** so that all of these wonderful translations can be properly checked before being published. Keep reading to find out how to contribute on GitHub!

If you're a beginner when it comes to reviewing GitHub PRs and translations, we got you covered in our [Reviewer Process section](#reviewer).
If you're a beginner when it comes to reviewing GitHub PRs and translations, we got you covered in our [Reviewer Process section](#review-process).

> **Note**
> Did you know that reviews and translations count towards your Astro Badge? [Astro Badges](https://astro.badg.es/) is a community initiative made to award contributions to Astro through achievements you can showcase in your GitHub profile!
Expand Down
2 changes: 1 addition & 1 deletion contributor-guides/writing-and-style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ Here are two examples of what our code snippets look like written in Markdown, j
#### Example 2

- use the file name as a title (alt method)
- apply "+ diff" styling (green backround) to any occurrence of `<Button />`
- apply "+ diff" styling (green background) to any occurrence of `<Button />`
- highlight any occurrence of `{props.title}` and `{props.social}`

``````markdown
Expand Down
2 changes: 1 addition & 1 deletion old-translations/de/core-concepts/endpoints.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Alles, was bei den Endpunkten für statische Dateien beschrieben wurde, kann auc
Im Gegensatz zum `static`-Modus werden allerdings im `server`-Modus deine Endpunkte erst dann erzeugt, wenn eine Anfrage für sie empfangen wird. Dies ermöglicht den Zugriff auf neue Funktionen, die zum Erstellungszeitpunkt nicht verfügbar sind, und erlaubt es dir, API-Routen zu erstellen, die auf Anfragen warten und ihren Code zur Laufzeit in einer sicheren Server-Umgebung ausführen.
:::note
Stelle sicher, dass du [SSR aktivierst](/de/guides/server-side-rendering/#ssr-in-deinem-projekt-aktivieren), bevor du diese Beispiele ausprobierst.
Stelle sicher, dass du [SSR aktivierst](/de/guides/server-side-rendering/), bevor du diese Beispiele ausprobierst.
:::
Server-Endpunkte können auf `params` zugreifen, ohne `getStaticPaths` zu exportieren, und sie können ein [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)-Objekt zurückgeben, welches dir ermöglicht, Statuscodes und Header zu setzen:
Expand Down
2 changes: 1 addition & 1 deletion old-translations/de/guides/rss.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Astro unterstützt die schnelle, automatische Generierung von RSS-Feeds für Blo

## Einrichten von `@astrojs/rss`

Das `@astrojs/rss`-Paket bietet Hilfsfunktionen zur Erzeugung von RSS-Feeds mithilfe von [API-Endpunkten](/de/core-concepts/astro-pages/#nicht-html-seiten). Dies ermöglicht _sowohl_ statische Feeds, die zum Erstellungszeitpunkt der Website generiert werden, als auch die On-Demand-Generierung bei Verwendung eines [SSR-Adapters](/de/guides/server-side-rendering/#ssr-in-deinem-projekt-aktivieren).
Das `@astrojs/rss`-Paket bietet Hilfsfunktionen zur Erzeugung von RSS-Feeds mithilfe von [API-Endpunkten](/de/core-concepts/astro-pages/#nicht-html-seiten). Dies ermöglicht _sowohl_ statische Feeds, die zum Erstellungszeitpunkt der Website generiert werden, als auch die On-Demand-Generierung bei Verwendung eines [SSR-Adapters](/de/guides/server-side-rendering/).

Installiere zu Beginn `@astrojs/rss` mit deinem bevorzugten Paketmanager:

Expand Down
2 changes: 1 addition & 1 deletion old-translations/fr/core-concepts/endpoints.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Tout ce qui est décrit dans la section des points de terminaison statiques peut
Mais, à la différence du mode `static`, lorsque vous configurez le mode `server`, les points de terminaison seront construits à la demande. Ceci déverrouille de nouvelles fonctionnalités qui ne sont pas disponibles au moment de la compilation, et vous permet de construire des routes d'API qui écoutent les demandes et exécutent le code de manière sécurisée sur le serveur au moment de l'exécution.
:::note
Soyez sûr d'avoir [activé le SSR](/fr/guides/server-side-rendering/#activation-du-mode-ssr-dans-votre-projet) avant d'essayer ces exemples.
Soyez sûr d'avoir [activé le SSR](/fr/guides/server-side-rendering/) avant d'essayer ces exemples.
:::
Les points de terminaison serveur peuvent accéder aux `params` sans avoir à exporter `getStaticPaths`, et ils peuvent retourner un objet [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response), permettant d'affecter des codes de statut et des en-têtes :
Expand Down
2 changes: 1 addition & 1 deletion old-translations/fr/guides/rss.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Astro prend en charge la génération rapide et automatique de flux RSS pour les

## Mise en place d'`@astrojs/rss`

Le [package `@astrojs/rss`](https://github.com/withastro/astro/tree/main/packages/astro-rss) fournit des fonctions d'aide pour la génération de flux RSS en utilisant des ["API endpoints" (ou points d'arrêt API)](/fr/core-concepts/endpoints/#points-de-terminaison-statiques). Cela permet de débloquer à la fois les builds statiques _et_ la génération à la demande lors de l'utilisation d'un [adaptateur SSR](/fr/guides/server-side-rendering/#activation-du-mode-ssr-dans-votre-projet).
Le [package `@astrojs/rss`](https://github.com/withastro/astro/tree/main/packages/astro-rss) fournit des fonctions d'aide pour la génération de flux RSS en utilisant des ["API endpoints" (ou points d'arrêt API)](/fr/core-concepts/endpoints/#points-de-terminaison-statiques). Cela permet de débloquer à la fois les builds statiques _et_ la génération à la demande lors de l'utilisation d'un [adaptateur SSR](/fr/guides/server-side-rendering/).

Pour commencer, installez `@astrojs/rss` en utilisant votre gestionnaire de Package préféré :

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"astro-auto-import": "^0.3.1",
"astro-eslint-parser": "^0.9.2",
"astro-expressive-code": "^0.20.0",
"astro-og-canvas": "^0.2.1",
"astro-og-canvas": "^0.3.0",
"bcp-47-normalize": "^2.1.0",
"canvaskit-wasm": "^0.37.0",
"dedent-js": "^1.0.1",
Expand Down Expand Up @@ -104,7 +104,7 @@
"remark-smartypants": "^2.0.0",
"sass": "^1.54.3"
},
"packageManager": "pnpm@8.6.12",
"packageManager": "pnpm@8.10.0",
"pnpm": {
"peerDependencyRules": {
"ignoreMissing": [
Expand Down
13 changes: 9 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
WEBVTT
00:00.570 --> 00:06.520
Olá pessoal, eu sou o Dan, e hoje irei te mostrar como utilizar Tailwind CSS com seu projeto Astro.

00:06.815 --> 00:12.415
Você pode ver que tenho um site Astro básico aqui e ele parece bem entediante, então eu quero adicionar alguns estilos a ele.

00:12.500 --> 00:15.500
Vou clicar nesse botão para abrir um novo terminal

00:15.511 --> 00:19.871
onde eu posso executar o comando “npx astro add tailwind”.

00:20.107 --> 00:25.500
Este comando pode ser encontrado na documentação de integrações que vou me certificar de adicionar um link para.

00:26.327 --> 00:34.383
Ele me pede para permití-lo modificar o arquivo de configuração para dar suporte para Tailwind, eu vou em frente apertar "yes" para isso

00:34.563 --> 00:38.673
e agora ele quer instalar o próprio Tailwind e eu definitivamente vou apertar "yes" para isso.

00:39.017 --> 00:44.760
Assim que isso estiver feito, ele quer generar um arquivo de configuração do Tailwind automaticamente, então apertarei "yes"

00:45.076 --> 00:49.365
e agora tudo o que preciso fazer é reiniciar o servidor de desenvolvimento

00:49.447 --> 00:55.857
e podemos ver que eu já tenho alguns bons estilos escritos com Tailwind em um dos meus componentes.

00:56.069 --> 01:02.075
Me deixe só colocar o cabeçalho em negrito, usando Tailwind.

01:02.236 --> 01:04.927
E é isso aí: Tailwind no Astro!
14 changes: 14 additions & 0 deletions public/logos/cosmic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
114 changes: 77 additions & 37 deletions scripts/docgen.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @ts-check

import fs from 'fs';
import jsdoc from 'jsdoc-api';
import fetch from 'node-fetch';
Expand Down Expand Up @@ -42,86 +44,97 @@ const FOOTER = ``;
export async function run() {
const sourceBranch = process.env.SOURCE_BRANCH || 'main';
const sourceRepo = process.env.SOURCE_REPO || 'withastro/astro';

let task = 'Fetch `@types/astro.ts` from ' + sourceRepo + '#' + sourceBranch;
console.time(task);

const inputBuffer =
STUB ||
(await fetch(
`https://raw.githubusercontent.com/${sourceRepo}/${sourceBranch}/packages/astro/src/%40types/astro.ts`
).then((r) => r.text()));

console.timeEnd(task);
task = 'Parse types and generate configuration reference';
console.time(task);

// Get all `@docs` JSDoc comments in the file.
const allComments = [
...inputBuffer.matchAll(/\/\*\*\s*\n([^\*]|\*[^\/])*@docs([^\*]|\*[^\/])*\*\//g),
...inputBuffer.matchAll(/\/\*\*\s*\n([^*]|\*[^/])*@docs([^*]|\*[^/])*\*\//g),
];
const allCommentsInput = allComments
.map((m) => m[0])
.filter((c) => c.includes('* @docs'))
.join('\n\n');

console.log(jsdoc);
console.log(allCommentsInput);
console.log(jsdoc.explainSync({ source: allCommentsInput }));

const allParsedComments = jsdoc
.explainSync({ source: allCommentsInput })
.filter((data) => data.tags);

let result = ``;

for (const comment of allParsedComments) {
if (comment.kind === 'heading') {
result += `## ${comment.name}\n\n`;
if (comment.description) {
result += comment.description.trim() + '\n\n';
}
continue;
}
const cliFlag = comment.tags.find((f) => f.title === 'cli');
const typerawFlag = comment.tags.find((f) => f.title === 'typeraw');
if (!comment.name) {
throw new Error(`Missing @docs JSDoc tag: @name`);
}
if (!comment.type && !typerawFlag) {
throw new Error(`Missing @docs JSDoc tag: @type or @typeraw`);
}
const typesFormatted = typerawFlag
? typerawFlag.text.replace(/\{(.*)\}/, '$1')
: comment.type.names.join(' | ');

result += [
`### ${comment.longname}`,
``,
getHeading(comment),
getDeprecatedAside(comment.deprecated),
`<p>`,
``,
[
`**Type:** \`${typesFormatted}\``,
cliFlag ? `**CLI:** \`${cliFlag.text}\`` : undefined,
comment.defaultvalue ? `**Default:** ${comment.defaultvalue}` : undefined,
comment.version ? `<Since v="${comment.version}" />` : undefined,
]
.filter((l) => l !== undefined)
.join('<br />\n'),
`</p>`,
``,
comment.description && comment.description.trim(),
getCommentProperties(comment),
comment.description?.trim() || undefined,
comment.see
? `**See Also:**\n${comment.see.map((s) => `- ${s}`.trim()).join('\n')}`
: undefined,
`\n\n`,
`\n`,
]
.filter((l) => l !== undefined)
.join('\n');
}

// Make any links to docs relative instead of absolute.
result = result.replace(/https:\/\/docs\.astro\.build\//g, '/');

console.log(result);
console.timeEnd(task);
task = 'Update configuration-reference.mdx';
console.time(task);

fs.writeFileSync(
'src/content/docs/en/reference/configuration-reference.mdx',
HEADER + result + FOOTER,
'utf8'
);

console.timeEnd(task);
}

/**
* Create a string of ### to create a Markdown heading for the given level.
* @param {number} headingLevel
*/
function h(headingLevel) {
return Array.from({ length: headingLevel }).fill('#').join('');
}

/**
* Get a Markdown heading of the correct level for this comment.
* @param {{ kind: string | undefined; longname: string }} comment
*/
function getHeading(comment) {
let headingLevel = 3;
const headingMatches = /^h(1|2|3|4|5|6)$/.exec(comment.kind || '');
if (headingMatches) {
headingLevel = parseInt(headingMatches[1]);
} else if (comment.kind === 'heading') {
headingLevel = 2;
}
return `${h(headingLevel)} ${comment.longname}\n`;
}

/**
* Get a `:::caution` block if the passed tag is deprecated.
* @param {string | undefined} tag
*/
function getDeprecatedAside(tag) {
if (!tag) return undefined;
return [
Expand All @@ -133,4 +146,31 @@ function getDeprecatedAside(tag) {
].join('\n');
}

/**
* Get block of type, CLI command, default value, and version added in for the current comment.
* @param {{ tags: { title: string; text: string }[]; kind: string; type?: { names: string [] }; defaultvalue?: string; version?: string }} comment
*/
function getCommentProperties(comment) {
const cliFlag = comment.tags.find((f) => f.title === 'cli');
const typerawFlag = comment.tags.find((f) => f.title === 'typeraw');

if (comment.kind !== 'heading' && !comment.type && !typerawFlag) {
throw new Error(`Missing @docs JSDoc tag: @type or @typeraw`);
}
const typesFormatted = typerawFlag
? typerawFlag.text.replace(/\{(.*)\}/, '$1')
: comment.type?.names.join(' | ');

const properties = [
typesFormatted ? `**Type:** \`${typesFormatted}\`` : undefined,
cliFlag ? `**CLI:** \`${cliFlag.text}\`` : undefined,
comment.defaultvalue ? `**Default:** ${comment.defaultvalue}` : undefined,
comment.version ? `<Since v="${comment.version}" />` : undefined,
]
.filter((l) => l !== undefined)
.join('<br />\n');

return properties.length ? ['<p>', '', properties, '</p>', ''].join('\n') : undefined;
}

run();
Loading

0 comments on commit c24313e

Please sign in to comment.