|
1 | 1 | --- |
2 | | -title: "Recipes: Deploying Your Site" |
| 2 | +title: "レシピ: サイトをデプロイする" |
3 | 3 | --- |
4 | 4 |
|
5 | | -Showtime. Once you are happy with your site, you are ready to go live with it! |
| 5 | +ショータイム。満足ゆくサイトができたら、あとはそれをデプロイするだけです。 |
6 | 6 |
|
7 | | -## Preparing for deployment |
| 7 | +## デプロイの準備 |
8 | 8 |
|
9 | | -### Prerequisites |
| 9 | +### 前提条件 |
10 | 10 |
|
11 | | -- A [Gatsby site](/docs/quick-start) |
12 | | -- The [Gatsby CLI](/docs/gatsby-cli) installed |
| 11 | +- [Gatsby サイト](/docs/quick-start) |
| 12 | +- [Gatsby CLI](/docs/gatsby-cli)がインストールされていること |
13 | 13 |
|
14 | | -### Directions |
| 14 | +### 手順 |
15 | 15 |
|
16 | | -1. Stop your development server if it is running (`Ctrl + C` on your command line in most cases) |
| 16 | +1. 開発サーバーが起動している場合は停止します。(多くの場合はコマンドラインで `Ctrl + C`) |
17 | 17 |
|
18 | | -2. For the standard site path at the root directory (`/`), run `gatsby build` using the Gatsby CLI on the command line. The built files will now be in the `public` folder. |
| 18 | +2. ルートディレクトリー(`/`)の標準のサイトパスをビルドするには、Gatsby CLI の `gatsby build` を使います。ビルドされたファイルは `public` フォルダーに置かれます。 |
19 | 19 |
|
20 | 20 | ```shell |
21 | 21 | gatsby build |
22 | 22 | ``` |
23 | 23 |
|
24 | | -3. To include a site path other than `/` (such as `/site-name/`), set a path prefix by adding the following to your `gatsby-config.js` and replacing `yourpathprefix` with your desired path prefix: |
| 24 | +3. `/` 以外のサイトパス(`/site-name/` など)をビルドするには、`gatsby-config.js` に次のようにパスのプレフィックスを追記してください。 |
25 | 25 |
|
26 | 26 | ```js:title=gatsby-config.js |
27 | 27 | module.exports = { |
| 28 | + // `/yourpathprefix`を任意のパスに置換 |
28 | 29 | pathPrefix: `/yourpathprefix`, |
29 | 30 | } |
30 | 31 | ``` |
31 | 32 |
|
32 | | -There are a few reasons to do this -- for instance, hosting a blog built with Gatsby on a domain with another site not built on Gatsby. The main site would direct to `example.com`, and the Gatsby site with a path prefix could live at `example.com/blog`. |
| 33 | +これにはいくつかの用途があります -- 例えば、Gatsby 製のブログサイトを Gatsby 製でないサイトと同じドメインでホストする場合です。サイト本体を `example.com` で動かし、パスプレフィックスを設定した Gatsby サイトは `example.com/blog` 以下に置くことができます。 |
33 | 34 |
|
34 | | -4. With a path prefix set in `gatsby-config.js`, run `gatsby build` with the `--prefix-paths` flag to automatically add the prefix to the beginning of all Gatsby site URLs and `<Link>` tags. |
| 35 | +4. パスのプレフィクスを `gatsby-config.js` に設定した後、`gatsby build` を `--prefix-paths` フラグをつけて実行することで、Gatsby サイトの URL と `<Link>` タグのはじめに設定したプレフィクスを自動的に追加できます。 |
35 | 36 |
|
36 | 37 | ```shell |
37 | 38 | gatsby build --prefix-paths |
38 | 39 | ``` |
39 | 40 |
|
40 | | -5. Make sure that your site looks the same when running `gatsby build` as with `gatsby develop`. By running `gatsby serve` when you build your site, you can test out (and debug if necessary) the finished product before deploying it live. |
| 41 | +5. `gatsby build` でビルドした時と `gatsby develop` で動作させた時とでサイトの見た目が変わらないことを確認しましょう。ビルド後に `gatsby serve` をすることで、本番環境へデプロイする前にビルド成果物を確認(またはデバッグ)できます。 |
41 | 42 |
|
42 | 43 | ```shell |
43 | 44 | gatsby build && gatsby serve |
44 | 45 | ``` |
45 | 46 |
|
46 | | -### Additional resources |
| 47 | +### 追加資料 |
47 | 48 |
|
48 | | -- Walk through building and deploying an example site in [tutorial part one](/tutorial/part-one/#deploying-a-gatsby-site) |
49 | | -- Learn about [performance optimization](/docs/performance/) |
50 | | -- Read about [other deployment related topics](/docs/preparing-for-deployment/) |
51 | | -- Check out the [deployment docs](/docs/deploying-and-hosting/) for specific hosting platforms and how to deploy to them |
| 49 | +- サイトを作成しデプロイするまでの一連の[チュートリアル(その 1)](/tutorial/part-one/#deploying-a-gatsby-site) |
| 50 | +- [パフォーマンス最適化](/docs/performance/)について学ぶ |
| 51 | +- [他のデプロイ関連のトピックス](/docs/preparing-for-deployment/)について読む |
| 52 | +- その他ホスティングサービスへのデプロイ方法についての[ドキュメント](/docs/deploying-and-hosting/) |
52 | 53 |
|
53 | | -## Deploying to Netlify |
| 54 | +## Netlify にデプロイする |
54 | 55 |
|
55 | | -Use [`netlify-cli`](https://www.netlify.com/docs/cli/) to deploy your Gatsby application without leaving the command-line interface. |
| 56 | +[`netlify-cli`](https://www.netlify.com/docs/cli/) を使って Gatsby アプリケーションをコマンドラインからデプロイできます。 |
56 | 57 |
|
57 | | -### Prerequisites |
| 58 | +### 前提条件 |
58 | 59 |
|
59 | | -- A [Gatsby site](/docs/quick-start) with a single component `index.js` |
60 | | -- The [netlify-cli](https://www.npmjs.com/package/netlify-cli) package installed |
61 | | -- The [Gatsby CLI](/docs/gatsby-cli) installed |
| 60 | +- `index.js` コンポーネントを持った [Gatsby サイト](/docs/quick-start) |
| 61 | +- [netlify-cli](https://www.npmjs.com/package/netlify-cli)パッケージがインストールされていること |
| 62 | +- [Gatsby CLI](/docs/gatsby-cli)がインストールされていること |
62 | 63 |
|
63 | | -### Directions |
| 64 | +### 手順 |
64 | 65 |
|
65 | | -1. Build your gatsby application using `gatsby build` |
| 66 | +1. `gatsby build` で Gatsby アプリケーションをビルドします。 |
66 | 67 |
|
67 | | -2. Login into Netlify using `netlify login` |
| 68 | +2. `netlify login` で Netlify にログインします。 |
68 | 69 |
|
69 | | -3. Run the command `netlify init`. Select the "Create & configure a new site" option. |
| 70 | +3. `netlify init` を実行し、"Create & configure a new site"(新規サイトを作成/設定)オプションを選択します。 |
70 | 71 |
|
71 | | -4. Choose a custom website name if you want or press enter to receive a random one. |
| 72 | +4. あなたのサイト名を入力します。あるいは空欄のまま Enter を押すとランダムな名前が付けられます。 |
72 | 73 |
|
73 | | -5. Choose your [Team](https://www.netlify.com/docs/teams/). |
| 74 | +5. [チーム](https://www.netlify.com/docs/teams/)を選択します。 |
74 | 75 |
|
75 | | -6. Change the deploy path to `public/` |
| 76 | +6. デプロイパスを `public/` に変更します。 |
76 | 77 |
|
77 | | -7. Make sure that everything looks fine before deploying to production using `netlify deploy --prod` |
| 78 | +7. 正常に動作していることを確認できたら `netlify deploy --prod` で本番環境にデプロイします。 |
78 | 79 |
|
79 | | -### Additional resources |
| 80 | +### 追加資料 |
80 | 81 |
|
81 | | -- [Hosting on Netlify](/docs/hosting-on-netlify) |
| 82 | +- [Netlify でホストする](/docs/hosting-on-netlify) |
82 | 83 | - [gatsby-plugin-netlify](/packages/gatsby-plugin-netlify) |
83 | 84 |
|
84 | | -## Deploying to ZEIT Now |
| 85 | +## ZEIT Now にデプロイする |
85 | 86 |
|
86 | | -Use [Now CLI](https://zeit.co/download) to deploy your Gatsby application without leaving the command-line interface. |
| 87 | +[Now CLI](https://zeit.co/download)を使って Gatsby アプリケーションをコマンドラインからデプロイできます。 |
87 | 88 |
|
88 | | -### Prerequisites |
| 89 | +### 前提条件 |
89 | 90 |
|
90 | | -- A [ZEIT Now](https://zeit.co/signup) account |
91 | | -- A [Gatsby site](/docs/quick-start) with a single component `index.js` |
92 | | -- [Now CLI](https://zeit.co/download) package installed |
93 | | -- [Gatsby CLI](/docs/gatsby-cli) installed |
| 91 | +- [ZEIT Now](https://zeit.co/signup)アカウント |
| 92 | +- `index.js` コンポーネントを持った [Gatsby サイト](/docs/quick-start) |
| 93 | +- [Now CLI](https://zeit.co/download)パッケージがインストールされていること |
| 94 | +- [Gatsby CLI](/docs/gatsby-cli)がインストールされていること |
94 | 95 |
|
95 | | -### Directions |
| 96 | +### 手順 |
96 | 97 |
|
97 | | -1. Login into Now CLI using `now login` |
| 98 | +1. `now login` で Now CLI にログインします。 |
98 | 99 |
|
99 | | -2. Change to the directory of your Gatsby.js application in the Terminal if you aren't already there |
| 100 | +2. Gatsby アプリケーションディレクトリーに移動します。 |
100 | 101 |
|
101 | | -3. Run `now` to deploy it |
| 102 | +3. `now` でデプロイします。 |
102 | 103 |
|
103 | | -### Additional resources |
| 104 | +### 追加資料 |
104 | 105 |
|
105 | | -- [Deploying to ZEIT Now](/docs/deploying-to-zeit-now/) |
| 106 | +- [ZEIT Now にデプロイする](/docs/deploying-to-zeit-now/) |
0 commit comments