forked from tinyclub/tinylab.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauthors.html
60 lines (50 loc) · 1.89 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
layout: page
title: 作者
tagline: 展示原创作者及其贡献
header: Post By Authors
comments: false
---
{% include JB/setup %}
{% assign posts_by_author = site.posts | group_by:"author" | sort:"author" %}
{% assign x_label = '作者' %}
{% assign y_label = '贡献' %}
{% 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:' ','-' %}
<h3 id="{{ post_author_name | downcase | replace:' ','-' | replace:'/','-' }}-ref"><a id="author-{{post_author_name}}" title="点击查看作者详细信息">{{ post_author.name }}</a> <sup>({{ post_author.items.size }})</sup></h3>
<div id="author-box-wrap-{{ post_author_name }}" class="author-box-wrap" style="display:none">
{% assign author_box_id = post_author_name %}
{% assign author_box_ref = post_author_name | prepend:"-" %}
{% assign author_box_visible = "style='display: block;'" %}
{% include widgets/author_box %}
<script>
jQuery(document).ready(function(){
var author_box = $('#author-box-wrap-{{ post_author_name }}');
$("#author-{{ post_author_name }}").click(function(e){
var status = author_box.css('display');
if (status == "none") {
author_box.show();
} else {
author_box.hide();
}
});
});
</script>
</div>
<ul>
{% for post in post_author.items %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
{% endfor %}
{% assign list = list | split:';' | join:';' %}
<h3>{{ x_label}}{{ y_label}}统计 <sup>({{ site.posts.size }})</sup></h3>
{% include widgets/svg_statistic %}