コンテンツにスキップ

はじめに

このページではテーマのインストール手順と、サイトを動かすための最小限の hugo.toml を解説します。

  • Hugo extended >= 0.146.0。テーマは Hugo Pipes(resources.Concatresources.Minifyresources.Fingerprint)を使用するため、extended 版が必要です。

バージョン確認:

Terminal window
hugo version
# hugo v0.146.0+extended ...

Hugo サイトのルートで:

Terminal window
git submodule add https://github.com/rin2yh/hugo-theme-stack-liquid-glass themes/stack-liquid-glass

GitHub から ZIP をダウンロードし、themes/stack-liquid-glass/ に展開します。

サイトの hugo.toml で:

theme = "stack-liquid-glass"
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 = true
startLevel = 2
endLevel = 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.png
  • static/favicon-32x32.png
  • static/favicon-16x16.png
  • static/favicon.ico
  • static/site.webmanifest

これらを置かなくても他の機能は動作しますが、<head> 内の対応する <link> タグが 404 になります。

Terminal window
hugo server

http://localhost:1313/ にアクセスしてプレビューを確認します。

設定[params]、メニュー、ソーシャルリンクの完全リファレンスを参照してください。