毎日学習記録 9/6 ブログテンプレート変更

Share on:

概要

ブログテンプレート変更

内容

テンプレート変更で少し手こずったところがあるのでメモ

設定前のテンプレートは、paperを使用していたが、もう少しブログっぽい見た目にしたいと思ったので、変更作業をおこなった。

ただ、hugo自体ほとんど勉強していなかったので1時間ほど設定にかかってしまったのと、ほとんど情報がなかったのでメモしておこうと思う。

採用したテーマ

シンプルだけど結構見た目がよかったこちらを採用

https://themes.gohugo.io/hugo-clarity/

インストール方法

独自に書き換えたりなどするつもりはないので、一旦はそのままクローンする。

気が向いたら、サブモジュールに切り替えていく予定。

 git clone https://github.com/chipzoller/hugo-clarity themes/hugo-clarity

詰まった箇所

発生したエラー

ERROR 2020/09/07 01:15:02 render of "page" failed: execute of template failed: template: _default/single.html:24:6: executing "main" at <partial "sidebar" .>: error calling partial: "path/themes/hugo-clarity/layouts/partials/sidebar.html:35:45": execute of template failed: template: partials/sidebar.html:35:45: executing "partials/sidebar.html" at <first $numberOfTagsLimit>: error calling first: both limit and seq must be provided
ERROR 2020/09/07 01:15:02 render of "page" failed: execute of template failed: template: _default/single.html:24:6: executing "main" at <partial "sidebar" .>: error calling partial: "path/themes/hugo-clarity/layouts/partials/sidebar.html:35:45": execute of template failed: template: partials/sidebar.html:35:45: executing "partials/sidebar.html" at <first $numberOfTagsLimit>: error calling first: both limit and seq must be provided
ERROR 2020/09/07 01:15:02 render of "page" failed: execute of template failed: template: _default/single.html:24:6: executing "main" at <partial "sidebar" .>: error calling partial: "path/themes/hugo-clarity/layouts/partials/sidebar.html:35:45": execute of template failed: template: partials/sidebar.html:35:45: executing "partials/sidebar.html" at <first $numberOfTagsLimit>: error calling first: both limit and seq must be provided
ERROR 2020/09/07 01:15:02 render of "page" failed: execute of template failed: template: _default/single.html:24:6: executing "main" at <partial "sidebar" .>: error calling partial: "path/themes/hugo-clarity/layouts/partials/sidebar.html:35:45": execute of template failed: template: partials/sidebar.html:35:45: executing "partials/sidebar.html" at <first $numberOfTagsLimit>: error calling first: both limit and seq must be provided
ERROR 2020/09/07 01:15:02 failed to render pages: render of "page" failed: execute of template failed: template: _default/single.html:24:6: executing "main" at <partial "sidebar" .>: error calling partial: "path/themes/hugo-clarity/layouts/partials/sidebar.html:35:45": execute of template failed: template: partials/sidebar.html:35:45: executing "partials/sidebar.html" at <first $numberOfTagsLimit>: error calling first: both limit and seq must be provided
Rebuilt in 89 ms
忘れた設定内容

ポイントは、[params]のセクション内に書き込むということ。パラメーターには気が付いていたが、セクションの中に書き込まず悩んでしまっていた。

(そもそも、tomlの記法自体をしらないという・・)

theme="hugo-clarity"

[params]
    numberOfTagsShown=6