forked from clarklab/chowdown
-
Notifications
You must be signed in to change notification settings - Fork 1
/
cuisines.html
45 lines (40 loc) · 1.68 KB
/
cuisines.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
layout: default
---
{% assign allTags = "" %}
{% for recipe in site.recipes %}
{% if recipe.cuisines and recipe.cuisines != empty %}
{% assign thisTags = recipe.cuisines | join:'|' | append:'|' %}
{% assign allTags = allTags | append:thisTags %}
{% endif %}
{% endfor %}
{% assign allTags = allTags | split:'|' | sort | uniq %}
<div class="container">
<article class="post-content px2">
{% include tag-navigation.html %}
<h1>{{ site.translation[site.language].cuisines }}</h1>
{% include cuisine.html cuisines=allTags %}
<div class="clearfix">
{% unless allTags[0] %}
<p>{{ site.translation[site.language].cuisine_browse }}</p>
{% endunless %}
{% for cuisine in allTags %}
<div data-tagged="{{ cuisine }}" class="tag-result-container hide">
<h2 class="capitalize"><a name="{{ cuisine | capitalize }}"></a>{{ cuisine | capitalize }}</h2>
{% assign sorted = site.recipes | sort:"title" %}
{% for recipe in sorted %}
{% if recipe.cuisines contains cuisine %}
<div class="sm-col sm-col-6 md-col-6 lg-col-4 xs-px1 xs-mb2">
<a class="block relative bg-accent" href="{{ recipe.url | prepend: site.baseurl }}">
<div class="image ratio bg-cover"{% if recipe.images and recipe.images.size != 0 %} style="background-image:url({{site.baseurl}}/images/{{ recipe.images[0].path }});"{% endif %}></div>
<h4 class="title p2 m0 absolute bold white bottom-0 left-0">{{ recipe.title }}</h4>
</a>
</div>
{% endif %}
{% endfor %}
</div>
{% endfor %}
</div>
</article>
</div>
<script src="{{site.baseurl}}/js/tag-browse.js" charset="utf-8" defer></script>