-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathposts.html
More file actions
54 lines (46 loc) · 1.81 KB
/
posts.html
File metadata and controls
54 lines (46 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
layout: page
title: Posts
---
{% assign posts = site.posts | where_exp: "post", "post.layout == 'post' or post.layout == 'cross-post'" | sort: 'date' | reverse %}
<ul class="posts-list list-unstyled" role="list">
{% for post in posts %}
<li class="post-preview">
<article>
{% if post.layout == 'post' %}
<a href="{{ post.url | absolute_url }}">
<h2 class="post-title">{{ post.title | strip_html }}</h2>
{% if post.subtitle %}
<h3 class="post-subtitle">
{{ post.subtitle | strip_html }}
</h3>
{% endif %}
</a>
{% else if post.layout == 'cross-post' %}
<a href="{{ post.external_url | absolute_url }}">
<h2 class="cross-post-title">{{ post.source | strip_html }}: {{ post.title | strip_html }}</h2>
</a>
{% endif %}
{% if post.author %}
<span>By <strong>{{ post.author | strip_html }}</strong></span>
{% endif %}
<p class="post-meta">
{% assign date_format = site.date_format | default: "%Y-%m-%d" %}
Posted on {{ post.date | date: date_format }}
</p>
<div class="post-entry">
{% assign excerpt_length = site.excerpt_length | default: 50 %}
{{ post.excerpt | strip_html | truncatewords: excerpt_length }}
{% assign excerpt_word_count = post.excerpt | number_of_words %}
{% if post.layout == 'post' %}
{% if post.content != post.excerpt or excerpt_word_count > excerpt_length %}
<a href="{{ post.url | absolute_url }}" class="post-read-more">[Read More]</a>
{% endif %}
{% else if post.layout == 'cross-post' %}
<a href="{{ post.external_url | relative_url }}" class="post-read-more">[View on {{ post.source }}]</a>
{% endif %}
</div>
</article>
</li>
{% endfor %}
</ul>