forked from clarklab/chowdown
-
Notifications
You must be signed in to change notification settings - Fork 1
/
courses.html
45 lines (40 loc) · 1.65 KB
/
courses.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.courses and recipe.courses != empty %}
{% assign thisTags = recipe.courses | 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].courses }}</h1>
{% include course.html courses=allTags %}
<div class="clearfix">
{% unless allTags[0] %}
<p>{{ site.translation[site.language].course_browse }}</p>
{% endunless %}
{% for course in allTags %}
<div data-tagged="{{ course }}" class="tag-result-container hide">
<h2 class="capitalize"><a name="{{ course | capitalize }}"></a>{{ course }}</h2>
{% assign sorted = site.recipes | sort:"title" %}
{% for recipe in sorted %}
{% if recipe.courses contains course %}
<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>