Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions src/content/docs/ja/guides/deploy/netlify.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,28 @@ i18nReady: true

## プロジェクトの設定

Astroプロジェクトは、静的サイト、サーバーレンダリングサイト、(実験的な)エッジレンダリングサイトの3つの異なる方法でNetlifyにデプロイできます。
Astroプロジェクトは、静的サイト、サーバーレンダリングサイト、エッジレンダリングサイトの3つの異なる方法でNetlifyにデプロイできます。

### 静的サイト

Astroプロジェクトは、デフォルトでは静的サイトです。Netlifyに静的Astroサイトをデプロイするために、特に追加の設定は必要ありません。

### SSR/Edge用のアダプターを追加する
### SSR用のアダプターを追加する

AstroプロジェクトでSSRを有効にし、Netlifyにデプロイするには、以下の`astro add`コマンドで[Netlifyアダプター](/ja/guides/integrations-guide/netlify/)を追加します。これにより、アダプターがインストールされ、`astro.config.mjs`ファイルが1つのステップで適切に変更されます。
AstroプロジェクトでSSRを有効にし、NetlifyのEdge Functionsを使用してNetlifyにデプロイするには:

以下の`astro add`コマンドで[Netlifyアダプター](/ja/guides/integrations-guide/netlify/)を追加し、AstroプロジェクトでSSRを有効にします。これによりアダプタがインストールされ、`astro.config.mjs`ファイルに適切な変更が1ステップで行われます。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

表記揺れだと思うので修正お願いします

Suggested change
以下の`astro add`コマンドで[Netlifyアダプター](/ja/guides/integrations-guide/netlify/)を追加し、AstroプロジェクトでSSRを有効にします。これによりアダプタがインストールされ`astro.config.mjs`ファイルに適切な変更が1ステップで行われます。
以下の`astro add`コマンドで[Netlifyアダプター](/ja/guides/integrations-guide/netlify/)を追加し、AstroプロジェクトでSSRを有効にします。これによりアダプターがインストールされ`astro.config.mjs`ファイルに適切な変更が1ステップで行われます。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます。こちらで修正しました。 564cd5d


```bash
npx astro add netlify
```

アダプターを手動でインストールする場合は、以下の2つのステップを実行してください。

1. [`@astrojs/netlify`アダプター](https://github.com/withastro/astro/tree/main/packages/integrations/netlify)を、パッケージマネージャーを使ってプロジェクトの依存関係にインストールします。npmをパッケージマネージャーとして使用しているかどうかわからない場合は、ターミナルで以下のコマンドを実行します。
1. [`@astrojs/netlify`アダプター](/ja/guides/integrations-guide/netlify/)を、パッケージマネージャーを使ってプロジェクトの依存関係にインストールします。npmをパッケージマネージャーとして使用しているかどうかわからない場合は、ターミナルで以下のコマンドを実行します。

```bash
npm install @astrojs/netlify
npm install @astrojs/netlify
```

1. `astro.config.mjs`プロジェクト設定ファイルに新しく以下の2行を追加します。
Expand All @@ -44,15 +46,18 @@ npx astro add netlify
});
```

[Netlifyの実験的Edge Functions](https://docs.netlify.com/netlify-labs/experimental-features/edge-functions/#app)を使ってプロジェクトをレンダリングするには、Astro設定ファイルの`netlify/functions`インポートを`netlify/edge-functions`に変更します。
```js title="astro.config.mjs" ins={3} del={2}
Netlifyアダプタの設定に`edgeMiddleware: true`を追加することで、NetlifyのEdge Functionsを使用してプロジェクトをデプロイすることもできます。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

上記同様表記揺れだと思うので修正お願いします

Suggested change
Netlifyアダプタの設定に`edgeMiddleware: true`を追加することで、NetlifyのEdge Functionsを使用してプロジェクトをデプロイすることもできます。
Netlifyアダプターの設定に`edgeMiddleware: true`を追加することで、NetlifyのEdge Functionsを使用してプロジェクトをデプロイすることもできます。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます。こちらも修正しました。 564cd5d


```diff lang="js"
// astro.config.mjs
import { defineConfig } from 'astro/config';
import netlify from '@astrojs/netlify/functions';
import netlify from '@astrojs/netlify/edge-functions';

export default defineConfig({
output: 'server',
adapter: netlify(),
adapter: netlify({
+ edgeMiddleware: true
}),
});
```

Expand Down Expand Up @@ -133,4 +138,4 @@ Netlify FunctionsとAstroを併用して使う場合、特別な設定は必要

- [Astroサイトのデプロイ方法](https://www.netlify.com/blog/how-to-deploy-astro/) — Netlifyブログ
- [フォーム、サーバーレスファンクション、リダイレクトを利用したAstroサイトのデプロイ](https://www.netlify.com/blog/deploy-an-astro-site-with-forms-serverless-functions-and-redirects/) — Netlifyブログ
- [開発の実演動画](https://youtu.be/GrSLYq6ZTes) — Netlify YouTubeチャンネル
- [開発の実演動画](https://youtu.be/GrSLYq6ZTes) — Netlify YouTubeチャンネル
2 changes: 1 addition & 1 deletion src/content/docs/ja/reference/configuration-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ Astroコンポーネント内のスタイルをスコープするための戦略
**データ型:** `AstroIntegration`
</p>

ビルドアダプターにより、好みのサーバー、サーバーレス、エッジのホストにデプロイできます。[Netlify](/ja/guides/deploy/netlify/#ssredge用のアダプターを追加する)や[Vercel](/ja/guides/deploy/vercel/#ssrアダプター)などのファーストパーティーのアダプターをインポートし、AstroのSSRを活用しましょう。
ビルドアダプターにより、好みのサーバー、サーバーレス、エッジのホストにデプロイできます。[Netlify](/ja/guides/deploy/netlify/#ssr用のアダプターを追加する)や[Vercel](/ja/guides/deploy/vercel/#ssrアダプター)などのファーストパーティーのアダプターをインポートし、AstroのSSRを活用しましょう。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こちらの変更ですが、このまま更新してしまうとconfiguration-reference.mdxが更新されてしまい、翻訳の更新履歴が追えなくなってしまうかもしれません
お手数ですが、新しく先頭に[i18nIgnore]を付けてPRを作成して頂ければと思います

上記、私もやったことが無く申し訳ないのですが、下記に翻訳の履歴を更新しないやり方として書かれていますので参考までにご確認ください
https://github.com/withastro/docs/blob/main/contributor-guides/translating-astro-docs.md#pull-request-guidelines

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます。失礼しました 🙇

こちらrevertし ( 0547b75 )、URLの修正を別PRとして作りました。
[i18nIgnore] Update netlify URL in /ja/reference/configuration-reference.mdx #5557


SSRについて詳しくは[サーバーサイドレンダリングのガイド](/ja/guides/server-side-rendering/)を、ホストの完全な一覧は[デプロイのガイド](/ja/guides/deploy/)を確認してください。

Expand Down