uBlogger icon indicating copy to clipboard operation
uBlogger copied to clipboard

[BUG] New post doesn't show TOC

Open xiaochi-liu opened this issue 4 years ago • 15 comments

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

  • OS: macOS
  • Theme version/commit: just download several days ago
  • Hugo version: 0.80.0

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

Preview Environment

  • OS: macOS
  • Browser: Chrome

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

xiaochi-liu avatar Feb 13 '21 13:02 xiaochi-liu

Try to do this

toc:
   enable: true
   keepStatic: false
   auto: true

uPagge avatar Feb 13 '21 14:02 uPagge

Hello @uPagge. Thanks for your quick response.

It still doesn't show the TOC.

xiaochi-liu avatar Feb 13 '21 14:02 xiaochi-liu

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

uPagge avatar Feb 13 '21 14:02 uPagge

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?

xiaochi-liu avatar Feb 13 '21 14:02 xiaochi-liu

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.

uPagge avatar Feb 13 '21 18:02 uPagge

Get it. Thank you very much @uPagge.

xiaochi-liu avatar Feb 13 '21 21:02 xiaochi-liu

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

uPagge avatar Feb 14 '21 15:02 uPagge

not yet 😄

xiaochi-liu avatar Feb 14 '21 21:02 xiaochi-liu

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

xzhws avatar Apr 08 '21 02:04 xzhws

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

uPagge avatar Apr 10 '21 18:04 uPagge

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

GregHilston avatar May 22 '21 18:05 GregHilston

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

uPagge avatar May 23 '21 05:05 uPagge

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

techducks avatar May 24 '21 16:05 techducks

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?

xiaochi-liu avatar Jun 02 '21 05:06 xiaochi-liu

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

uPagge avatar Jun 04 '21 17:06 uPagge