Question 1: I'm trying to create two distinct sections on my blog using Jekyll, similarly to how categories work in Wordpress. I'd like to have my main blog with posts, and then have a separate page for my portfolio/photography.
So far, I've got the basic page structure on my site, but I don't know how to work the logic out using Jekyll.
Question 2: As you can see on my photos page, I have it set up to where there are thumbnails created. I'd like to populate those thumbnails with photos from each new portfolio post (similar to featured images, in Wordpress), based on a link in the front-matter of each portfolio post. Or is there a better way to do that?
If I'm not making sense, I'm kind of picturing something like this as far as the front matter goes:
---
title: My Title
layout: photo
thumbnailurl: /images/photo2.jpg
---
The basic way to sort post depending of the category is :
{% assign blogPosts = site.posts | where:'category', 'blog' %}
{% assign photoPosts = site.posts | where:'category', 'photo' %}
The drawback here is that you will have blog
or photo
categories in the post's categories, which is not necessarily useful when you want to expose categories for a post.
Instead, you can just put a front matter variable like group: post
or group: photo
.
You are then able to sort posts like this :
{% assign blogPosts = site.posts | where: 'group', 'blog' %}
{% for item in blogPosts %}
<p>{{item.title}}</p>
{%endfor%}
It's up to you.
Yes the way you do it the right one. Thumbnail url in the front matter.