generated from CollectionBuilder/collectionbuilder-sa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes for dates and tags
51 lines (42 loc) · 1.63 KB
/
notes for dates and tags
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
FROM tags original :
{% assign date_format = site.date_format | default: "%B %-d, %Y" %}
{%- capture site_tags -%}
{%- for tag in site.tags -%}
{{- tag | first -}}{%- unless forloop.last -%},{%- endunless -%}
{%- endfor -%}
{%- endcapture -%}
{%- assign tags_list = site_tags | split:',' | sort -%}
{%- for tag in tags_list -%}
<a href="#{{- tag -}}" class="btn btn-primary tag-btn my-5"><i class="fas fa-tag" aria-hidden="true"></i> {{- tag -}} ({{site.tags[tag].size}})</a>
{%- endfor -%}
<div id="full-tags-list my-5">
{%- for tag in tags_list -%}
<h2 id="{{- tag -}}" class="linked-section">
<i class="fas fa-tag" aria-hidden="true"></i>
{{- tag -}} ({{site.tags[tag].size}})
</h2>
<div class="post-list">
{%- for post in site.tags[tag] -%}
<div class="tag-entry">
<a href="{{ post.url | relative_url }}">{{- post.title -}}</a>
<div class="entry-date">
<time datetime="{{- post.date | date_to_xmlschema -}}">{{- post.date | date: date_format -}}</time>
</div>
</div>
{%- endfor -%}
</div>
{%- endfor -%}
</div>
From home (DAtes):
<p class='h1 my-4'>Browse by Date</p>
{% for post in site.posts %}
{% assign currentdate = post.date | date: "%Y" %}
{% if currentdate != date %}
{% unless forloop.first %}</ul>{% endunless %}
<h1 id="y{{post.date | date: "%Y"}}">{{ currentdate }}</h1>
<ul>
{% assign date = currentdate %}
{% endif %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% if forloop.last %}</ul>{% endif %}
{% endfor %}