From 854a9b9df08f6b1b4b04babaa4382a0e5642a345 Mon Sep 17 00:00:00 2001 From: Shinya Fujino Date: Mon, 5 Jun 2023 10:34:35 +0900 Subject: i18n(ja): Update getting-started.mdx --- docs/src/content/docs/ja/getting-started.mdx | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/docs/src/content/docs/ja/getting-started.mdx b/docs/src/content/docs/ja/getting-started.mdx index 0a7a6dcf..23fc7d0b 100644 --- a/docs/src/content/docs/ja/getting-started.mdx +++ b/docs/src/content/docs/ja/getting-started.mdx @@ -11,7 +11,9 @@ Starlightはまだ開発の初期段階にあります。何か不具合を見 ## 新しいプロジェクトを作成する -Starlightは、オールインワンのフレームワークである[Astro](https://astro.build)の上に構築されています。次のコマンドにより、Astro + Starlightの新しいプロジェクトを作成できます。 +Starlightは、[Astro](https://astro.build)の上に構築された、フル機能のドキュメント向けテーマです。 + +以下のコマンドにより、Astro + Starlightの新しいプロジェクトを作成できます。 @@ -40,7 +42,7 @@ yarn create astro --template starlight -これにより、サイトに必要なすべてのファイルと設定が含まれた、新しいプロジェクトディレクトリが作成されます。 +これにより、サイトに必要なすべてのファイルと設定が含まれた、新しい[プロジェクトディレクトリ](/ja/guides/project-structure/)が作成されます。 :::tip[試してみよう] Starlightをブラウザで試すには、[StackBlitzでテンプレートを開きます](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics)。 @@ -48,11 +50,24 @@ Starlightをブラウザで試すには、[StackBlitzでテンプレートを開 ## Starlightでコンテンツを作成する -Starlightでは、MarkdownとMDXでコンテンツを作成できます。 +以上で、Starlightに新しいコンテンツを追加したり、既存のファイルを持ち込んだりする準備ができました! + +### ファイルフォーマット + +Starlightでは、MarkdownとMDXでコンテンツを作成できます。(Markdocのサポートは、実験的な[AstroのMarkdocインテグレーション](https://docs.astro.build/ja/guides/integrations-guide/markdoc/)をインストールして追加できます。) + +### ページの追加 + +`src/content/docs/`に`.md`または`.mdx`ファイルを作成して、サイトに新しいページを自動で追加できます。ファイルを整理するためにサブフォルダを追加し、複数のパスセグメントを作成することもできます。 + +```js +`src/content/docs/hello-world.md` -> `your-site/hello-world` +`src/content/docs/guides/faq.md` -> `your-site/guides/faq` +``` -`src/content/docs/`に`.md`または`.mdx`ファイルを作成して、新しいページを追加します。たとえば、`src/content/docs/hello-world.md`は、サイトの`/hello-world`からアクセスできます。 +### 型安全なフロントマター -Starlightのページは、ページの表示方法を制御するための、共通のフロントマタープロパティを認識します。 +Starlightのページは、ページの表示方法を制御するための、カスタマイズ可能な[共通のフロントマタープロパティ](/ja/reference/frontmatter/)を認識します。 ```md --- @@ -65,6 +80,6 @@ description: これはStarlightで作成されたサイトのページです ## Starlightサイトをデプロイする -Starlightサイトの作成とカスタマイズが完了したら、お好みのウェブサーバーやホスティングプラットフォームにデプロイできます。Astroには、Netlify、Vercel、GitHub Pagesなど、人気のホスティングプラットフォームへのサポートが組み込まれているため、簡単なコマンドをいくつか実行するだけでウェブサイトをデプロイできます。 +Starlightサイトの作成とカスタマイズが完了したら、Netlify、Vercel、GitHub Pages、その他多くのお好みのウェブサーバーやホスティングプラットフォームにデプロイできます。 [Astroサイトのデプロイについては、Astroのドキュメントを参照してください。](https://docs.astro.build/ja/guides/deploy/) -- cgit From f59caba955266bb36906a282a1c2cc4bdec00cd0 Mon Sep 17 00:00:00 2001 From: Shinya Fujino Date: Mon, 5 Jun 2023 15:50:49 +0900 Subject: i18n(ja): Add project-structure.mdx --- .../content/docs/ja/guides/project-structure.mdx | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 docs/src/content/docs/ja/guides/project-structure.mdx diff --git a/docs/src/content/docs/ja/guides/project-structure.mdx b/docs/src/content/docs/ja/guides/project-structure.mdx new file mode 100644 index 00000000..78fc6778 --- /dev/null +++ b/docs/src/content/docs/ja/guides/project-structure.mdx @@ -0,0 +1,48 @@ +--- +title: ディレクトリ構成 +description: Starlightプロジェクトでファイルをどのように配置するかについて学びます。 +--- + +このガイドでは、Starlightプロジェクトの構成と、プロジェクト内のさまざまなファイルの役割について説明します。 + +Starlightプロジェクトは、基本的に他のAstroプロジェクトと同じファイル・ディレクトリ構成に従います。詳細については、[Astroのディレクトリ構成のドキュメント](https://docs.astro.build/ja/core-concepts/project-structure/)を参照してください。 + +## ファイルとディレクトリ + +- `astro.config.mjs` — Astroの設定ファイルで、ここにStarlightのインテグレーションや設定を記述します。 +- `src/content/config.ts` — コンテンツコレクションの設定ファイルで、Starlightのフロントマタースキーマをプロジェクトに追加します。 +- `src/content/docs/` — コンテンツのファイルが置かれます。Starlightは、このディレクトリ内の各`.md`、`.mdx`、`.mdoc`ファイルを、サイトのページへと変換します。 +- `src/content/i18n/`(任意) — [国際化](/ja/guides/i18n/)をサポートするための翻訳データが置かれます。 +- `src/` — プロジェクトの他のソースコードやファイル(コンポーネント、スタイル、画像など)が置かれます。 +- `public/` — Astroによって処理されない静的アセット(フォント、ファビコン、PDFなど)が置かれます。 + +## プロジェクトの中身の例 + +Starlightプロジェクトのディレクトリは、次のようになります。 + +import FileTree from '../../../../components/file-tree.astro'; + + + +- public/ + - favicon.svg +- src/ + - assets/ + - logo.svg + - screenshot.jpg + - components/ + - CustomButton.astro + - InteractiveWidget.jsx + - content/ + - docs/ + - guides/ + - 01-getting-started.md + - 02-advanced.md + - index.mdx + - config.ts + - env.d.ts +- astro.config.mjs +- package.json +- tsconfig.json + + -- cgit From a4e2ebd3372916814ad447154a62fd870904afde Mon Sep 17 00:00:00 2001 From: Shinya Fujino Date: Mon, 5 Jun 2023 21:13:38 +0900 Subject: i18n(ja): Update configuration.md --- docs/src/content/docs/ja/reference/configuration.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/src/content/docs/ja/reference/configuration.md b/docs/src/content/docs/ja/reference/configuration.md index 65501ed9..20bf64e7 100644 --- a/docs/src/content/docs/ja/reference/configuration.md +++ b/docs/src/content/docs/ja/reference/configuration.md @@ -5,6 +5,21 @@ description: Starlightがサポートするすべての設定オプションの ## `starlight`インテグレーションの設定 +Starlightは[Astro](https://astro.build)ウェブフレームワークの上に構築されたインテグレーションです。Astroの`astro.config.mjs`設定ファイル内でプロジェクトの設定をおこないます。 + +```js +// astro.config.mjs +import { defineConfig } from 'astro/config'; +import starlight from '@astrojs/starlight'; +export default defineConfig({ + integrations: [ + starlight({ + title: "私の楽しいドキュメントサイト", + }), + ], +}); +``` + 以下のオプションを`starlight`インテグレーションに設定できます。 ### `title`(必須) -- cgit