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

Filter homepage posts #43

Closed
851tk6 opened this issue Jun 28, 2017 · 3 comments
Closed

Filter homepage posts #43

851tk6 opened this issue Jun 28, 2017 · 3 comments

Comments

@851tk6
Copy link

851tk6 commented Jun 28, 2017

How can I tell the homepage to show only posts from /design/ and /download/ but NOT posts from /science/ ?

@hemangsk
Copy link
Owner

This is code responsible for generating list of pages on homepage
https://github.com/hemangsk/Gravity/blob/master/index.html#L8-L22

On line 8

  {% for post in paginator.posts%}

After this you can do

{% if post.categories contains "Design" and post.categories contains "Download" %}

and wrap the lines 9 to 22 inside this if statement with

{% endif %}

@851tk6
Copy link
Author

851tk6 commented Jun 28, 2017

Wow, super fast response. Thanks so much. This worked:

{% if post.categories contains "Design" or post.categories contains "Download" %}

@hemangsk
Copy link
Owner

great!

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

2 participants