AngeloStavrow / indigo

An IndieWeb-friendly custom theme for Hugo
MIT License
58 stars 33 forks source link

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

Closed findgriffin closed 5 years ago

findgriffin commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

Closed by #62

findgriffin commented 5 years ago

Thanks so much!

David

Phone (USA): +1 206 307 1002

On Mon, 30 Sep 2019 at 05:53, Angelo Stavrow notifications@github.com wrote:

Closed by #62 https://github.com/AngeloStavrow/indigo/pull/62

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/AngeloStavrow/indigo/issues/56?email_source=notifications&email_token=AAB2TNL4UG3HOTK6Q6HBUL3QMHZDFA5CNFSM4IRCMOL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD75Q65A#issuecomment-536547188, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB2TNMXZHDSLYN7P43JUBTQMHZDFANCNFSM4IRCMOLQ .

infominer33 commented 4 years ago

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 :)