hugo-apero / hugo-apero

Apéro is a Hugo theme for personal websites. A Hugo theme you'll want to hang out with :milky_way: . This is the source for the theme files to install.
https://hugo-apero.netlify.app/
Creative Commons Attribution 4.0 International
184 stars 58 forks source link

How to show the table of content in the sidebar #49

Open xiaochi-liu opened 3 years ago

xiaochi-liu commented 3 years ago

Hello. I'm learning hugo-apero to build my blog. I'd like each page within the blog section contains a sidebar and shows the table of content (i.e., "ON THIS PAGE"). However, it just didn't show up. May I ask how to handle this problem?

I have set the section configuration file (/content/blog/_index.md) as follows:

# set up common front matter for all pages inside blog/
cascade:
  layout: single-sidebar  # single or single-sidebar
  sidebar_left: false
  sidebar:
    text_contents_label: On this page
    show_sidebar_adunit: false
    # text_series_label: In this series
    text_link_label: ""
    text_link_url: ""

And I didn't set anything strange on the single page (/content/blog/2021-09-07-writing-process-test/index.Rmarkdown):

---
title: Writing Process Test
author: Xiaochi Liu
date: '2021-09-07'
slug: []
categories:
  - Scientific Writing
tags:
  - Scientific Writing
subtitle: ''
excerpt: ''
series: ~
---

However, there is no table of content in the sidebar:

Screen Shot 2021-09-07 at 08 55 58

Your kind guidance is much appreciated!

SantiDu commented 3 years ago

I'm still waiting for the excellent PR to be merged.

xiaochi-liu commented 3 years ago

I'm still waiting for the excellent PR to be merged.

Looking forward to it.

However, my situation is not whether the ToC is sticky, but whether it is present.

This is the repo of my new blog. In the section configuration content\blog\_index.md, I can use a single-series layout to show both "IN THIS SERIES" and "ON THIS PAGE".

However, when I use the single-sidebar layout, the "ON THIS PAGE" just doesn't show up.

Could you please help me check this problem? I have compared my codes with the demo codes several times but didn't find anything strange. Thanks!