forked from meizuosc/meizuosc.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
authors.html
37 lines (33 loc) · 1.28 KB
/
authors.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
---
layout: page
title: 撰稿作者
header: Post By Authors
comments: false
---
{% include JB/setup %}
{% assign posts_by_author = site.posts | group_by:"author" | sort:"items" %}
{% assign list = nil %}
{% for post_author in posts_by_author %}
{% assign author_name = post_author.name %}
{% assign list0 = post_author.items.size | append:',' | append: author_name %}
{% if list == nil %}
{% assign list = list0 %}
{% else %}
{% assign list = list | append:';' | append: list0 %}
{% endif %}
{% assign post_author_name = post_author.name | replace:' ','-' %}
{% assign author_data = site.data.people[author_name] %}
<div id="posts-list">
{% if author_data.avatar contains 'http' %}
<img src="{{ author_data.avatar }}" class="bio-photo" alt="{{ author_data.name }} bio photo">
{% else %}
<img src="{{ site.url }}/images/people/{% if author_data.avatar %}{{ author_data.avatar }}{% else %}bio-photo.jpg{% endif %}" class="bio-photo" alt="{{ author_data.name }} bio photo">
{% endif %}
<h3 id="{{ post_author_name }}">{{ author_data.nickname }} <sup>( {{ post_author.items.size }} ) </sup></h3>
<ul>
{% for post in post_author.items %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
</div>
{% endfor %}