Nextraでドキュメント構築してみたよ!
nextra
Git管理

Git

Github

Github を利用するのであれば、https://github.com/shuding/nextra-docs-template (opens in a new tab)Use this template ボタンからCreate a new repositoryを選択し、テンプレートからリポジトリを作成で良いのだが、今回は敢えてマニュアルインストールを行う。

リポジトリ作成

github 上もしくは他の Git 管理で Private リポジトリ作成しておく
今回、nextra-docs と言うリポジトリを作成した

ローカル側

.gitignore

next.js をインストールした時点で、git 管理を有効にしていれば、.gitignore が作成されているはずだが、 下記の記述を確認しておこう

.next
node_modules

コミット&プッシュ

next.js をインストールした時点で git 管理を有効にしているので、 下記でリポジトリを Push する

git remote add origin [email protected]:user/nextra-docs.git
git branch -M main
git push -u origin main

なお、Push で Permission Denied が出る場合は、github の URL を https 方式に変更するもしくは、二段階認証になっている場合があるので注意