Hugoを使ったブログの投稿までの流れ
Setup Hugo blog ホームページにblogを追加するためにHugoを使ってみました。 このページが表示されているならば構築に成功したということです。 公式のquick-startに沿ってコマンドを実行しました。 https://gohugo.io/getting-started/quick-start/ 公式と違う部分はthemeを変えています。 themeは↓のURLから選んで、ページ内のgithubのurlを使います。 https://themes.gohugo.io/tags/blog/ brew install hugo hugo new site blog git submodule add --depth=1 https://github.com/adityatelange/hugo-PaperMod.git themes/PaperMod git submodule update --init --recursive echo "theme = 'PaperMod'" >> hugo.toml hugo new content posts/my-first-post.md マークダウンで内容を書く posts/my-first-post.md に何かを書きます。 マークダウンを使います。 ローカルにサーバーを立てる 次のコマンドで、https://localhost:1313 にアクセスできるようになります。 hugo server -D 静的サイトのビルド postsにあるmdファイル内のドラフトフラグをfalseにします。 ドラフトがtrueだとビルドしても静的ファイルは生成されません。 次のコマンドで静的サイトのデータがpublicフォルダに生成されます。 hugo デプロイ git経由でpublicをサーバーに持っていきます。 hugoで生成したpublicをpublic_htmlなどの公開可能な場所に置く。