Skip to content

Commit

Permalink
Merge branch 'main' into ci/docgen-integrations
Browse files Browse the repository at this point in the history
  • Loading branch information
sarah11918 authored Sep 11, 2023
2 parents f532321 + bcebcef commit 5d018a0
Show file tree
Hide file tree
Showing 9 changed files with 105 additions and 38 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/content/docs/de/guides/deploy/google-cloud.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ docker push HOSTNAME/PROJECT-ID/IMAGE:TAG
Ändere die folgenden Werte in den obigen Befehlen, damit sie zu deinem Projekt passen:

- `SOURCE_IMAGE`: Der lokalen Image-Namen oder die Image-ID.
- `HOSTNAME`: Der Registry-Host (`gcr.io`, `eu.grc.io`, `asia.gcr.io`, `us.gcr.io`).
- `HOSTNAME`: Der Registry-Host (`gcr.io`, `eu.gcr.io`, `asia.gcr.io`, `us.gcr.io`).
- `PROJECT`: Deine Google Cloud Projekt-ID.
- `TARGET-IMAGE`: Der Name für das Image, wenn es in der Registry gespeichert wird.
- `TAG` Die Version, die mit dem Image verknüpft ist
Expand Down
8 changes: 6 additions & 2 deletions src/content/docs/en/guides/cms/storyblok.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ import { useStoryblokApi } from '@storyblok/astro'
const storyblokApi = useStoryblokApi();
const { data } = await storyblokApi.get('cdn/stories/blog', {
const { data } = await storyblokApi.get('cdn/stories', {
version: import.meta.env.DEV ? "draft" : "published",
content_type: 'blogPost',
})
Expand Down Expand Up @@ -443,7 +443,11 @@ const story = data.story;
</html>
```

This file will generate a page for each story, with the slug and content fetched from the Storyblok API.
This file will generate a page for each story, with the slug and content fetched from the Storyblok API.

:::note
When adding folders inside of Storyblok, include them in the slug when interacting with the Storyblok API. For example, in the GET request above we can use **cdn/stories/blog**, with a blog folder inside rather than using them at the root.
:::

#### Server-side rendering

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/deploy/google-cloud.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ docker push HOSTNAME/PROJECT-ID/IMAGE:TAG
Change the following values in the commands above to match your project:

- `SOURCE_IMAGE`: the local image name or image ID.
- `HOSTNAME`: the registry host (`gcr.io`, `eu.grc.io`, `asia.gcr.io`, `us.gcr.io`).
- `HOSTNAME`: the registry host (`gcr.io`, `eu.gcr.io`, `asia.gcr.io`, `us.gcr.io`).
- `PROJECT`: your Google Cloud project ID.
- `TARGET-IMAGE`: the name for the image when it's stored in the registry.
- `TAG` is the version associated with the image.
Expand Down
85 changes: 54 additions & 31 deletions src/content/docs/en/recipes/bun.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,83 +5,106 @@ type: recipe
i18nReady: true
---

[Bun](https://bun.sh/) is a runtime for JavaScript built for speed. See [Bun's documentation](https://bun.sh/docs) for more information.
[Bun](https://bun.sh/) is an all-in-one JavaScript runtime & toolkit. See [Bun's documentation](https://bun.sh/docs) for more information.

Using Bun with Astro still is experimental. Some integrations may not work as expected. If you have [any problems using Bun](https://github.com/oven-sh/bun/issues/new/choose), please [open an issue on GitHub](https://github.com/withastro/astro/issues/new/choose)!
:::caution
Bun recently made their first stable release. However, using Bun with Astro may reveal rough edges. Some integrations may not work as expected. Consult [Bun's official documentation for working with Astro](https://bun.sh/guides/ecosystem/astro) for details.

## Installing Bun

Use the following command to install Bun:
If you have any problems using Bun, please [open an Issue on GitHub with Bun directly](https://github.com/oven-sh/bun/issues/new/choose).
:::

## Prerequisites

```bash
curl -fsSL https://bun.sh/install | bash
```
- Bun installed locally on your machine. See the [installation instructions](https://bun.sh/docs/installation) in Bun's official documentation.

## Create a new Astro project with Bun

Create a new Astro project with Bun using the following `create astro` command:
Create a new Astro project with Bun using the following `create-astro` command:

```bash
bunx create-astro@latest my-astro-project-using-bun
```

:::tip[Tip]
You can also [create a new Astro project from any existing Astro GitHub repository](/en/install/auto/#starter-templates) using the `--template` flag:
:::tip
You may also [create a new Astro project from any existing Astro GitHub repository](/en/install/auto/#starter-templates) using the `--template` flag:
```bash
bunx create-astro@latest my-astro-project-using-bun --template eliancodes/brutal
```
:::

## Install your dependencies
## Install dependencies

If you're starting a new project using `bunx create-astro`, the CLI will automatically use Bun to install dependencies and you can skip this step.
If you're starting a new project using `bunx create-astro`, the CLI will automatically use Bun to install dependencies and you can skip this step.

Otherwise, you'll need to install your dependencies with Bun:

```bash
bun install
```

## Running the development server
## Using Astro integrations

To run the development server, use the following command:
You can also use any of the official Astro integrations with the `astro add` command:

```bash
bun run dev
bunx astro add react
```

:::note[Note]
Use the full command `bun run dev` to start your Astro development server. The command `bun dev` will start Bun's own internal dev server.
## Run Astro with Bun

:::note
Use the [`--bun` CLI flag](https://bun.sh/docs/cli/bunx#shebangs) before every `astro` command to use Bun's own runtime in place of Node.
:::

## Using Astro integrations
### Run the development server

You can also use any of the official Astro integrations with Bun and the `astro add` command:
To run the development server using Bun as the runtime, use the following command:

```bash
bunx astro add react
bun --bun astro dev
```

This will work exactly the same as if you were using NPM, but with the added benefit of using Bun's blazing fast runtime.
### Building your site with Bun

:::note[Note]
Some integrations might not work as expected. If you find any issues, please [open an issue on GitHub](https://github.com/withastro/astro/issues/new/choose)!
:::
To build your site using Bun as the runtime, use the following command:

```bash
bun --bun astro build
```

Astro will output your site to the `dist/` directory. Then, you can serve your site using the `preview` command:

```bash
bun --bun astro preview
```

## Add SSR with Bun using `@astrojs/node`

## Building your site with Bun
Bun features [Node.js API compatibility](https://bun.sh/docs/runtime/nodejs-apis). Using the [`@astrojs/node`](/en/guides/integrations-guide/node/) adapter you can add [server-side rendering](/en/guides/server-side-rendering/) to your Astro project using Bun's runtime as a replacement for Node.

To build and serve your site, Bun has familiar commands:
Run the following command to add the Node.js adapter to your Astro project:

```bash
bun run build
bunx astro add node
```

Bun's build command will output your site to the `dist/` directory.
Build your site again, using the same build command as above:

Then, you can serve your site using the `preview` command:
```bash
bun --bun astro build
```
Finally, use the following command to run your built site.

```bash
bun preview
bun ./dist/server/entry.mjs
```

## Official Resources

- [Build an app with Astro and Bun](https://bun.sh/guides/ecosystem/astro)

## Community Resources

Using Bun with Astro? Add your blog post or video to this page!

- [Building a Cloudflare Pages site with Bun](https://blog.otterlord.dev/posts/hello-from-bun/) - blog post
2 changes: 1 addition & 1 deletion src/content/docs/es/guides/deploy/google-cloud.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ docker push HOSTNAME/PROJECT-ID/IMAGE:TAG
Cambia los valores siguientes en los comandos anteriores para que coincidan con tu proyecto:

- `SOURCE_IMAGE`: el nombre de la imagen local o el ID de la imagen.
- `HOSTNAME`: el host del registro (`gcr.io`, `eu.grc.io`, `asia.gcr.io`, `us.gcr.io`).
- `HOSTNAME`: el host del registro (`gcr.io`, `eu.gcr.io`, `asia.gcr.io`, `us.gcr.io`).
- `PROJECT`: el ID de tu proyecto de Google Cloud.
- `TARGET-IMAGE`: el nombre para la imagen cuando se almacena en el registro.
- `TAG` es la versión asociada con la imagen.
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/pt-br/guides/deploy/google-cloud.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ docker push HOSTNAME/PROJECT-ID/IMAGE:TAG
Mude os seguintes valores nos comandos acima para condizer com seu projeto:

- `SOURCE_IMAGE`: o nome ou ID da imagem local.
- `HOSTNAME`: a hospedagem do registro (`gcr.io`, `eu.grc.io`, `asia.gcr.io`, `us.gcr.io`).
- `HOSTNAME`: a hospedagem do registro (`gcr.io`, `eu.gcr.io`, `asia.gcr.io`, `us.gcr.io`).
- `PROJECT`: o ID do seu projeto do Google Cloud.
- `TARGET-IMAGE`: o nome que a imagem terá ao ser armazenada no registro.
- `TAG` é a versão associada com a imagem.
Expand Down
42 changes: 41 additions & 1 deletion src/i18n/de/docsearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,45 @@ export default DocSearchDictionary({
button: 'Suchen',
placeholder: 'Dokumentation durchsuchen',
shortcutLabel: 'Drücke / zum Suchen',
modal: {},
resultsFooterLede:
'Auf der Suche nach einer Astro-Integration oder einer Vorlage? Brauchst du mehr Hilfe?',
resultsFooterIntegrations: 'Verzeichnis der Astro-Intergrationen',
resultsFooterThemes: 'Galerie mit Astro-Vorlagen',
resultsFooterDiscord: 'Tritt unserem Discord bei',
modal: {
searchBox: {
resetButtonTitle: 'Suchanfrage löschen',
resetButtonAriaLabel: 'Suchanfrage löschen',
cancelButtonText: 'Abbrechen',
cancelButtonAriaLabel: 'Abbrechen',
},
startScreen: {
recentSearchesTitle: 'Neuliche Suchanfragen',
noRecentSearchesText: 'Keine neulichen Suchanfragen',
saveRecentSearchButtonTitle: 'Diese Suchanfrage speichern',
removeRecentSearchButtonTitle: 'Diese Suchanfrage aus dem Verlauf entfernen',
favoriteSearchesTitle: 'Favoriten',
removeFavoriteSearchButtonTitle: 'Diese Suchanfrage aus den Favoriten entfernen',
},
errorScreen: {
titleText: 'Fehler beim Abrufen der Ergebnisse',
helpText: 'Du solltest den Status deiner Internetverbindung überprüfen',
},
footer: {
selectText: 'zum Auswählen',
selectKeyAriaLabel: 'Eingabetaste',
navigateText: 'zum Navigieren',
navigateUpKeyAriaLabel: 'Pfeiltaste nach oben',
navigateDownKeyAriaLabel: 'Pfeiltaste nach unten',
closeText: 'zum Schließen',
closeKeyAriaLabel: 'Escapetaste',
searchByText: 'Suche von',
},
noResultsScreen: {
noResultsText: 'Keine Ergebnisse gefunden für',
suggestedQueryText: 'Versuche es mit der Suche nach',
reportMissingResultsText: 'Glaubst du, einen Fehler gefunden zu haben?',
reportMissingResultsLinkText: 'Lass es uns wissen',
},
},
});

0 comments on commit 5d018a0

Please sign in to comment.