-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
executable file
·55 lines (51 loc) · 1.87 KB
/
index.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
50
51
52
53
54
55
---
layout: default
title: INAV - Drone Autopilot Software
---
<div id="home">
<div class="posts">
{% assign index = true %}
<!-- add this section to put sticky posts on page 1 -->
{% if paginator.page == 1 %}
{% for post in site.categories.sticky %}
<article>
<h2>{{ post.title }}</h2>
<p class="meta">{{ post.date | date_to_string }}</p>
<p>{{ post.excerpt }}</p>
<a href="{{ post.url }}">Read more...</a>
</article>
{% endfor %}
{% endif %}
<!-- this next section is used to see if the post is sticky, in which case it's already been shown -->
{% for post in paginator.posts %}
{% assign sticky = false %}
{% for cat in post.categories %} <!-- roll through this pages categories to find if it is sticky -->
{% if cat == 'sticky' %}
{% assign sticky = true %}
{% endif %}
{% endfor %}
{% unless sticky %}
<article>
<h2>{{ post.title }}</h2>
<p class="meta">{{ post.date | date_to_string }}</p>
<p>{{ post.excerpt }}</p>
<a href="{{ post.url }}">Read more...</a>
</article>
{% endunless %}
{% endfor %}
</div>
<!-- Pagination links -->
<div class="pagination">
{% if paginator.next_page %}
<a href="{{ paginator.next_page_path }}" class="next">← Older</a>
{% else %}
<span class="next ">← Older</span>
{% endif %}
<!--span class="page_number ">{{ paginator.page }} of {{ paginator.total_pages }}</span-->
{% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path }}" class="previous">Newer →</a>
{% else %}
<span class="previous">Newer →</span>
{% endif %}
</div>
</div>