-
Notifications
You must be signed in to change notification settings - Fork 7
/
highlights.html
76 lines (72 loc) · 3.88 KB
/
highlights.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
title: Highlights
section: library
permalink: /library/highlights
image: "https://www.buddhistuniversity.net/imgs/Kyoto-temple.jpg"
big_image: https://upload.wikimedia.org/wikipedia/commons/3/3d/Nanzen-ji%2C_a_Zen_Buddhist_temple%2C_and_its_surroundings%2C_Kyoto%3B_November_2016_%2801%29.jpg
big_width: 5928
big_height: 3952
image_width: 1280
image_center_y: 53%
image_center_x: 50%
image_height: 853
banner_info: <a href="https://commons.wikimedia.org/wiki/File:Nanzen-ji,_a_Zen_Buddhist_temple,_and_its_surroundings,_Kyoto;_November_2016_(01).jpg">雷太</a>, <a href="https://creativecommons.org/licenses/by/2.0">CC BY 2.0</a>
---
{% assign allcontent = site.content | where_exp: "c", "c.external_url or c.drive_links or c.file_links" %}
{% capture thisyear %}{{ 'now' | date: "%Y" }}{% endcapture %}
{% assign lastyear = thisyear | minus: 1 %}
<h2>Table of Contents</h2><ul id="toc">
{% if site.show_timestamps %}<li><a href="#latest">Latest Arrivals</a></li>{% endif %}
<li><a href="#recent">Recently Published</a></li>
<li><a href="#bestof">Featured Content</a></li>
</ul>
{% if site.show_timestamps %}
<h2 id="latest"><i class="fas fa-clock"></i> Latest Arrivals</h2>
<p>Just added to the library:</p>
{% assign newc = allcontent | sort: "date" | reverse | slice: 0, 10 %}
{%- assign copycontent = allcontent -%}
{%- assign allcontent = '' | split: '' -%}
{%- for c in copycontent -%}
{%- unless newc contains c -%}
{%- assign allcontent = allcontent | push: c -%}
{%- endunless -%}
{%- endfor -%}
{% for c in newc %}
<div class="mb-3">{% include simple_content_title.html content=c %}<ul><li>Added {{ c.date | date_to_long_string: "ordinal" }}</li></ul></div>
{% endfor %}
<p>... To continue, see <a href="/content/all/?n=10&order=5.desc&cols=0.3.5">the content table, sorted by date</a> or consider subscribing to <a href="/feed/content.xml">the RSS feed</a>.</p>
{% endif %}
{%- assign worldcanary = site.content | find: "slug", "art-of-being-human_wesch-m" -%}
{%- include content_primarytag_ordinality.liquid item=worldcanary -%}
{%- assign secularordinality = ordinality -%}
{%- comment -%}Note that `thisyear` is a string and so cannot be compared to c.year{%- endcomment -%}
{%- assign recentcontent = allcontent | where_exp: "c", "c.year >= lastyear" -%}
{%- assign tags = site.tags | where: "status", "published" | map: "slug" -%}
{%- assign courses = site.courses | map: "slug" | concat: tags -%}
{%- comment -%}For the last 2 years we want to show content that is either:
- Featured AND in a published tag
- or is about Buddhism AND was published this year
{%- endcomment -%}
{%- assign featurecontent = recentcontent | where: "status", "featured" | where_exp: "c", "courses contains c.course" -%}
{%- for c in recentcontent -%}
{%- if c.status == "featured" -%}{%- continue -%}{%- endif -%}
{%- unless c.course -%}{% continue %}{%- endunless -%}
{%- unless c.year > lastyear -%}{% continue %}{%- endunless -%}
{%- include content_primarytag_ordinality.liquid item=c -%}
{%- if ordinality >= secularordinality -%}{% continue %}{%- endif -%}
{%- assign featurecontent = featurecontent | push: c -%}
{%- endfor -%}
{%- assign featurecontent = featurecontent | sort: "date" | reverse -%}
<h2 id="recent"><i class="fas fa-calendar-week"></i> Recently Published</h2>
<p>Within the last couple years.</p>
{% for c in featurecontent %}
<div class="mb-3">{% include simple_content_title.html content=c %}</div>{% endfor %}
<h2 id="bestof"><i class="fas fa-medal"></i> Featured Selections</h2>
<p>A couple works are selected as the cream of the crop each year.</p>
{% capture fe %}c.year < {{ lastyear }}{% endcapture %}
{% assign featurecontent = allcontent | where_exp: "c", fe | where: "stars", 5 | group_by: "year" | sort: "name" | reverse %}
{% for y in featurecontent %}
<h3>{{ y.name }}</h3>
{% for c in y.items %}
<div class="mb-3">{% include simple_content_title.html content=c %}</div>{% endfor %}
{% endfor %}