Skip to content

Commit 7360a99

Browse files
committed
Improved the Recent-Update list.
1 parent 6b65b1f commit 7360a99

2 files changed

Lines changed: 14 additions & 25 deletions

File tree

_includes/panel.html

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,31 @@
77
<div class="panel-group">
88

99
{% assign lastmod_list = "" | split: "" %}
10+
{% assign index = 0 %}
1011

1112
{% for post in site.posts %}
12-
{% if post.date >= post.seo.date_modified or post.seo.date_modified == nil %}
13-
{% continue %}
14-
{% endif%}
15-
{% capture item %}
16-
{{ post.seo.date_modified }}::{{ post.title }}::{{ post.url }}
17-
{% endcapture %}
18-
{% assign lastmod_list = lastmod_list | push: item %}
13+
{% if post.seo.date_modified > post.date and post.seo.date_modified != nil %}
14+
{% capture item %}
15+
{{ post.seo.date_modified }}::{{ index }}
16+
{% endcapture %}
17+
{% assign lastmod_list = lastmod_list | push: item %}
18+
{% endif %}
19+
{% assign index = index | plus: 1 %}
1920
{% endfor %}
2021

2122
{% if lastmod_list.size > 0 %}
2223
<div id="panel-update" class="post mb-4"">
2324
<h3 data-toc-skip>
2425
{{ site.data.label.panel.lastmod }}
2526
</h3>
26-
<ul class="post-content pl-0 mt-2 pb-1">
27+
<ul class="post-content pl-0 pb-1 ml-1 mt-2">
2728
{% assign MAX_SIZE = 5 %}
2829
{% assign sum = 0 %}
29-
{% assign sorted_posts = lastmod_list | sort | reverse %}
30-
{% for post in sorted_posts %}
31-
{% assign meta = post | split: "::" %}
32-
<li><a href="{{ meta[2] | prepend: site.baseurl }}">{{ meta[1] }}</a></li>
30+
{% assign lastmod_list = lastmod_list | sort | reverse %}
31+
{% for item in lastmod_list %}
32+
{% assign index = item | split: "::" | last | plus: 0 %}
33+
{% assign post = site.posts[index] %}
34+
<li><a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></li>
3335
{% assign sum = sum | plus: 1 %}
3436
{% if sum >= MAX_SIZE %}
3537
{% break %}
@@ -55,7 +57,6 @@ <h3 data-toc-skip>
5557
{% assign trends = tags_array | split: " " | sort | reverse %}
5658

5759
<div>
58-
<!-- <p>tags_array->{{ tags_array }}</p> -->
5960
{% for trend in trends %}
6061
{% assign count = count | plus: 1 %}
6162
{% assign tag = trend | split: ":" | last %}

assets/css/_src/main.scss

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -443,18 +443,6 @@ footer .license a {
443443
list-style: none;
444444
}
445445

446-
#panel-update ul>li::before {
447-
background: #999;
448-
width: 4px;
449-
height: 4px;
450-
border-radius: 50%;
451-
display: inline-block;
452-
content: "";
453-
position: relative;
454-
bottom: .2rem;
455-
margin-right: .4rem;
456-
}
457-
458446
#panel-update ul a {
459447
color: #6c757d;
460448
}

0 commit comments

Comments
 (0)