-
Notifications
You must be signed in to change notification settings - Fork 5
/
groups.html
41 lines (33 loc) · 1.08 KB
/
groups.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
---
layout: page
title: 分组
tagline: 按照所属组别展示
header: Post By Groups
comments: false
---
{% include JB/setup %}
{% assign posts_by_group = site.posts | group_by:"group" | sort:"group" %}
{% assign x_label = '组别' %}
{% assign y_label = '数目' %}
{% assign list = nil %}
{% for group in posts_by_group %}
{% if group.name == empty %}
{% assign group_name = site.data.groups['original'] %}
{% else %}
{% assign group_name = site.data.groups[group.name] %}
{% endif %}
{% assign list0 = group.items.size | append:',' | append: group_name %}
{% if list == nil %}
{% assign list = list0 %}
{% else %}
{% assign list = list | append:';' | append: list0 %}
{% endif %}
<h3 id="{{ group_name | downcase | replace:' ','-' | replace:'/','-' }}-ref">{{ group_name}} <sup>({{ group.items.size }})</sup></h3>
<ul>
{% for post in group.items %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
{% endfor %}
<h3>{{ x_label}}统计 <sup>({{ site.posts.size }})</sup></h3>
{% include widgets/svg_statistic %}