-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
50 lines (47 loc) · 1.93 KB
/
index.html
File metadata and controls
50 lines (47 loc) · 1.93 KB
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
50
---
layout: home
---
{% if paginator.page %}
{% assign offset = paginator.page | minus:1 | times:paginator.per_page %}
{% assign currentPage = paginator.page %}
{% else %}
{% assign offset = 0 %}
{% assign currentPage = 1 %}
{% endif %}
{% include header.html %}
<div class="c-posts o-opacity" data-page="{{ currentPage }}" data-totalPages="{{ paginator.total_pages }}">
{% include featured-recipes.html %}
{% for post in site.posts limit:site.paginate offset:offset %}
{% assign first_dir = post.path | remove_first: "_posts/" | split: "/" | first %}
{% if first_dir != 'secret' %}
<article class="c-post">
{% if post.image %}
<a class="c-post-thumbnail o-opacity" style="background-image: url({{"/images/" | prepend: site.baseurl | append : post.image}})"
href="{{post.url | prepend: site.baseurl}}"></a>
{% else %} {% endif %}
<div class="c-post-content">
<h2 class="c-post-title">
<a href="{{post.url | prepend: site.baseurl}}">{{post.title}}</a>
</h2>
<p>{{ post.content | strip_html | truncatewords: 15 }}</p>
<span class="c-post-date">{{post.date | date: '%b %d, %Y'}}</span>
{% if post.prep-time %}
<span class="c-post-words"> — {{post.prep-time | append: " prep time"}}</span>
{% endif %}
{% if post.cook-time %}
<span class="c-post-words"> — {{post.cook-time | append: " cook time"}}</span>
{% endif %}
{% if post.total-time %}
<span class="c-post-words"> — {{post.total-time | append: " total time"}}</span>
{% endif %}
</div>
</article> <!-- /.c-post -->
{% endif %}
{% endfor %}
</div> <!-- /.c-posts -->
{% assign postCount = site.posts | size %}
{% assign postsCovered = site.paginate | plus:offset %}
{% if postsCovered < postCount %}
<button class="c-load-more c-btn c-btn--middle">Load more posts</button>
{% endif %}
{% include categories.html %}