-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
62 lines (55 loc) · 2.57 KB
/
index.html
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
55
56
57
58
59
60
61
62
---
layout: default
---
<section class="post-list">
{% for post in paginator.posts %}
{% assign images = post.content | split:'<img src="' %}
{% assign imageSize = images | size | minus: 1 %}
{% if post.thumb %}
{% assign thumbnail = post.thumb | replace: 'IMG_PATH', site.IMG_PATH %}
{% else %}
{% if post.content contains site.IMG_PATH %}
{% for image in images %}
{% if image contains site.IMG_PATH %}
{% assign thumbnail = image | split: '?imageView' | first | split: '"' | first | remove: '_640v' | remove: '_640' %}
{% break %}
{% endif %}
{% endfor %}
{% else %}
{% assign thumbnail = site.IMG_PATH | append: '/avatar.jpg' %}
{% endif %}
{% endif %}
{% if thumbnail contains 'svg' %}
{% assign thumbnail = thumbnail %}
{% else %}
{% assign thumbnail = thumbnail | append: '?imageView2/1/w/100/h/100/q/90' %}
{% endif %}
<article class="post-item">
<i class="post-item-thumb" data-src="{{ thumbnail }}" style="background-image:url({{ thumbnail }})"></i>
<section class="post-item-summary">
<h3 class="post-item-title"><a class="post-item-link" href="{{ post.url }}" title="{{ post.title }}">{{ post.title }}{% if imageSize > 30 and post.category == 'life' %}[{{ imageSize }}P]{% endif %}</a></h3>
<time class="post-item-date timeago" datetime="{{ post.date | date_to_xmlschema }}"></time>
</section>
<a class="post-item-comment" title="查看评论" data-disqus-url="{{ post.url }}" href="{{ post.url }}#comment"></a>
</article>
{% endfor %}
</section>
<nav class="pagination">
<ul class="pagination-list">
{% if paginator.next_page %}
<li class="pagination-item"><a class="pagination-item-link" href="/page{{ paginator.next_page}}/">« 较旧文章</a></li>
{% else %}
<li class="pagination-item"></li>
{% endif %}
<li class="pagination-item">{{ paginator.page}} / {{ paginator.total_pages}}</li>
{% if paginator.previous_page %}
{% if paginator.previous_page == 1 %}
<li class="pagination-item"><a class="pagination-item-link" href="/">较新文章 »</a></li>
{% else %}
<li class="pagination-item"><a class="pagination-item-link" href="/page{{ paginator.previous_page}}/">较新文章 »</a></li>
{% endif %}
{% else %}
<li class="pagination-item"></li>
{% endif %}
</ul>
</nav>