joeroe / risotto

A minimalist, responsive hugo theme inspired by terminal ricing aesthetics.
https://risotto.joeroe.io
MIT License
418 stars 112 forks source link

Pages in nested content directories missing from taxonomy list #78

Closed zigmd closed 5 months ago

zigmd commented 5 months ago

I have a couple of regular (non _index.md) pages tagged as foo.

On navigating to localhost:1313/tags/ I can see foo listed.

When I click on it, I don't see any of the pages which have been tagged as foo, all I can see is the title # Foo at the top.

joeroe commented 5 months ago

Could you please give a minimal reproducible example of this problem? Tag index pages should use the default list layout, which does list pages. On the example site this works, for example: https://risotto.joeroe.io/tags/markdown/

zigmd commented 5 months ago

My website's layout looks like:

./content
├── dir-1
│   ├── file-1.md
│   ├── file-2.md
│   └── _index.md
├── dir-2
│   ├── file-3.md
│   ├── file-4.md
│   └── _index.md
├── _index.md
└── dir-3
    ├── dir-4
    │   ├── file-5.md
    │   └── file-6.md
    ├── dir-4.md
    ├── dir-5
    │   ├── file-7.md
    │   └── file-8.md
    ├── dir-5.md
    └── _index.md

Tag foo in present in files file-2.md and file-4.md, and tag bar in files file-6.md and file-8.md.

On navigating to localhost:1313/tags, I can see both tags foo and bar listed.

When I click on foo, the page http://localhost:1313/tags/foo/ lists pages file-2 and file-4. This works as expected.

But when I click on bar, the webpage is empty.

Is there a way I can list pages file-6 and file-8 when I navigate to http://localhost:1313/tags/bar/ ?

joeroe commented 5 months ago

So it seems the problem is with tags in nested content directories, rather than tags in general? I'll investigate further.

zigmd commented 5 months ago

Yes, the problem is only with nested content directories.

Thanks for looking into it.

zigmd commented 5 months ago

Hi @joeroe - I more thing I want to point out about tagging nested content (please let me know if this this should be filed as a different bug):

All files in dir-3 have a lot of textual content. Files like file-6.md and file-8.md have ## Some Heading below the header. On navigating to http;//localhost:1313/dir-3, I can see the heading and contents of file-6.md and file-8.md listed below _index.md, dir-4.md, and dir-5.md.

When I add the <!--more--> before ## Some Heading like:

Some text
<!--more-->

## Some Heading
...
...

The headings of file-6.md and file-8.md remain and content is replaced by the text above <!--more-->.

I think neither of these things should be happening.

To mitigate this behavior, I have to add

[_build]
  list = "never"

in the header of these files. This in-turn maybe causing nested tagged pages to not be listed, as I explained in my previous post.

joeroe commented 5 months ago

Yes, that will be why they don't show up in the list views.

risotto's list layouts don't include page content or summaries. It sounds like the pages in that section are using a different list layout – perhaps Hugo's default? Or one you have placed in your site's layouts/ directory? Could I ask you to again start a new site and try to make a minimal reproducible example of this problem with content/summaries in lists, so we can rule out that something in your site's config is causing this behaviour? Does it only happen within nested sections?

zigmd commented 5 months ago

risotto's list layouts don't include page content or summaries.

It seems that in a nested structure, page content / summaries are included. If I dont use <!--more-->, some page content is included in the list layout and if I do use it, the text above it is included.

It sounds like the pages in that section are using a different list layout – perhaps Hugo's default? Or one you have placed in your site's layouts/ directory? Could I ask you to again start a new site and try to make a minimal reproducible example of this problem with content/summaries in lists, so we can rule out that something in your site's config is causing this behaviour?

The layouts/ directory only has robots.txt.

Each page in dir-3 has the following content at the top:

+++
title = 'Some Webpage'
date = 2024-04-21T08:58:09-07:00
author = 'John Doe'
tags = ["foo"]
toc = true
[_build]
  list = "never"
+++

and the _index.md in this directory looks like:

+++
title = 'Directory 3'
type = "post"
+++

Some content
...
...

Does it only happen within nested sections?

Yes

zigmd commented 5 months ago

I got around the issue by: