Improved the Recent-Update list.

This commit is contained in:
Cotes Chung 2019-10-25 02:40:42 +08:00
parent 094b3da714
commit 3b102ee4c6
2 changed files with 14 additions and 25 deletions

View File

@ -7,15 +7,16 @@
<div class="panel-group"> <div class="panel-group">
{% assign lastmod_list = "" | split: "" %} {% assign lastmod_list = "" | split: "" %}
{% assign index = 0 %}
{% for post in site.posts %} {% for post in site.posts %}
{% if post.date >= post.seo.date_modified or post.seo.date_modified == nil %} {% if post.seo.date_modified > post.date and post.seo.date_modified != nil %}
{% continue %} {% capture item %}
{% endif%} {{ post.seo.date_modified }}::{{ index }}
{% capture item %} {% endcapture %}
{{ post.seo.date_modified }}::{{ post.title }}::{{ post.url }} {% assign lastmod_list = lastmod_list | push: item %}
{% endcapture %} {% endif %}
{% assign lastmod_list = lastmod_list | push: item %} {% assign index = index | plus: 1 %}
{% endfor %} {% endfor %}
{% if lastmod_list.size > 0 %} {% if lastmod_list.size > 0 %}
@ -23,13 +24,14 @@
<h3 data-toc-skip> <h3 data-toc-skip>
{{ site.data.label.panel.lastmod }} {{ site.data.label.panel.lastmod }}
</h3> </h3>
<ul class="post-content pl-0 mt-2 pb-1"> <ul class="post-content pl-0 pb-1 ml-1 mt-2">
{% assign MAX_SIZE = 5 %} {% assign MAX_SIZE = 5 %}
{% assign sum = 0 %} {% assign sum = 0 %}
{% assign sorted_posts = lastmod_list | sort | reverse %} {% assign lastmod_list = lastmod_list | sort | reverse %}
{% for post in sorted_posts %} {% for item in lastmod_list %}
{% assign meta = post | split: "::" %} {% assign index = item | split: "::" | last | plus: 0 %}
<li><a href="{{ meta[2] | prepend: site.baseurl }}">{{ meta[1] }}</a></li> {% assign post = site.posts[index] %}
<li><a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></li>
{% assign sum = sum | plus: 1 %} {% assign sum = sum | plus: 1 %}
{% if sum >= MAX_SIZE %} {% if sum >= MAX_SIZE %}
{% break %} {% break %}
@ -55,7 +57,6 @@
{% assign trends = tags_array | split: " " | sort | reverse %} {% assign trends = tags_array | split: " " | sort | reverse %}
<div> <div>
<!-- <p>tags_array->{{ tags_array }}</p> -->
{% for trend in trends %} {% for trend in trends %}
{% assign count = count | plus: 1 %} {% assign count = count | plus: 1 %}
{% assign tag = trend | split: ":" | last %} {% assign tag = trend | split: ":" | last %}

View File

@ -443,18 +443,6 @@ footer .license a {
list-style: none; list-style: none;
} }
#panel-update ul>li::before {
background: #999;
width: 4px;
height: 4px;
border-radius: 50%;
display: inline-block;
content: "";
position: relative;
bottom: .2rem;
margin-right: .4rem;
}
#panel-update ul a { #panel-update ul a {
color: #6c757d; color: #6c757d;
} }