$ hugo new site blog # 好きなリポジトリ名にしてくださいCongratulations! Your new Hugo site is created in /Users/k_end/private/blog.
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.
Hugoのリポジトリを作成します。これは一瞬で終わりますが、まだこの段階では中身は空っぽです。
1
2
3
4
$ cd blog
$ ls
. .. archetypes config.toml content data layouts static themes
$ git init
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
Initialized empty Git repository in /Users/k_end/private/blog/.git/
$ git submodule add https://github.com/zzossig/hugo-theme-zzo themes/zzo # themes/zzoはカレントディレクトリ配下に作成するディレクトリCloning into '/Users/k_end/private/blog/themes/zzo'...
remote: Enumerating objects: 8620, done.
remote: Counting objects: 100% (75/75), done.
remote: Compressing objects: 100% (59/59), done.
remote: Total 8620(delta 31), reused 37(delta 10), pack-reused 8545Receiving objects: 100% (8620/8620), 10.18 MiB | 6.20 MiB/s, done.
Resolving deltas: 100% (5166/5166), done.
$ ls -a
. .. .git .gitmodules .hugo_build.lock archetypes config.toml content data layouts resources static themes
$ echotheme=\"zzo\" >> config.toml # ここで、theme/zzo の名前を指定する
$ git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage) new file: .gitmodules
new file: themes/zzo
Untracked files:
(use "git add <file>..." to include in what will be committed) archetypes/
config.toml
Zzoの設定
公式で紹介しているテーマであるanankeはディレクトリの構造がシンプルですが、Zzoはわりと複雑です。
(ちなみに、Zzoは多言語化対応していたりして初心者にはちょっと癖の強いテーマです。特にこだわりがないならシンプルなものを選んだほうがいいかもしれません)
ここからはQuick Start – Z Themes Documentationに従っていきます。
# ZzoのexampleSiteの中身をコピーしてまるごと置き換える$ cp -rf themes/zzo/exampleSite/* .
# config/_default/config.toml を使うので、ルートディレクトリのconfig.tomlは削除する$ rm -f config.toml
$ hugo server
Start building sites …
hugo v0.89.4+extended darwin/amd64 BuildDate=unknown
WARN 2021/12/03 23:12:33 The "twitter_simple" shortcode will soon require two named parameters: user and id. See "/Users/k_end/private/blog/content/en/posts/rich-content.md:35:1"# Zzoのサンプルで使われている`twitter_simple`という構文は古いのでWarningが出ている| EN | KO
-------------------+-----+------
Pages |132|28 Paginator pages |3|0 Non-page files |3|0 Static files |127|127 Processed images |0|0 Aliases |36|10 Sitemaps |2|1 Cleaned |0|0Built in 9085 ms
Watching for changes in /Users/k_end/private/blog/{archetypes,content,data,layouts,static,themes}Watching for config changes in /Users/k_end/private/blog/config.toml, /Users/k_end/private/blog/config/_default
Environment: "development"Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)Press Ctrl+C to stop
で、ここまでpushが完了したら、NetlifyにGitHubアカウントでログインします。
「New site from Git」からGitHubを選び、リポジトリを選択します。
とはいえ多分最初はリポジトリが表示されていないはずなので、「Configure the Netlify app on GitHub.」からリポジトリへのアクセスを許可します。