Skip to content

Commit

Permalink
Merge pull request #24 from curegit/n
Browse files Browse the repository at this point in the history
Add option to disable showing page count on sidebar tree
  • Loading branch information
curegit authored Feb 12, 2024
2 parents fed2a59 + 5a132f7 commit 8fa9a21
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
35 changes: 18 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,24 @@ Hugo 自体の挙動に似せており、フロントマターの `images` の

以下は、`hugo.toml` に設定できるサイト全体に効果がある `params` です。

| キー || 説明 |
| ---------------- | --------------- | -------------------------------------------------------------- |
| `author` | String | サイト全体の著者名を指定します |
| `authorLink` | String | 著者ページまたはメールアドレスのハイパーリンクを設定します |
| `description` | String | サイトの概要を設定します |
| `keywords` | Array of String | サイト全体のキーワードを設定します |
| `showAuthor` | Boolean | 著者情報を記事に表示するか否かを設定します |
| `showLastmod` | Boolean | 各記事の最終更新日を表示するか否かを設定します |
| `treeRoot` | String | サイドバーのセクションナビゲーションの起点を指定します |
| `sidebarSearch` | Boolean | サイドバーに検索ボックスを表示するか否かを設定します |
| `newNum` | Integer | サイドバーに表示する最新記事の数を設定します |
| `relatedNum` | Integer | 各記事下部に表示する関連記事の数を設定します |
| `randomNum` | Integer | 各記事下部に表示するランダム記事の数を設定します |
| `shuffleSeeAlso` | Boolean | 関連記事とランダム記事の順序をシャッフルするか否かを設定します |
| `showHeaderText` | Boolean | ヘッダーにサイトの概要テキストを表示するか否かを設定します |
| `headerText` | String | ヘッダーのサイト概要テキストを手動設定します |
| `maxConcurrency` | Integer | 検索機能で使う Web Worker の最大数を指定します |
| キー || 説明 |
| ---------------- | --------------- | -------------------------------------------------------------------------- |
| `author` | String | サイト全体の著者名を指定します |
| `authorLink` | String | 著者ページまたはメールアドレスのハイパーリンクを設定します |
| `description` | String | サイトの概要を設定します |
| `keywords` | Array of String | サイト全体のキーワードを設定します |
| `showAuthor` | Boolean | 著者情報を記事に表示するか否かを設定します |
| `showLastmod` | Boolean | 各記事の最終更新日を表示するか否かを設定します |
| `showTreeCount` | Boolean | サイドバーのセクションナビゲーションにページ数を表示するか否かを設定します |
| `treeRoot` | String | サイドバーのセクションナビゲーションの起点を指定します |
| `sidebarSearch` | Boolean | サイドバーに検索ボックスを表示するか否かを設定します |
| `newNum` | Integer | サイドバーに表示する最新記事の数を設定します |
| `relatedNum` | Integer | 各記事下部に表示する関連記事の数を設定します |
| `randomNum` | Integer | 各記事下部に表示するランダム記事の数を設定します |
| `shuffleSeeAlso` | Boolean | 関連記事とランダム記事の順序をシャッフルするか否かを設定します |
| `showHeaderText` | Boolean | ヘッダーにサイトの概要テキストを表示するか否かを設定します |
| `headerText` | String | ヘッダーのサイト概要テキストを手動設定します |
| `maxConcurrency` | Integer | 検索機能で使う Web Worker の最大数を指定します |

## ページパラメータ

Expand Down
1 change: 1 addition & 0 deletions hugo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[params]
showAuthor = true
showLastmod = true
showTreeCount = true
treeRoot = ""
sidebarSearch = true
newNum = 10
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/menus/section-tree.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{{ $n := len .RegularPagesRecursive }}
<li class="folder">
<a href="{{ .RelPermalink }}">
{{ .LinkTitle }}{{ if $n }} ({{ $n }}) {{ end }}
{{ .LinkTitle }}{{ if and site.Params.showTreeCount $n }} ({{ $n }}) {{ end }}
</a>
{{ template "section-tree" . }}
</li>
Expand Down

0 comments on commit 8fa9a21

Please sign in to comment.