Skip to content

Commit 1979955

Browse files
committed
list posts extracted
1 parent be0eff0 commit 1979955

2 files changed

Lines changed: 19 additions & 18 deletions

File tree

_includes/list-posts.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<div id="posts">
2+
{% for post in site.posts %}
3+
<div class="post-card">
4+
<p>{{post.date | date_to_string }}</p>
5+
6+
{% if post.post_photo %}
7+
<img alt="{{post.title}} photo" src={{post.post_photo}}>
8+
{% else %}
9+
<img alt="placeholder" src="assets/home/post_placeholder.jpg">
10+
{% endif %}
11+
<a href="{{ post.url }}">
12+
<h2>
13+
{{post.title}}
14+
</h2>
15+
</a>
16+
</div>
17+
{% endfor %}
18+
</div>

_layouts/home.html

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,4 @@
3131

3232
{% include testimonials.html %}
3333

34-
<div id="posts">
35-
{% for post in site.posts %}
36-
<div class="post-card">
37-
<p>{{post.date | date_to_string }}</p>
38-
39-
{% if post.post_photo %}
40-
<img alt="{{post.title}} photo" src={{post.post_photo}}>
41-
{% else %}
42-
<img alt="placeholder" src="assets/home/post_placeholder.jpg">
43-
{% endif %}
44-
<a href="{{ post.url }}">
45-
<h2>
46-
{{post.title}}
47-
</h2>
48-
</a>
49-
</div>
50-
{% endfor %}
51-
</div>
34+
{% include list-posts.html %}

0 commit comments

Comments
 (0)