title | date | draft | tags | |||
---|---|---|---|---|---|---|
Hugo + github-pages でブログを作った |
2017-09-03 15:05:48 +0900 |
false |
|
はてなブログを使っていたが、読み込みが遅い、web で編集をするのがめんどうという理由でブログを更新しなくなった。
そこでローカルで編集ができて、Markdownで書ける方法を探した。どうやらいくつかの方法があるようだが、hugo の評判がいいので hugo を採用した。
$ brew install hugo
$ hugo new site blog
これだけで作れたのでとても楽だった。
$ cd ./themes
$ git clone https://github.com/halogenica/beautifulhugo.git beautifulhugo
$ hugo new post/entry-title
これで content/post/entry-title.md
という記事ができあがる。
$ hugo server -t beautifulhugo -D -w
これで http://localhost:1313/
確認できる。
$ hugo -t beautifulhugo
これで ./public
に 公開用のHTMLが作成される。
config.toml
の設定を書き換える。
publishDir = "docs"
としておくと ./docs
に出力してくれる。こうしておけば github-pages のディレクトリと一致するので github.io で公開できる。
簡単だ。