lukeorth / poison

Professional Hugo theme for dev bloggers. Based on Mdo's classic Hyde theme.
https://poison.lukeorth.com
GNU General Public License v3.0
209 stars 101 forks source link

Sidebar not displaying content/posts/ #188

Open mohummedalee opened 3 months ago

mohummedalee commented 3 months ago

Hi, thanks for the wonderful theme. I'm posting here to seek help with debugging an issue. This is the version I'm using: hugo v0.126.1+extended darwin/amd64 BuildDate=2024-05-15T10:42:34Z VendorInfo=brew

My webpage is currently live on https://m-ali.org (GitHub repo: https://github.com/mohummedalee/mohummedalee.github.io). As you can see, the sidebar currently has a Publications and an About page. I'm in the process of adding a blog section that would list all posts under content/posts. Here is what my config.toml looks like right now:

menu = [        
  {Name = "Publications", URL = "/publications/", HasChildren = false},
  {Name = "Blog", URL = "/posts/", HasChildren = false},
  {Name = "About", URL = "/about/", HasChildren = false},
]

And here is what the content/ directory looks like:

content
├── _index.md
├── about
│   └── _index.md
├── landing
│   └── _index.md
├── posts
│   ├── _index.md
│   └── pii-kaggle
│       └── index.md
└── publications
    └── _index.md

As you can see there is only one post (pii-kaggle). A list of posts is visible when I visit the local deployment on localhost:1313/posts/ as well as the post itself on localhost:1313/posts/pii-kaggle. But the sidebar will not display the posts folder.

Will appreciate any help debugging this, am happy to provide more info if my issue is unclear, hope the link to my repo also provides additional information.

mohummedalee commented 3 months ago

It turns out that deleting content/posts/_index.md fixes this issue, I can now see "Blog" in the sidebar. Hope this helps someone else.

Is there a way to make this new listed page look exactly like the default home page in the theme? I'd ideally like a title, and a blurb from the post similar to the landing page here: https://karlaustin.com/. If I cannot add a markdown file under posts/, how can I style it?

Again, appreciate the help!

mohummedalee commented 3 months ago

Figured out how to get the posts page to look like the default homepage. I simply copied layouts/index.html from the original theme and pasted it to a new file in layouts/posts/posts.html. Still not entirely clear to me how layouts are looked up, but this works for now.

I'll keep this issue open for another 1–2 weeks in case anyone has feedback, or any suggestions on best practices etc.