adityatelange / hugo-PaperMod

A fast, clean, responsive Hugo theme.
https://adityatelange.github.io/hugo-PaperMod/
MIT License
9.64k stars 2.6k forks source link

[Bug]: Intermittent Archive Rendering #1606

Closed natilik-mikeguy closed 1 hour ago

natilik-mikeguy commented 5 hours ago

What happened?

This may well be something stupid I'm doing (I'm new to Hugo), but my archive view for my posts does not consistently render the same way. Sometimes it will display the archive view as expected, other times it will build with the "list" type view.

My structure is as follows:

.
└── content/
    ├── about/
    ├── mentorship/
    ├── posts/
    │   ├── cicd-security-controls/
    │   └── terraform-features-you-may-be-missing/
    ├── privacy/
    ├── search/
    └── archive.md

My archive.md file is as follows:

---
title: "Posts"
layout: "archives"
url: "/posts"
---

Sometimes it renders as expected with the archive view...

image

Other times it will build the pages in a traditional list...

image

Nothing changed in between, other than stopping and starting hugo server. I don't think it is related specifically to that either, as I see the same behaviour in my CI/CD where it builds for real.

Steps to reproduce

I've not found a consistent way of reproducing yet - it seems intermittent. Starting and stopping hugo server in multiple succession eventually produces it.

Hugo Version

Hugo >= 0.112.4 (Recommended - Minimum version required for PaperMod)

PaperMod Version

hugo v0.134.2+extended darwin/arm64 BuildDate=2024-09-10T10:46:33Z VendorInfo=brew

What kind of devices are you seeing the problem on?

No response

What browsers are you seeing the problem on?

No response

Browser Version

No response

Relevant log output

Nothing seemingly useful with --logLevel debug. Please let me know what you need and I'll happily provide it.

Repository/Source Code link where this issue can be reproduced

No response

Code of Conduct

jasonbraganza commented 4 hours ago

@natilik-mikeguy, this is how mine is and it consistently works

---
title: "Archive"
layout: "archives"
url: "/archives/"
summary: archives
---

Followed instructions from the Features Post on the Papermod website

adityatelange commented 3 hours ago

what I can speculate here is the main directory where posts are stored is "posts" and you're trying to put an archive page on the same URL.

natilik-mikeguy commented 1 hour ago

Thanks for the feedback! Sounds like my bad as I thought. I thought it would have to tie up naming wise to the folder that the articles actually reside in.

I've just renamed my subdirectory from posts -> articles (keeping archives.md the same) and seems to be rendering consistently now.

It renders how I want which is good, but I've no idea how the archives functionality knows how to include some content /arcticles/* and not others (content/privacy), so will have to go hit the docs after as I like to understand these things.