mirror of
https://codeberg.org/fediverse/fediparty.git
synced 2024-09-13 07:17:20 +00:00
1304dbeb25
This commit re-implements `_.groupBy`. The call to `_.sortBy` was unnecessary and was thus removed entirely. This should simplify migration to newer releases of Hexo that no longer include lodash.
22 lines
624 B
Plaintext
22 lines
624 B
Plaintext
|
|
---
|
|
layout: layout
|
|
---
|
|
|
|
<div class="contents u-height">
|
|
<div class="tags__cloud">
|
|
<% site.tags.map(function(tag) { %>
|
|
<%- partial('_partial/snowflake') %><a href="<%- url_for('/tags/' + tag.name) %>"><%= tag.name %></a>
|
|
<% }) %>
|
|
</div>
|
|
<div class="one-tag-list">
|
|
<% const groupObj = groupBy(site.posts.sort('date', -1).toArray(), function(p){return -p.date.format('YYYY')}) %>
|
|
<% for (let year in groupObj){ %>
|
|
<h3 class="tags__year"><%- -year %></h3>
|
|
<ul class="tags__list">
|
|
<%- partial('_partial/taglist', {posts: groupObj[year]}) %>
|
|
</ul>
|
|
<% } %>
|
|
</div>
|
|
</div>
|