Skip to content

Commit b402eee

Browse files
author
Niklas Buschmann
committed
simplify site structure
1 parent 31494b3 commit b402eee

File tree

6 files changed

+41
-35
lines changed

6 files changed

+41
-35
lines changed

_layouts/home.html renamed to _includes/home.html

+8-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
---
2-
layout: default
3-
---
4-
{% if site.show_excerpts %}
5-
{%- assign posts = paginator.posts | default: site.posts -%}
6-
{% for post in posts %}
7-
{% include post.html post=post preview=true %}
8-
{% endfor %}
9-
{% else %}
10-
{% include archive.html title="Posts" %}
11-
{% endif %}
1+
{%- assign posts = paginator.posts | default: site.posts -%}
2+
{% for post in posts %}
3+
<article>
4+
{% include meta.html post=post preview=true %}
5+
{{ post.excerpt }}
6+
<div class="more"><a href="{{ post.url | relative_url }}">read more</a></div>
7+
</article>
8+
{% endfor %}
129

1310
{% if paginator.total_pages > 1 %}
1411
<footer>

_includes/meta.html

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<header>
2+
{% if include.post.categories.size > 0 and site.minimal != true and include.preview != true %}
3+
<div class="categories">{{ include.post.categories | join: ", " | upcase }}</div>
4+
{% endif %}
5+
<h1><a href="{{ include.post.url | relative_url }}">{{ include.post.title }}</a></h1>
6+
{%- assign date_format = site.date_format | default: "%B %d, %Y" -%}
7+
<time datetime="{{ include.post.date | date_to_xmlschema }}">{{ include.post.date | date: date_format }}</time>
8+
</header>

_includes/post.html

-22
This file was deleted.

_layouts/post.html

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
---
22
layout: default
33
---
4-
{% include post.html post=page %}
4+
5+
<article>
6+
{% include meta.html post=page %}
7+
{{ page.content }}
8+
{% if page.comments != false and site.comments.isso or site.comments.disqus %}
9+
<hr>
10+
{% if site.comments.isso %}<div id="isso-thread"></div>{% endif %}
11+
{% if site.comments.disqus %}<div id="disqus_thread"></div>{% endif %}
12+
<noscript>Please enable JavaScript to view comments.</noscript>
13+
{% endif %}
14+
</article>
515

616
{% if site.show_related %}
717
<footer class="related">

archive.html

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: "Archive"
3+
layout: default
4+
sitemap: false
5+
---
6+
7+
{% include archive.html %}

index.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
---
2-
layout: home
2+
layout: default
33
title: "Home"
44
---
5+
6+
{% if site.show_excerpts %}
7+
{% include home.html %}
8+
{% else %}
9+
{% include archive.html title="Posts" %}
10+
{% endif %}

0 commit comments

Comments
 (0)