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

How would you create a homepage with a list of posts? #12

Open
CaldwellYSR opened this issue Apr 22, 2024 · 2 comments
Open

How would you create a homepage with a list of posts? #12

CaldwellYSR opened this issue Apr 22, 2024 · 2 comments
Labels
question Further information is requested

Comments

@CaldwellYSR
Copy link

I'm trying to make a site where there's a home page that is a list of posts and then the show page for the individual posts. From reading through the docs I assumed it would look like

  collections: %{
    posts: %{
      permalink: "/",
      list_layout: "home",
      show_layout: "show"
    }
  }

but then in the home.html.eex layout there is no @collection_values assigns. I might be missing something obvious here but so far I'm just confused.

@goncalotomas goncalotomas added the question Further information is requested label Apr 28, 2024
@goncalotomas
Copy link
Contributor

Hey! Thanks for giving Griffin a try.

I see a couple of issues, the most pressing of which is the fact that collections currently doesn't seem to support permalink:

render_collection_file(
opts.output <> "/#{collection_name}/index.html",
%{
page: nil,
data: %{
layout: EEx.compile_string(Layouts.fallback_list_collection_layout()),
collection_name: collection_name,
collection_values: collection_values
},
content: "",
input: "tags_list.eex"
},
opts
)

I also hadn't considered the possibility of setting the collection permalinks to the root directory, it shouldn't be an issue but it's something I just haven't tested yet.

Collections is going to undergo a bit of a revamp through #10, what I can do is prioritize finishing that during this week and then testing your set up and making sure it works. This probably isn't the answer you were expecting, sorry about that!

@CaldwellYSR
Copy link
Author

Nothing to apologize for! Happy to get a transparent response. I didn't do much looking through your actual code I was simply trying this out by going through the docs and I got stuck and moved on. When I get some time I will actually dig through the code a bit and see if I can offer up a PR because the project is exciting to me.

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

No branches or pull requests

2 participants