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

Add tags filtering #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _layouts/recipe.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<article class="recipe">
<article class="recipe mix {{ page.tags | join: ' ' }}">
<div class="recipe-half">
{{page.time}}
{{content}}
Expand Down
30 changes: 30 additions & 0 deletions _sass/_recipes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,34 @@
.recipe-half {
width: 48%;
}
}

.tags-menu {
padding-bottom: 30px;
text-align: center;
}

.tags-menu ul {
padding: 0;
margin: 0;
list-style: none;
border: 1px solid #999999;
display: inline-block;
margin-bottom: 40px;
}

.tags-menu ul li {
display: inline-block;
padding: 0px 25px;
cursor: pointer;
font-size: 15px;
line-height: 40px;
font-weight: 600;
color: #333333;
text-transform: capitalize;
position: relative;
}

.tags-menu ul li.filter.mixitup-control-active{
color: #894bc3;
}
21 changes: 20 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,30 @@
title: מתכונים
---

<div class="posts">

<div class="tags-menu">
<ul>
<li class="filter" data-filter="all">הכל</li>
{% for tag in site.tags %}
<li class="filter" data-toggle=".{{tag | first}}">{{tag | first}}</li>
{% endfor %}
</ul>
</div>




<div class="recipes-container">
{% for post in site.posts reversed %}

{{post}}

{% endfor %}
</div>

<script src="{{ site.baseurl }}/js/plugins.js"></script>
<script>
var containerEl = document.querySelector('.recipes-container');
var mixer = mixitup(containerEl);
</script>

18 changes: 18 additions & 0 deletions js/plugins.js

Large diffs are not rendered by default.