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

Group recipes in books #38

Open
MichaelThomasMPT opened this issue Apr 11, 2020 · 5 comments
Open

Group recipes in books #38

MichaelThomasMPT opened this issue Apr 11, 2020 · 5 comments

Comments

@MichaelThomasMPT
Copy link
Contributor

Hey @clarklab - I remember reading a whole ago that you were planning on creating the concept of "books" to group recipes together and display them as a collection of sorts. I was just wondering whether you'd started any work on that so far? I'd be interested in helping contribute to it if there was a branch to work from, or if you had a guiding vision of sorts I could code towards. :)

@clarklab
Copy link
Owner

Hello!

I've had the idea of books kicking around for a while, but I haven't really started anything too specific on it yet (besides putting it in the nav on https://chowdown.io/beta/)

Do we have any technical ideas on adding the feature? Originally I was thinking of just adding a flag in the frontmatter, but lately I've been leaning towards defining books as their own custom post (or collection). I'm not super savvy with Jekyll, so I'd probably need to dive into the docs to have a solid opinion on it. I was just thinking we might want to curate/reorder/notate a bit more than simple frontmatter would allow.

I've got a designer (my wife, how convenient) that's gonna do a bit of work on the cover "system", so maybe soon we'll have some visual to review. Thinking of something like a way to set an image/title/color/etc per book, just to spice up the "bookshelf".

@MichaelThomasMPT
Copy link
Contributor Author

MichaelThomasMPT commented Apr 30, 2020

Hey sorry about the late reply on this! I've been doing a bit of research into Jeckyll since I've never used it before. From what I can tell, the limitation with collections is that you can only have each recipe in a single collection, meaning it wouldn't be possible to include a "Sweet Potato Salad" recipe in both a "Vegetarian" cookbook and a "Quick Dinners" cookbook without duplicating that recipe file.

I think an option which could work would be to use a frontmatter tag of "books" in each recipe, containing an array of book names for that recipe to be included in, and use a loop like this (scenario 8) to populate the contents of it. The worked example shows how you can dynamically pull in docs based on a specified frontmatter property value; if a list of books were also maintained in a separate _books collection, which specified the properties for the book cover that you described above, then it would probably be possible to create a page that first displayed all the contents of the books collection, and then when selecting one of those, would display another page (or maybe a separate view in the same page somehow?) listing all of the recipes tagged with that book's title.

What are your thoughts?

@MichaelThomasMPT
Copy link
Contributor Author

MichaelThomasMPT commented Apr 30, 2020

In fact, a better worked example of this is in @rathgar 's PR #31 - building on this by adding another grouping (or maybe reusing the category grouping?) for books, and then having the metadata about the book covers themselves stored in a separate collection similar to how @rathgar has implemented "diets" could potentially work quite well!

@rathgar
Copy link
Contributor

rathgar commented Apr 30, 2020

I've been have a bit of an isolation-hackathon 😷 at how books might work. Currently just polishing up something else but should have a code sketch together in the next day or so for you to have a look at. Thanks for tagging me in @MichaelThomasMPT

@rathgar
Copy link
Contributor

rathgar commented Apr 30, 2020

My initial idea for books is now up as PR #41. Please all feel free to pile in.

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

3 participants