harbor試してみた
ローカルサーバーでやってみた。
検索は問題なく導入できて動作も問題なさそうだけど、見た目がだいぶ印象変わってしまうのがちょっと悩ましい。
あと、一覧で日付が出てるのに個別ページに遷移すると日付が出ないのはなぜだろう。デモサイトでは個別ページにも出てるのに。
乗り換えはいったん保留。
POSTS
ローカルサーバーでやってみた。
検索は問題なく導入できて動作も問題なさそうだけど、見た目がだいぶ印象変わってしまうのがちょっと悩ましい。
あと、一覧で日付が出てるのに個別ページに遷移すると日付が出ないのはなぜだろう。デモサイトでは個別ページにも出てるのに。
乗り換えはいったん保留。
matsuyoshi30/harbor: Simple and minimal personal blog theme.
このテーマ、全文検索対応しているようなので気になっている。
検索に使われているのはnextapps-de/flexsearch: Next-Generation full text search library for Browser and Node.jsらしい。
flexsearch.jsは日本語だと半角英数字が検索できないとかあるみたいだけど、簡単に使うだけなら問題ないのではないか、問題あったとしても先人の工夫で乗り切れるのではないか。
Algoliaを使ってブログに全文検索をつける(検索ページ編) - PIYO - Tech & Life - を見ながらやって、何とか検索できるのはできたんだけど、色々混ぜて試行錯誤した結果、よくわからないものになってしまっている現状。
なおGitHub Actionsへの組み込みはまだ。
Hugo + Algolia + Instantsearch.jsで静的サイトに全文検索を導入 - OTTANXYZを見ながらやってみた。
とりあえずローカルでできることを確認してから、GitHub Actionsに組み込もうかと。
で、上記サイトは設定ファイルがYAMLだったのでTOMLで書くところで躓いた。
[outputFormats.Algolia]
baseName = "algolia"
isPlainText = true
mediaType = "application/json"
notAlternative = true
これで動いた。
Read moreAWS Amplifyとか、Netlify試したりしていたら、Azure Pipelineでのこのページのビルドが通らなくなってしまったので、設定し直しのついでにGitHub Actionsに移行してみた。
手順はQiitaの記事を見ながらそのままで。
思ったより簡単にできてしまって、最初からこれでよかった感が。。
https://gohugo.io/getting-started/installing/#linux を見たら apt でいけるらしいので
$ apt install hugo
$ hugo version
Hugo Static Site Generator v0.18.1 BuildDate: 2016-12-31T01:01:10+09:00
v0.18.1 ってだいぶ古い。。
$ sudo apt remove hugo
$ wget https://github.com/gohugoio/hugo/releases/download/v0.57.2/hugo_extended_0.57.2_Linux-64bit.tar.gz
$ sha256sum hugo_extended_0.57.2_Linux-64bit.tar.gz
f4ce91d6909d489fe5461633f6b6bd689ed14c9e06b1b7af110024420aa8fd91 hugo_extended_0.57.2_Linux-64bit.tar.gz
$ tar zxvf hugo_extended_0.57.2_Linux-64bit.tar.gz
LICENSE
README.md
hugo
$ sudo cp hugo /usr/local/bin/
$ hugo version
Hugo Static Site Generator v0.57.2-A849CB2D/extended linux/amd64 BuildDate: 2019-08-17T17:57:54Z
OK。
$ hugo new site blog
$ cd blog
$ git clone https://github.com/Track3/hermit.git themes/hermit
$ echo 'theme = "hermit"' >> config.toml
$ hugo new posts/my-first-post.md
$ hugo server -D
Building sites … ERROR 2019/08/21 11:29:11 render of "section" failed: execute of template failed: template: _default/list.html:21:50: executing "main" at <.Site.Params.dateformshort>: invalid value; expected string
ERROR 2019/08/21 11:29:11 render of "taxonomyTerm" failed: execute of template failed: template: _default/list.html:21:50: executing "main" at <.Site.Params.dateformshort>: invalid value; expected string
ERROR 2019/08/21 11:29:11 render of "taxonomy" failed: execute of template failed: template: _default/list.html:21:50: executing "main" at <.Site.Params.dateformshort>: invalid value; expected string
Total in 167 ms
Error: Error building site: failed to render pages: render of "page" failed: "/home/umemak/blog/themes/hermit/layouts/posts/single.html:22:54": execute of template failed: template: posts/single.html:22:54: executing "main" at <.Site.Params.dateform>: invalid value; expected string
なんかエラーでた。。
hermit/exampleSite/config.toml
をconfig.toml
にコピーして解消。
[params]
セクションがないとだめらしい。