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

Getting posts to appear on the main page is oddly confusing #56

Closed
findgriffin opened this issue Aug 28, 2019 · 5 comments
Closed

Getting posts to appear on the main page is oddly confusing #56

findgriffin opened this issue Aug 28, 2019 · 5 comments
Labels
bug report Something isn't working

Comments

@findgriffin
Copy link

findgriffin commented Aug 28, 2019

Describe the bug
I just spent a few hours trying to figure out how to get my posts to appear on the main page of a new blog I'm creating.

To Reproduce
Steps to reproduce the behavior:

  1. Follow Hugo Quick Start guide.
  2. Use Indigo theme.
  3. Create a post as per the quick start guide example e.g. hugo new posts/my-first-post.md
  4. Start server and navigate to localhost:1313
  5. Observe no posts. The paginator will say "page 1 of 0".
  6. Observe that the post does exist at localhost:1313/posts/my-first-post
  7. Add type: "post" to my-first-post.md
  8. (optional) Google for 2-3 hours about how Hugo works.
  9. Observe that it now shows up at localhost:1313

I'm pretty sure the issue is due to this line in list.html:

{{ range $index, $page := (.Paginate (where .Site.RegularPages "Type" "post")).Pages }}

Expected behavior
My posts to appear on the main page of my blog when I follow the Hugo quickstart guide and the Indigo docs.

Proposed Fix(es)
I'm not that familiar with Hugo, but to my mind you could do any of the following:

  1. Add a note to the Indigo docs
  2. Add a custom Indigo archetype that sets type: post
  3. Change list.html to accept post OR posts type.

Anyway, thanks for creating / maintaining this theme.

Cheers

@AngeloStavrow AngeloStavrow added the bug report Something isn't working label Aug 28, 2019
@AngeloStavrow
Copy link
Owner

Hey @findgriffin, thanks for reporting this!

I think you're right, Indigo unnecessarily forces a type on users that made sense in my head when I created the theme, but is otherwise causing pain for folks. I'll take a look at how to fix this soon. 🙂

@AngeloStavrow
Copy link
Owner

Okay, as part of the work I'm doing in #57, it looks like we can incorporate a new mainSections variable in the config file to do this. More detail in the Hugo docs here.

Unless it proves to be spectacularly more complicated than the docs make it appear, I think I'll be able to push a fix for this out by tomorrow evening. :)

@AngeloStavrow
Copy link
Owner

Closed by #62

@findgriffin
Copy link
Author

findgriffin commented Sep 30, 2019 via email

@infominer33
Copy link
Contributor

infominer33 commented Dec 10, 2019

idk why, but I can only get it to work if I don't include the mainsections param...

[edit] I see now that I kinda forgot how hugo worked, it's been a while, but I updated theme files in the root, rather than the themes folder... so nevermind me, until I try it properly :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants