dsrkafuu / hugo-theme-fuji

A minimal Hugo theme with nice theme color. | 一个主题色极简 Hugo 主题。
https://github.dsrkafuu.net/hugo-theme-fuji/
Apache License 2.0
368 stars 98 forks source link

[bug] TOC not shown #55

Closed choicky closed 3 years ago

choicky commented 3 years ago

侧面未显示目录,不知道原因是什么。

即使配置文件或者页面本身设定了 showToc = true 也不显示

dsrkafuu commented 3 years ago

目录默认设置的显示层级是二级到三级,也就是 #####

alexmitelman commented 3 years ago

Hi TOC is not shown for me too.

test.md

---
title: "Test TOC"
date: 2020-10-18T14:35:48+03:00
draft: false
---

# Level 1

## Level 2

### Level 3

config.toml

[markup]
  [markup.tableOfContents]
    endLevel = 3
    ordered = false
    startLevel = 2

Screenshot_2020-10-18 Test TOC

dsrkafuu commented 3 years ago

I've tried modifying the TOC display logic, and now it should show the TOC in all cases unless it is explicitly set false within config.toml or front matter. Also, previously TOC would only be displayed on pages belonging to the mainSection array set in config.toml. I've tested well with the exampleSite, try updating the theme.

I'll keep the issue open until all problems are fixed.

dsrkafuu commented 3 years ago

As #61 mentioned, this may actually a bug where showToc=true is not working as expected. I've fixed it in the latest commit, you can upgrade the theme and try again with showToc=false in global and showToc=true in front matters.

The right logic: fixed setting status site showToc is undefined or true site showToc is false
page showToc is undefined
page showToc is true
page showToc is false