Hugoをインストールする
$ hugo new site shared/site
$ cd site
$ code config.toml
baseURL = "http://sonohen.github.io/"
languageCode = "ja-JP"
title = "sonohen's tech log"
$ hugo
ここの時点で,publicディレクトリーが作られていることを確認する。
Hugo Themeにすぐに使えるテーマが掲載されている。
今回は,Hugo Theme Minosを利用する。
$ cd themes/
$ git clone --depth 1 https://github.com/carsonip/hugo-theme-minos
$ code ../../config.toml
theme = "hugo-theme-minos"
paginate = 10
[params]
smartToc = true
$ hugo
- blogレポジトリを作る
- これはprivateレポジトリで良い
- sonohen.github.ioレポジトリを作る
public/は,サブモジュールとして管理する。レポジトリが別なため。
git submodule add -b master git@github.com:sonohen/sonohen.github.io.git public
以下のエラーではまったでござる。
$ git submodule add -b master git@github.com:sonohen/sonohen.github.io.git public
A git directory for 'public' is found locally with remote(s):
origin https://github.com/sonohen/sonohen.github.io.git
If you want to reuse this local git directory instead of cloning again from
git@github.com:sonohen/sonohen.github.io.git
use the '--force' option. If the local git directory is not the correct repo
or you are unsure what this means choose another name with the '--name' option.
この場合,古いsubmodule情報が".git/“以下に残っていることが原因なので,以下のディレクトリとファイルの中身を確認して,古いファイルを削除してやる必要がある。
- .git/modules/
- .git/config
こうならないためには,以下のようにsubmoduleを削除しましょう。
git submodule deinit <消したいsubmodueへのパス>
git rm <消したいsubmoduleへのパス>
- Hugofy(akmittal.hugofy)をインストールする。
- Hugofy: New Postを選択する。
- 記事を書く。
- Hugofy: Buildを選択する。
- siteとpublicをcommit&pushする。