Add another section to Cupper theme

Hi @zwbetz
If I want to add another section, what should I do? Can you help me?
I tried to add a Reading section in config.yaml

permalinks:
  post: /:filename/
  reading: /:filename/

menu:
  nav:
    - name: Home
      url: /
      weight: 1

    - name: Blog
      url: /post/
      weight: 2

    - name: Reading
      url: /reading/
      weight: 3

    - name: Tags
      url: /tags/
      weight: 4

    - name: About
      url: /about/
      weight: 5
      
    - name: RSS
      url: /index.xml
      weight: 6

I create _index.md in /content/reading/_index.md
Then I created a folder and first post in /content/reading/first_reading.md.
1/ I can read first_reading.md in hugo server
but I get 404 error on my github page.

2/ And also, TOC only shows in post section (content/post). It doesn’t show in reading section (/content/reading)

I’m sorry if I used any wrong technical words here. I’m still learning to use Hugo.
Thank you

There is a single template for the post section, see https://github.com/zwbetz-gh/cupper-hugo-theme/blob/master/layouts/post/single.html. This template is what renders single pages.

You must also make a single template for the reading section. You could do this by making a file at layouts/reading/single.html and then pasting in the contents of the link above.

There are more DRY ways to do this, but this will get it working for now.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.