- GituhubのページでRマークダウンを管理するリポジトリを作成する。ここでは
statistical_note
とする。
- ローカルPCでRマークダウンを管理するディレクトリを作成する。リポジトリと同じく
statistical_note
とする。いつものようにリモートリポジトリの設定を行う。
❯ mkdir statistical_note
❯ echo "# statistical_note" >> README.md
❯ git init
❯ git add README.md
❯ git commit -m "first commit"
❯ git branch -M main
❯ git remote add origin https://github.com/hogehoge/statistical_note.git
❯ git push -u origin main
- インデックスページ
index.html
の編集。ここでは勉強ノートの目次として利用する。
- 必要あればGithub用に
README
も編集しておく。このあとに行うGithubPagesの設定が問題ないかを確認するためにインデックスページをプッシュしておく。
❯ git add .
❯ git commit -m 'add index page'
❯ git push origin main
- GithubPagesの設定を変更する。リポジトリの設定からPagesにすすみ、Sourceの設定を変更する。問題なければ、
https://hogehoge.github.io/statistical_note/
からアクセス可能(1分くらい反映されるのにかかるかも)。
- 各ノートを管理するディレクトリとRmarkdownをhtmlで作成してプッシュ。ディレクトリ名とRmarkdownのファイル名がURLに対応するので、その点を考慮する。
❯ mkdir note01/
❯ cd note01
❯ ls
note01.Rmd note01.html
❯ git add .
❯ git commit -m 'save note'
❯ git push origin main
- アクセスできるか確認する。さきほどのノートは
https://hogehoge.github.io/statistical_note/note01/note01.html
からアクセス可能
- あとはノートを作る際にディレクトリとRmarkdownを作成する。