はじめに
このページではテーマのインストール手順と、サイトを動かすための最小限の hugo.toml を解説します。
- Hugo extended
>= 0.146.0。テーマは Hugo Pipes(resources.Concat、resources.Minify、resources.Fingerprint)を使用するため、extended 版が必要です。
バージョン確認:
hugo version# hugo v0.146.0+extended ...インストール
Section titled “インストール”方法 A — Git submodule(推奨)
Section titled “方法 A — Git submodule(推奨)”Hugo サイトのルートで:
git submodule add https://github.com/rin2yh/hugo-theme-stack-liquid-glass themes/stack-liquid-glass方法 B — ZIP アーカイブ
Section titled “方法 B — ZIP アーカイブ”GitHub から ZIP をダウンロードし、themes/stack-liquid-glass/ に展開します。
テーマの有効化
Section titled “テーマの有効化”サイトの hugo.toml で:
theme = "stack-liquid-glass"最小構成の hugo.toml
Section titled “最小構成の hugo.toml”baseURL = "https://example.com/"languageCode = "ja"title = "My Site"theme = "stack-liquid-glass"hasCJKLanguage = true
[outputs]home = ["HTML", "RSS", "JSON"]
[permalinks]post = "/post/:contentbasename/"
[markup.goldmark.renderer]unsafe = true[markup.tableOfContents]ordered = truestartLevel = 2endLevel = 4
[params]mainSections = ["post"]rssFullContent = true
[[params.widgets.homepage]]type = "search"[[params.widgets.homepage]]type = "archives"[[params.widgets.homepage]]type = "categories"[[params.widgets.homepage]]type = "tag-cloud"
[[params.widgets.page]]type = "toc"
[[menu.main]]identifier = "home"name = "ホーム"url = "/"weight = 1[menu.main.params]icon = "home"[outputs] home = ["HTML", "RSS", "JSON"] は必須です。JSON 出力が組み込み全文検索のデータソースになります。
サイト側で用意する必要があるアセット
Section titled “サイト側で用意する必要があるアセット”layouts/partials/head/head.html は以下のファイルを サイト側の static/ ディレクトリ から参照します。各サイトが独自のブランドアセットを使えるようにするため、テーマには同梱していません:
static/apple-touch-icon.pngstatic/favicon-32x32.pngstatic/favicon-16x16.pngstatic/favicon.icostatic/site.webmanifest
これらを置かなくても他の機能は動作しますが、<head> 内の対応する <link> タグが 404 になります。
開発サーバーの起動
Section titled “開発サーバーの起動”hugo serverhttp://localhost:1313/ にアクセスしてプレビューを確認します。
設定 で [params]、メニュー、ソーシャルリンクの完全リファレンスを参照してください。