uPagge / uBlogger

A template designed with your readers in mind :heart:
https://ublogger.netlify.app
MIT License
250 stars 101 forks source link

[BUG] New post doesn't show TOC #36

Open xiaochi-liu opened 3 years ago

xiaochi-liu commented 3 years ago

Hello. Thank you very much for this lovely theme. I like it.

I'm using the blogdown R package and .rmd (R Markdown) document to build my website.

However, I encountered a problem as follow:

Describe the bug

My new post doesn't show TOC, although I've set thetoc as yes.

Expected behaviour

show TOC.

Screenshots

Please see this post.

Build Environment

Please try to use Hugo extended version before opening the issue.

Preview Environment

Additional Information

The YAML head of this post:

---
title: Writing Process
author: Xiaochi Liu
date: '2021-02-13'
slug: []
categories:
  - Scientific Writing
tags:
  - Scientific Writing
subtitle: ''
lastmod: '2021-02-13T22:28:04+11:00'
description: ''
summary: "Writing process for publication"
theme: classic
upd: ''
authorComment: ''
hiddenFromHomePage: no
hiddenFromSearch: no
resources:
  - name: featured-image
    src: featured-image.jpg

toc:
  enable: true
  auto: true
math:
  enable: yes
lightgallery: no
license: ''
---

And the full repo built by blogdown is here.

Many thanks for your kind guidance

uPagge commented 3 years ago

Try to do this

toc:
   enable: true
   keepStatic: false
   auto: true
xiaochi-liu commented 3 years ago

Hello @uPagge. Thanks for your quick response.

It still doesn't show the TOC.

uPagge commented 3 years ago

strange

I'll try to see what the problem is and release a fix in a new release, I hope to release a new release within two weeks

xiaochi-liu commented 3 years ago

Thanks!

So when the new version released, I just need to delete the current themes/uBlogger folder on my device, then clone the repository to that themes directory, right?

uPagge commented 3 years ago

It depends on how you added the topic. I recommend looking at how git submodules works, which is a very good mechanism for hugo themes. If the theme is added as a subbmodule, then after the new release, you just need to go to the themes / uBlogger folder and run the git pull command.

xiaochi-liu commented 3 years ago

Get it. Thank you very much @uPagge.

uPagge commented 3 years ago

@xiaochi-liu Were you able to somehow solve the problem?

xiaochi-liu commented 3 years ago

not yet 😄

xzhws commented 3 years ago

I met the same issue where the [TOC] did not show.

uPagge commented 3 years ago

I will try to understand this problem in the near future.

GregHilston commented 3 years ago

table of contents are not being generated for my posts.

I have the following section defined in my config.toml

    [params.page.toc]
        # whether to enable the table of the contents
        enable = true

        # whether to keep the static table of the contents in front of the post
        keepStatic = false

        # whether to make the table of the contents in the sidebar automatically collapsed
        auto = true

$ hugo version

hugo v0.83.1+extended linux/amd64 BuildDate=unknown

uBlobber theme v2.0.2

uPagge commented 3 years ago

It would be great if someone put together a small project to demonstrate the problem

techducks commented 3 years ago

hi, i noticed the same behaviour but only when i am using markdowns first Headline (#) ... when i am using ## it will generate the toc. Is this intended?

Edit: There are some more problems with toc. when i am using an ipad in landscape format the toc does not open. i have tried to resize my browsers window (on dektop pc) and there is the same behavior

xiaochi-liu commented 3 years ago

Hello, I'm using ## as my first-level headline but the toc doesn't show up.

By the way, do I need to update the theme to see the result? And how should I update the theme?

uPagge commented 3 years ago

It depends on how you added the project. most likely you need to go to the theme / uBlogger folder and call "git pull" from the console