Thereās also a category called cat, in a folder called _cat, and thereās a bunch of posts with dates and titles and all that. Itās defined in _config.yml as follows:
not exactly clear what you are doing - looks like you pass the category name into the include, and then want a list of all posts that have that category?
in your capture I think you need to get site.categories.cat - I would hard code that first to see if you get what you want, then work on passing it into the include.
Keep in mind that site.categories only works on posts - and posts are collections, but I am not sure the way you are doing your defaults will work? as I think the collection name is posts not cat.
In one of my themeās I pass a category (or tag) name into an include to output posts within that taxonomyā¦ so itās possible.
This is how I do it:
Use a variable in front matter that can be defined in a page. For example if Iām building a category page for postsā categorized under foo Iād add this:
---
taxonomy: foo
---
Then that gets assigned in an include:
{% include items.html taxonomy=page.taxonomy %}
Then in the items include that variable can be accessed like this to do your usual for loop stuff:
{% for item in site.categories[include.taxonomy] %}
...
{% endfor %}
To do the same thing, but with a tag youād iterate over site.tags[include.taxonomy] instead.
would that work for image galleries? post = image, blog html has a grid, images of category foo get listed. - would I reassemble the blog html everytime or should I have blogcategory1 and so on html?
I have images - all the exact same size / ratio. So I want to use the post mechanism to output a gallery. The post .md has an image link, the css presents it nicely and the grid would be 3 columns max folding down to 1 on mobile. And then assemble the images according to taxonomy or search (tags, categories ā¦). Could that work?
and every post.md would have an image link so I could just push up a new image āblog postā and it gets included. overlay with jsā¦
If you want a gallery of images thatās something else and would require you writing some custom code.
What I referenced above is assuming each āimageā is a post or collection document.
If you want a gallery of images thereās a helper in the theme. But it doesnāt have any sort of logic to pull in images from a certain category or anything.
well I only need the logic to pull in posts - nevermind that it is an image.
[] plus the front matter tagging, categorizing it ā¦ or am I misunderstanding how it works?
I would have the image name and a date in the postfilename which is not really used because they get assembled/grouped by tags (taxonomyā¦)
thank you for the link - reading up
I am assuming of course that I can ādesignā the way posts are displayed as I want with cssā¦
yes, that splash page you made is what I want - just needs to be responsive so that the images are single column on a phone. perfect.
so, I would have all posts in _posts and then three links ālakeā ātreeā āfrogā where each link would pull in the same blog with the appropriate for loop. that would be nice and simple
I only have 4 categories so that could work - but the tag collections would maybe have 10 different ādirectionsā. But this looks good - I will report back on how it worked out. Thank you @mmistakes
ā¦ and it seems that I can have multiple blogs in one jekyll site too. excellent.
that looks promising ā¦ ā¦ confidence is the feeling I have before I understand the situation