Contents
はじめに
少し子育てに余裕が出てきて時間が作れるようになりまして、徐々にブログを再開しておいこうと思います。(昨今のリモートワークで通勤しなくなったのも大きい)
サイトも少しリニューアルしてみました。
今回はkubernetes/websiteをHugoで動かしてみました。
自分用メモです。
参考サイト
github kubernetes
GitHub - kubernetes/website: Kubernetes website and documentation repo:
Kubernetes website and documentation repo: . Contribute to kubernetes/website development by creating an account on GitHub.
website/README-ja.md at main · kubernetes/website
Kubernetes website and documentation repo: . Contribute to kubernetes/website development by creating an account on GitHub.
Hugo公式

Install Hugo
Install Hugo on macOS, Windows, Linux, OpenBSD, FreeBSD, and on any machine where the Go compiler tool chain can run.
NodeJSインストール

CentOSにyumでNodeJS最新版をインストール(NodeSource) - Qiita
NodeJSで開発したアプリケーションを運用するために
CentOSに最新版(またはLTS)のNodeJSをインストールする手順です
パッケージマネージャyumを使ってインストールしたいところですが
EPELリポジトリで提供されてい...
前提
awsのec2でcentos7を使用。
go、gitのversionはこんな感じ。
% go version go version go1.15.2 linux/amd64 % git version git version 2.24.1
t2.smallだとhugo server立ち上げるときにout of memory言われたのでt2.mediumにして動かしました。
Hugoインストールまで
Hugo公式参考にこんな感じで。
Hugoのversionはこちらで指定されていたのでこの時はv0.74.3を使用。
mkdir $HOME/src cd $HOME/src git clone https://github.com/gohugoio/hugo.git cd hugo git checkout tags/v0.74.3 -b branch-v0.74.3 go install --tags extended
これで$HOME/go/bin/hugoが出来たのでPATHを通してあげる。
% hugo version Hugo Static Site Generator v0.74.3/extended linux/amd64 BuildDate: unknown
NodeJSインストール
curl -sL https://rpm.nodesource.com/setup_12.x | bash - ↑失敗。その後↓実行 sudo yum install https://rpm.nodesource.com/pub_12.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm sudo yum install nodejs -y sudo npm update -g npm sudo npm install -g yarn
% node -v v12.18.4 % npm -v 6.14.8
Hugo動かす
git clone git@github.com:hakengineer/website.git ↑forkしたものをgit clone cd website git submodule update --init --recursive --depth 1 hugo server --bind 0.0.0.0 --buildFuture ↑だめそうなら↓もしくはこちら hugo server --bind 0.0.0.0 --baseURL=http://publicip --buildFuture
% hugo server --bind 0.0.0.0 --buildFuture | EN | ZH | KO | JA | FR | IT | DE | ES | PT | ID | RU | VI | PL | UK -------------------+------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+------ Pages | 1120 | 792 | 392 | 301 | 245 | 55 | 104 | 179 | 55 | 247 | 114 | 62 | 53 | 63 Paginator pages | 35 | 5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 Non-page files | 463 | 362 | 225 | 243 | 63 | 24 | 20 | 34 | 24 | 105 | 28 | 12 | 9 | 27 Static files | 770 | 770 | 770 | 770 | 770 | 770 | 770 | 770 | 770 | 770 | 770 | 770 | 770 | 770 Processed images | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 Aliases | 7 | 5 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 Sitemaps | 2 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 Cleaned | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 Built in 53500 ms Watching for changes in /home/centos/git/website/{archetypes,assets,content,data,i18n,layouts,static,themes} Watching for config changes in /home/centos/git/website/config.toml, /home/centos/git/website/themes/docsy/config.toml, /home/centos/git/website/go.mod 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 0.0.0.0) Press Ctrl+C to stop
アクセスは
“http://publicip:1313/”