forked from clarklab/chowdown
-
Notifications
You must be signed in to change notification settings - Fork 1
/
collections.html
49 lines (44 loc) · 1.92 KB
/
collections.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
46
47
48
49
---
layout: default
---
{% assign allTags = "" %}
{% for recipe in site.recipes %}
{% if recipe.collections and recipe.collections != empty %}
{% assign thisTags = recipe.collections | 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].collections }}</h1>
{% include collection.html collections=allTags %}
<div class="clearfix">
{% unless allTags[0] %}
<p>{{ site.translation[site.language].collections_browse }}</p>
{% endunless %}
{% for collection in allTags %}
{% assign col = collection | downcase %}
{% assign name = site.data[site.language].collections[col].name %}
{% assign desc = site.data[site.language].collections[col].description %}
<div data-tagged="{{ col }}" class="tag-result-container hide">
<h2 class="capitalize"><a name="{{ name | capitalize }}"></a>{{ name | capitalize }}</h2>
{{ desc | markdownify }}
{% assign sorted = site.recipes | sort:"title" %}
{% for recipe in sorted %}
{% if recipe.collections contains col %}
<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>