Skip to content

Commit 36466eb

Browse files
Add default home layout from minima repo.
1 parent 7bd40c7 commit 36466eb

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

_layouts/home.html

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
layout: base
3+
---
4+
5+
<div class="home">
6+
{%- if page.title -%}
7+
<h1 class="page-heading">{{ page.title }}</h1>
8+
{%- endif -%}
9+
10+
{{ content }}
11+
12+
13+
{% if site.paginate %}
14+
{% assign posts = paginator.posts %}
15+
{% else %}
16+
{% assign posts = site.posts %}
17+
{% endif %}
18+
19+
20+
{%- if posts.size > 0 -%}
21+
{%- if page.list_title -%}
22+
<h2 class="post-list-heading">{{ page.list_title }}</h2>
23+
{%- endif -%}
24+
<ul class="post-list">
25+
{%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%}
26+
{%- for post in posts -%}
27+
<li>
28+
<span class="post-meta">{{ post.date | date: date_format }}</span>
29+
<h3>
30+
<a class="post-link" href="{{ post.url | relative_url }}">
31+
{{ post.title | escape }}
32+
</a>
33+
</h3>
34+
{%- if site.minima.show_excerpts -%}
35+
{{ post.excerpt }}
36+
{%- endif -%}
37+
</li>
38+
{%- endfor -%}
39+
</ul>
40+
41+
{% if site.paginate %}
42+
<div class="pager">
43+
<ul class="pagination">
44+
{%- if paginator.previous_page %}
45+
<li><a href="{{ paginator.previous_page_path | relative_url }}" class="previous-page">{{ paginator.previous_page }}</a></li>
46+
{%- else %}
47+
<li><div class="pager-edge"></div></li>
48+
{%- endif %}
49+
<li><div class="current-page">{{ paginator.page }}</div></li>
50+
{%- if paginator.next_page %}
51+
<li><a href="{{ paginator.next_page_path | relative_url }}" class="next-page">{{ paginator.next_page }}</a></li>
52+
{%- else %}
53+
<li><div class="pager-edge"></div></li>
54+
{%- endif %}
55+
</ul>
56+
</div>
57+
{%- endif %}
58+
59+
{%- endif -%}
60+
61+
</div>

0 commit comments

Comments
 (0)