-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcollection-home.html
137 lines (123 loc) · 4.82 KB
/
collection-home.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
---
vim: expandtab filetype=liquid
layout: default
version: 0.0.2
license: AGPL-3.0
author: S0AndS0
---
{% capture workspace__collection_home %}
{% assign target_collection = site[page.collection_name] %}
{% assign date_format = site[site.theme].date_format | default: "%b %-d, %Y" %}
{% assign list_title = page.list_title | default: page.collection_name %}
{% assign list_title_id = list_title | slugify: "ascii" %}
<div class="home">
{% if page.title %}
<h1 class="page-heading">{{ page.title }}</h1>
{% endif %}
{{ content }}
{% comment %}
Builds list of posts
{% endcomment %}
{% assign has_output = false %}
{% assign has_atom_feed = false %}
{% assign has_rss_feed = false %}
{% if target_collection.size > 0 %}{% comment %}<br> syntax highlighting work-around #{% endcomment %}
{% capture workspace__collection__list %}
<h2 class="post-list-heading" id="{{ list_title_id }}">{{ list_title }}</h2>
<ul class="post-list">
{% for post in target_collection %}
{% if page.relative_path == post.relative_path %}
{% continue %}
{% elsif post.ext == '.xml' or post.ext == '.rss' %}
{% assign has_rss_feed = true %}
{% assign feed_rss_url = post.url %}
{% continue %}
{% elsif post.ext == '.atom' %}
{% assign has_atom_feed = true %}
{% assign feed_atom_url = post.url %}
{% continue %}
{% elsif post.ext == '.json' %}
{% if post.slug == 'feed' or post.slug == page.collection_name %}
{% assign has_json_feed = true %}
{% assign feed_json_url = post.url %}
{% endif %}
{% continue %}
{% endif %}
{% assign has_output = true %}
<li>
<span class="post-meta">{{ post.date | date: date_format }}</span>
<h3>
<a class="post-link" href="{{ post.url | relative_url }}">
{{ post.title | escape }}
</a>
</h3>
{% if post.description %}
<blockquote>
{{ post.description | markdownify | remove: '<p>' | remove: '</p>' }}
</blockquote>
{% elsif site.show_excerpts and post.excerpt %}
<blockquote>
{{ post.excerpt | markdownify | remove: '<p>' | remove: '</p>' }}
</blockquote>
{% endif %}
</li>
{% endfor %}
</ul>
{% endcapture %}
{% comment %}
Note for future _includes/header.html modifications
<link
rel="alternate"
title="{{ page.collection_name }}"
type="application/atom+xml"
href="{{ page.collection_name | append: '/feed.atom' | relative_url }}"
/>
{% endcomment %}
{% comment %}
Builds output for workspace__collection_home
{% endcomment %}
{% if has_output %}
{{ workspace__collection__list }}{% assign workspace__collection__list = nil %}
{% if has_rss_feed or has_atom_feed or has_rss_feed %}
<p class="feed-subscribe">
{% if has_rss_feed %}
<span>
<svg class="svg-icon orange">
<use xlink:href="{{ '/assets/minima-social-icons.svg#rss' | relative_url }}"></use>
</svg>
<a href="{{ feed_rss_url | relative_url }}">RSSv2</a>
{% assign feed_rss_url = nil %}
</span>
{% endif %}
{% if has_atom_feed %}
<span>
{% if has_rss_feed != true %}
<svg class="svg-icon orange">
<use xlink:href="{{ '/assets/minima-social-icons.svg#rss' | relative_url }}"></use>
</svg>
{% else %}
or
{% endif %}
<a href="{{ feed_atom_url | relative_url }}">Atom</a>
{% assign feed_atom_url = nil %}
</span>
{% endif %}
{% if has_json_feed %}
<span>
{% if has_rss_feed or has_atom_feed %}
or
{% elsif has_rss_feed != true and has_atom_feed != true %}
<svg class="svg-icon orange">
<use xlink:href="{{ '/assets/minima-social-icons.svg#rss' | relative_url }}"></use>
</svg>
{% endif %}
<a href="{{ feed_json_url | relative_url }}">JSON</a>
{% assign feed_json_url = nil %}
</span>
{% endif %}
</p>
{% endif %}
{% endif %}
{% endif %}
</div>
{% endcapture %}{{ workspace__collection_home | strip }}{% assign workspace__collection_home = nil %}