Skip to content
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

Docusaurusへ移行する #45

Closed
30 tasks done
suin opened this issue Oct 19, 2021 · 1 comment · Fixed by #51
Closed
30 tasks done

Docusaurusへ移行する #45

suin opened this issue Oct 19, 2021 · 1 comment · Fixed by #51
Assignees
Labels
for:執筆者 執筆者の関心がありそうなこと。執筆に関すること。

Comments

@suin
Copy link
Contributor

suin commented Oct 19, 2021

背景

  • PDF出力できるようにしたい
  • CIで自動校閲できるようにしたい
  • GitBookがバギーだったり重かったりするので脱したい

GitBookからDocusaurusに移行してはどうか? · Discussion #38 · yytypescript/book

事前準備

  • Vercelを課金する
  • Vercelとリポジトリを連携する

準備

  • GitBookをreadonlyにする。全員をReader権限に変更する。
  • GitBookのGitHub Integrationを停止する。
  • コンテンツを取り込む
    • docsディレクトリにMarkdownファイルを移す
      • node importFromGitbook/index.js .
      • rm -rf *.md overview reference tips tutorials writing .gitbook .gitbook.yaml
    • 移行スクリプトでMarkdownファイルの内容をDocusaurus用に書き換える
      • node importFromGitbook/updateContent.js
    • 執筆者向けの説明コンテンツを一部追加する
      • cp /Volumes/v/suinplayground/my-website/docs/writing/* docs/writing/
      • sidebar.jsに目次を追加する
    • MarkdownにPrettierをかける
      • yarn prettier:fix
    • 差分を確認しおかしなところを手修正する
    • 移行スクリプトで処理できなかった細かい修正
      • GitBook独自タグを書き換える ag '{%'で探す。
      • アンダースコアはじまりのファイルを、アンダースコアはじまりでなくする
      • バックスラッシュ
      • docs/reference/type-reuse/utility-types/record.md タイトルに謎のバックスラッシュ
    • ローカルでyarn build→yarn serveを試す

プルリクエスト

  • プルリクエストを送る
  • 動作確認
    • Vercel上で動作確認する
    • リダイレクトが効いているか確認する
  • マージする
  • 動作確認
    • /etc/hostsを書き換えて本番ドメインbook.yyts.orgをVercelに向ける
    • Vercel上で動作確認する
    • リダイレクトが効いているか確認する

公開手続き

  • Vercelにカスタムドメインをセットする
  • DNSの設定を変更して、book.yyts.orgをVercelに振り向ける

後処理

  • GitBookの課金を停止する

その後のタスク

これらは別チケットでやる。

This was referenced Oct 19, 2021
@suin suin linked a pull request Oct 19, 2021 that will close this issue
@suin suin closed this as completed in #51 Oct 19, 2021
@suin suin reopened this Oct 19, 2021
@suin suin closed this as completed Oct 20, 2021
@suin
Copy link
Contributor Author

suin commented Oct 20, 2021

Docusaurusへの移行が完了しました。

@suin suin self-assigned this Oct 20, 2021
@suin suin added the for:執筆者 執筆者の関心がありそうなこと。執筆に関すること。 label Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for:執筆者 執筆者の関心がありそうなこと。執筆に関すること。
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant