Skip to content

Commit

Permalink
rendering posts properly
Browse files Browse the repository at this point in the history
  • Loading branch information
rjoberon committed Jul 26, 2024
1 parent e730b15 commit 43644c6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 23 deletions.
22 changes: 22 additions & 0 deletions _includes/post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: Post
---
<li>
<div>
{%- if post.image -%}
<img src="{{ post.image | replace:'/img/','/img/thumbs/' }}" />
{%- endif -%}
</div>
<div class="snippet">
{%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%}
<span class="post-meta">{{ post.date | date: date_format }}</span>
<h3>
<a class="post-link" href="{{ post.url | relative_url }}">
{{ post.title | escape }}
</a>
</h3>
{%- if site.show_excerpts -%}
{{ post.excerpt }}
{%- endif -%}
</div>
</li>
10 changes: 6 additions & 4 deletions _includes/tag_index_page.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
layout: default
---

<h1>{{ tag }} Posts</h1>
<h1 class="page-heading">{{ tag }} posts</h1>

{% for post in tagged_posts %}
{{ post.title }}
{% endfor %}
<ul class="post-list">
{% for post in tagged_posts %}
{% include post.html %}
{% endfor %}
</ul>
20 changes: 1 addition & 19 deletions _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,7 @@ <h1 class="page-heading">{{ page.title }}</h1>
<h2 class="post-list-heading">{{ page.list_title | default: "Posts" }}</h2>
<ul class="post-list">
{%- for post in site.posts -%}
<li>
<div>
{%- if post.image -%}
<img src="{{ post.image | replace:'/img/','/img/thumbs/' }}" />
{%- endif -%}
</div>
<div class="snippet">
{%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%}
<span class="post-meta">{{ post.date | date: date_format }}</span>
<h3>
<a class="post-link" href="{{ post.url | relative_url }}">
{{ post.title | escape }}
</a>
</h3>
{%- if site.show_excerpts -%}
{{ post.excerpt }}
{%- endif -%}
</div>
</li>
{% include post.html %}
{%- endfor -%}
</ul>

Expand Down

0 comments on commit 43644c6

Please sign in to comment.