-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
i18n(ja): Add guides/migrate-to-astro/from-gitbook.mdx
#11700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jp-knj
wants to merge
3
commits into
withastro:main
Choose a base branch
from
jp-knj:i18n-ja-guides-migrate-to-astro-from-gitbook
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
src/content/docs/ja/guides/migrate-to-astro/from-gitbook.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,72 @@ | ||||||
--- | ||||||
title: GitBookからの移行 | ||||||
description: GitBookプロジェクトをAstroに移行するためのガイド | ||||||
sidebar: | ||||||
label: GitBook | ||||||
type: migration | ||||||
stub: true | ||||||
framework: GitBook | ||||||
i18nReady: true | ||||||
--- | ||||||
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro' | ||||||
|
||||||
[GitBook](https://gitbook.com)は、バージョン管理とカスタマイズ機能を備えたドキュメント、書籍の共同執筆プラットフォームです。 | ||||||
|
||||||
## GitBookとAstroの類似点 | ||||||
|
||||||
GitBookとAstroには、プロジェクト移行を容易にするいくつかの共通点があります。 | ||||||
|
||||||
- どちらも[Markdown](/ja/guides/markdown-content/)をサポートしています。GitBookの**GitSync**機能を使えば、既存ドキュメントをそのまま移行できます。 | ||||||
- どちらも何らかの[ファイルベースルーティング](/ja/guides/routing/)を採用しています。Astroのディレクトリ構造で既存コンテンツを管理しても違和感は少ないでしょう。 | ||||||
|
||||||
## GitBookとAstroの主な相違点 | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
- GitBookサイトはオンラインダッシュボードで編集します。Astroでは[コードエディタ](/ja/editor-setup/)とローカル/クラウドの開発環境でサイトを管理します。 | ||||||
- GitBookはコンテンツをデータベースに保存します。Astroでは各ページをMarkdownやMDXなど**個別ファイル**として[`src/`ディレクトリ](/ja/basics/project-structure/)に配置します。あるいは[CMS](/ja/guides/cms/)と連携してデータを取得することもできます。 | ||||||
- GitBookはMarkdown上に独自構文を追加しています。Astroでは類似構文を持つMarkdocを[Markdocインテグレーション](/ja/guides/integrations-guide/markdoc/)で利用できます。 | ||||||
|
||||||
## GitBookサイトをAstroに変換する | ||||||
|
||||||
GitBookドキュメントサイトをAstroへ移行するには、まず[公式Starlightドキュメントテーマ](https://starlight.astro.build)スターターを使用するか、[テーマショーケース](https://astro.build/themes?search=&categories%5B%5D=docs)でコミュニティ製ドキュメントテーマを探してください。 | ||||||
|
||||||
`create astro`コマンドに`--template`を渡すと、公式スターターで新しいAstroプロジェクトを作成できます。また、[GitHub上の既存Astroリポジトリから新規プロジェクトを開始](/ja/install-and-setup/)することも可能です。 | ||||||
|
||||||
<PackageManagerTabs> | ||||||
<Fragment slot="npm"> | ||||||
```shell | ||||||
npm create astro@latest -- --template starlight | ||||||
``` | ||||||
</Fragment> | ||||||
<Fragment slot="pnpm"> | ||||||
```shell | ||||||
pnpm create astro@latest --template starlight | ||||||
``` | ||||||
</Fragment> | ||||||
<Fragment slot="yarn"> | ||||||
```shell | ||||||
yarn create astro --template starlight | ||||||
``` | ||||||
</Fragment> | ||||||
</PackageManagerTabs> | ||||||
|
||||||
Astroプロジェクトを準備したら、GitBookの[Git Sync機能](https://docs.gitbook.com/product-tour/git-sync)でコンテンツをGitHub/GitLabリポジトリへ同期し、新しいAstroリポジトリに取り込みます。 | ||||||
|
||||||
テンプレートのコンテンツコレクションに直接同期する場合は、`src/content/docs/en`または`src/content/docs`を同期先ディレクトリに指定してください。 | ||||||
|
||||||
同期完了後、AstroリポジトリにGitBookのコンテンツがコピーされます。今後の衝突を防ぐため、GitSyncは無効化してください。 | ||||||
|
||||||
:::caution | ||||||
GitSyncを有効にするときは、必ず優先度を**"GitBook→GitHub"**に設定してください。これによりGitBookのコンテンツがGitHubリポジトリへ同期され、誤って上書きするリスクを防げます。 | ||||||
::: | ||||||
|
||||||
ただし、コンテンツをコピーしただけではそのままAstroで利用できません。GitBook特有の構文をAstro互換へ手動で変換する必要があります。 | ||||||
|
||||||
- Astroの[Markdocインテグレーション](/ja/guides/integrations-guide/markdoc/)を使用する場合、拡張子を`.mdoc`に変更します。`.md`や`.mdx`と競合しないための措置です。 | ||||||
- GitBookのクローズタグ記法(`{/tag}`)はMarkdocでは`{%endtag%}`となるため、ファイル全体で修正します。 | ||||||
- GitBook特有のコンポーネントはAstroに存在しないため、[Markdocの`tags`設定](/ja/guides/integrations-guide/markdoc/#use-astro-components-as-markdoc-tags)で独自タグとして登録するか、ファイルから削除します。 | ||||||
|
||||||
## コミュニティリソース | ||||||
|
||||||
:::note[リソースを共有しませんか?] | ||||||
GitBookサイトをAstroへ変換する際に役立つ動画やブログ記事を見つけた(または作成した)場合は、このリストにぜひ追加してください。[こちらからPRを送れます](https://github.com/withastro/docs/edit/main/src/content/docs/ja/guides/migrate-to-astro/from-gitbook.mdx)。 | ||||||
::: |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここに英語版では
When you migrate your GitBook docs to Astro, you will notice some important differences:
とあるのでここも翻訳を含めた方が良いと思います。下の翻訳は軽く翻訳したものなので完璧ではないですがぜひ追加する際に参考にしてみてください:GitBook DocsからAstroへ移行する際以下の重要な違いがあります。