はじめに
Goの勉強でいろいろググっていたら見つけたのでつい気になってしまったので試してみました。
✅環境
Windows/XAMPP/MySQL
✅参考
【初心者向け】HugoをWindowsで使う方法を解説
Hugoで新規記事を作成するときのTips的なメモ
Hugoを試してみた
✅ブログ生成
①hugoをダウンロード こちらから
②任意のフォルダに解答
③環境変数にパスを追加
hugo.exeの入ったディレクトリのパスを登録。僕の場合は以下です。
C:\hugo
④コマンドで確認

⑤任意のディレクトリでサイトを作成
$ hugo new site demosite Congratulations! Your new Hugo site is created in C:\Users\chonm\demosite\demosite. Just a few more steps and you're ready to go: 1. Download a theme into the same-named folder. Choose a theme from https://themes.gohugo.io/ or create your own with the "hugo new theme <THEMENAME>" command. 2. Perhaps you want to add some content. You can add single files with "hugo new <SECTIONNAME>\<FILENAME>.<FORMAT>". 3. Start the built-in live server via "hugo server". Visit https://gohugo.io/ for quickstart guide and full documentation.
⑥テーマのZIPをダウンロード
ここから👉Hugo Themes
⑦解凍したテーマをthemesディレクトリに配置
※その後参考サイト通りに一部のファイルを移動
⑧実行&表示
hugo server

http://localhost:1313にアクセス。左がスマホ、右がPC。レスポンシブ対応。


✅記事作成
記事作成
hugo new post/hello.md
これで反映されると思いきや表示されない。。。
ここまで15分程度で順調だったけど、英語ドキュメントを読む必要ができてしまった。。。
おわりに
翻訳して読んでもよかったけどドキュメントもなかなかの長さだったので気が向いたらまた取り組んでみようと思います。
Gatsbyもノリで挑戦してみようかな。
コメントを残す