Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.
Merged
Changes from all 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
36 changes: 18 additions & 18 deletions docs/docs/gatsby-project-structure.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Gatsby Project Structure
title: Gatsbyのプロジェクト構造
---

Inside a Gatsby project, you may see some or all of the following folders and files:
Gatsby のプロジェクトは、主に以下のファイルとフォルダーで構成されています。

```
/
Expand All @@ -20,32 +20,32 @@ Inside a Gatsby project, you may see some or all of the following folders and fi
|-- gatsby-browser.js
```

## Folders
## フォルダー

- **`/.cache`** _Automatically generated._ This folder is an internal cache created automatically by Gatsby. The files inside this folder are not meant for modification. Should be added to the `.gitignore` file if not added already.
- **`/.cache`** _自動生成_ このフォルダーは Gatsby によって自動的に生成された内部キャッシュが入っています。このフォルダー内のファイルは編集対象ではありません。`.gitignore` ファイルに追加しておくことを推奨します。

- **`/plugins`** This folder hosts any project-specific ("local") plugins that aren't published as an `npm` package. Check out the [plugin docs](/docs/plugins/) for more detail.
- **`/plugins`** このフォルダーはプロジェクト特有の `npm` パッケージとは別に管理されているローカルプラグインが含まれます。詳細は[プラグインのドキュメント](/docs/plugins/)を参照してください。

- **`/public`** _Automatically generated._ The output of the build process will be exposed inside this folder. Should be added to the `.gitignore` file if not added already.
- **`/public`** _自動生成_ ビルドプロセスによってアウトプットされたファイルが含まれるフォルダーです。`.gitignore` ファイルに追加しておくことを推奨します。

- **`/src`** This directory will contain all of the code related to what you will see on the frontend of your site (what you see in the browser), like your site header, or a page template. “Src” is a convention for “source code”.
- **`/src`** このディレクトリーはあなたのウェブサイトのフロントエンドの(ブラウザーで見える)コード全てを含みます。サイトのヘッダーやページのテンプレートなどです。 “Src” “source code” の略称です

- **`/pages`** Components under src/pages become pages automatically with paths based on their file name. Check out the [pages recipes](/docs/recipes/pages-layouts) for more detail.
- **`/templates`** Contains templates for programmatically creating pages. Check out the [templates docs](/docs/building-with-components/#page-template-components) for more detail.
- **`html.js`** For custom configuration of default .cache/default_html.js. Check out the [custom html docs](/docs/custom-html/) for more detail.
- **`/pages`** src/pages 以下に配置されたコンポーネントは、ファイル名とパスにしたがって自動的にページとして生成されます。詳細は [pages recipes](/docs/recipes/pages-layouts) を参照してください。
- **`/templates`** プログラマブルにページを生成するテンプレートが含まれます。詳細は[コンポーネントを利用してビルドする](/docs/building-with-components/#page-template-components) を参照してください。
- **`html.js`** 標準的な `.cache/default_html.js` のためのカスタム設定です。詳細は [html.js をカスタマイズする](/docs/custom-html/)を参照してください。

- **`/static`** If you put a file into the static folder, it will not be processed by Webpack. Instead it will be copied into the public folder untouched. Check out the [assets docs](/docs/static-folder/#adding-assets-outside-of-the-module-system) for more detail.
- **`/static`** このフォルダーに配置したファイルは、Webpack によってビルドされません。その代わり `public` フォルダーに直接コピーされます。詳細は [static フォルダーーを使う](/docs/static-folder/#adding-assets-outside-of-the-module-system) を参照してください。

## Files
## 設定ファイル

- **`gatsby-browser.js`**: This file is where Gatsby expects to find any usage of the [Gatsby browser APIs](/docs/browser-apis/) (if any). These allow customization/extension of default Gatsby settings affecting the browser.
- **`gatsby-browser.js`**: このファイルは Gatsby がどのように [Gatsby browser APIs](/docs/browser-apis/) を利用するか記述します。このファイルにより、ブラウザー上で実行するプログラムの設定を行えます。

- **`gatsby-config.js`**: This is the main configuration file for a Gatsby site. This is where you can specify information about your site (metadata) like the site title and description, which Gatsby plugins you’d like to include, etc. Check out the [config docs](/docs/gatsby-config/) for more detail.
- **`gatsby-config.js`**: このファイルは、Gatsby で構築するウェブサイトの主要な設定ファイルです。あなたのウェブサイトにおけるタイトルや説明などのメタデータや、Gatsby プラグインの設定などが含まれます。 詳しくは [config docs](/docs/gatsby-config/) を参照してください。

- **`gatsby-node.js`**: This file is where Gatsby expects to find any usage of the [Gatsby node APIs](/docs/node-apis/) (if any). These allow customization/extension of default Gatsby settings affecting pieces of the site build process.
- **`gatsby-node.js`**: このファイルには、Gatsby がどのように [Gatsby node APIs](/docs/node-apis/) を利用するか記述します。このファイルにより、どのようにウェブサイトをビルドするか設定できます。

- **`gatsby-ssr.js`**: This file is where Gatsby expects to find any usage of the [Gatsby server-side rendering APIs](/docs/ssr-apis/) (if any). These allow customization of default Gatsby settings affecting server-side rendering.
- **`gatsby-ssr.js`**: このファイルには、Gatsby がどのように [Gatsby server-side rendering APIs](/docs/ssr-apis/)を利用するか記述します。このファイルにより、どのようにサーバーサイドレンダリングを行うか設定できます。

## Miscellaneous
## その他のフォルダー・ファイル

The file/folder structure described above reflects Gatsby-specific files and folders. Since Gatsby sites are also React apps, it's common to use standard React code organization patterns such as folders like `/components` and `/utils` inside `/src`. The [React docs](https://reactjs.org/docs/faq-structure.html) have more information on a typical React app folder structure.
これらのファイル・フォルダー構成は全て Gatsby プロジェクト固有のものです。そして、Gatsby ウェブサイトは React アプリでもあります、React アプリのプロジェクト構造パターン、 `/components` `/utils` `/src` の中に含まれています。 これらのフォルダーについては [React のドキュメント](https://reactjs.org/docs/faq-structure.html) に代表的な使用例が記載されています。