minicomp / wax-facets

The second Wax theme. Good times.
https://minicomp.github.io/wax-facets/
Other
9 stars 8 forks source link

"Liquid error" #40

Closed ansleyerickson closed 2 years ago

ansleyerickson commented 2 years ago

Thanks for wax-facets!

I'm getting this error message, working from my local machine: Liquid error (/Users/ansleyerickson/Desktop/modern/_includes/subset_gallery.html line 2): Cannot sort a null object. included (Liquid::ArgumentError)

[Now on github here - https://github.com/ansleyerickson/modern]

This seemed kind of like what was described here https://github.com/minicomp/wax-facets/issues/23 so I fixed the "tags" field to "_tags" and reran the tasks, but I'm getting the same message.

Not sure if this is a relevant test, but with the metadata fixed as above (and not using any other terms to avoid, as far as I know) I then returned to the original Wax theme with the same data, and was able to get the tasks completed and site served up. That one is here https://github.com/ansleyerickson/modernwax

ansleyerickson commented 2 years ago

... apologies, haven't been able to push most recent changes to repos above. Will do so 10/12.

amzoss commented 2 years ago

Thanks, @ansleyerickson ! It'll be good to see what you're working with, when you can push the changes.

When I was investigating the tags liquid error, I played around a bit with the include statement to see if I could get the facets to work on any column in the metadata. Have you tried starting with just one value for facet_by, and have it be a fairly simple column - just a text column, for example? It would be helpful to know if you can get one to work, or if you get the same error no matter what. Also, I'd love to see the include line you're hoping to use, the one that gives you the error. Maybe there's another column name that should be protected.

One note: I think the recommendation is not to fork the wax or wax-facets repos. When you fork, you retain all of the change history and branches of the original repo, and that can make for a huge repo. That's usually just used if you're going to be proposing changes to the original repo, rather than just for copying the files. To reuse the files from the original Wax repo, you can click "Use this template" or click the "Code" button to download the ZIP files and use them in a clean repo. For the new wax-facets team, I think the "Code" button is the primary way.

Thanks again!

ansleyerickson commented 2 years ago

Hi @amzoss,

I've pushed the changes to both of the repos above so you can see them there.

For "modern" repo above, the include line (from the pages/collection.md) is {% include facet_gallery.html facet_by='type' collection='tms_doc_mock' num_column=2 %} Type is a text column.

(Re: above repo, I haven't yet adjusted the csv and collection names above to get rid of quotation marks and underscore in the collection name, so perhaps that's still a problem too for facets as it seems to have been for the original theme via https://github.com/minicomp/wax/issues/135).

Thanks for the note about not forking. I think I untangled that and the repos are independent now.

ansleyerickson commented 2 years ago

Update: I changed the csv and collection names as above and got the same error message. Liquid error (/Users/ansleyerickson/Desktop/modern/_includes/subset_gallery.html line 2): Cannot sort a null object. included (Liquid::ArgumentError)

I fixed the include line above to put the collection before facet_gallery but was still getting the error.

I decided to focus on the subset_gallery include mentioned in the error message. I don't need subset galleries at this time, so I removed the _include and example exhibit for that, and am now able to generate facet galleries in my project: https://github.com/ansleyerickson/modern

amzoss commented 2 years ago

Oh my goodness, of course! As soon as you remove the qatar files, all of the examples on the docs.md page will break. I completely missed that the error referred to subset_gallery.html. Great catch!

You should be able to keep the actual subset_gallery.html file in the includes folder, since the error is just that the include is called with the qatar collection, which no longer exists.

If that looks like the only error, should we close this issue? Thanks for pushing through!

ansleyerickson commented 2 years ago

Yes, ready to close. Waited to figure out why I was having some functionality trouble with the facets - but realized (via @elotroalex) that the prob was trying to use facets on index.md rather than on the browse (collections.md) page. Thank you!