Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sidebar not displaying content/posts/ #188

Open
mohummedalee opened this issue Jun 24, 2024 · 3 comments
Open

Sidebar not displaying content/posts/ #188

mohummedalee opened this issue Jun 24, 2024 · 3 comments

Comments

@mohummedalee
Copy link

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
Copy link
Author

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
Copy link
Author

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.

@Mauzy0x00
Copy link

Hey there! Learning this as I go but I found that if I just add a directory into /content/ and give the .md file a name that is anything other than 'index.md' it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants