Skip to content

Commit

Permalink
simplify site structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Niklas Buschmann committed Feb 20, 2020
1 parent 31494b3 commit b402eee
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 35 deletions.
19 changes: 8 additions & 11 deletions _layouts/home.html → _includes/home.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
layout: default
---
{% if site.show_excerpts %}
{%- assign posts = paginator.posts | default: site.posts -%}
{% for post in posts %}
{% include post.html post=post preview=true %}
{% endfor %}
{% else %}
{% include archive.html title="Posts" %}
{% endif %}
{%- assign posts = paginator.posts | default: site.posts -%}
{% for post in posts %}
<article>
{% include meta.html post=post preview=true %}
{{ post.excerpt }}
<div class="more"><a href="{{ post.url | relative_url }}">read more</a></div>
</article>
{% endfor %}

{% if paginator.total_pages > 1 %}
<footer>
Expand Down
8 changes: 8 additions & 0 deletions _includes/meta.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<header>
{% if include.post.categories.size > 0 and site.minimal != true and include.preview != true %}
<div class="categories">{{ include.post.categories | join: ", " | upcase }}</div>
{% endif %}
<h1><a href="{{ include.post.url | relative_url }}">{{ include.post.title }}</a></h1>
{%- assign date_format = site.date_format | default: "%B %d, %Y" -%}
<time datetime="{{ include.post.date | date_to_xmlschema }}">{{ include.post.date | date: date_format }}</time>
</header>
22 changes: 0 additions & 22 deletions _includes/post.html

This file was deleted.

12 changes: 11 additions & 1 deletion _layouts/post.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
---
layout: default
---
{% include post.html post=page %}

<article>
{% include meta.html post=page %}
{{ page.content }}
{% if page.comments != false and site.comments.isso or site.comments.disqus %}
<hr>
{% if site.comments.isso %}<div id="isso-thread"></div>{% endif %}
{% if site.comments.disqus %}<div id="disqus_thread"></div>{% endif %}
<noscript>Please enable JavaScript to view comments.</noscript>
{% endif %}
</article>

{% if site.show_related %}
<footer class="related">
Expand Down
7 changes: 7 additions & 0 deletions archive.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Archive"
layout: default
sitemap: false
---

{% include archive.html %}
8 changes: 7 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
---
layout: home
layout: default
title: "Home"
---

{% if site.show_excerpts %}
{% include home.html %}
{% else %}
{% include archive.html title="Posts" %}
{% endif %}

0 comments on commit b402eee

Please sign in to comment.