diff --git a/_includes/panel.html b/_includes/panel.html index 0a63a63..b70a9b2 100644 --- a/_includes/panel.html +++ b/_includes/panel.html @@ -28,12 +28,7 @@ {% if post %} {% assign url = post.url | relative_url %} -
  • {{ post.title }}
  • - - {% assign sum = sum | plus: 1 %} - {% if sum >= MAX_SIZE %} {% break %} {% endif %} - {% endif %} {% endfor %} diff --git a/_includes/update-list.html b/_includes/update-list.html index 9a66fea..231d9a0 100644 --- a/_includes/update-list.html +++ b/_includes/update-list.html @@ -7,15 +7,20 @@ {% endcomment %} {% assign MAX_SIZE = 5 %} -{% assign sum = 0 %} -{% assign update_list = "" | split: "" %} + +{% assign all_list = "" | split: "" %} {% for entry in site.data.updates %} {% capture elem %} {{- entry.lastmod -}}::{{- entry.filename -}} {% endcapture %} - - {% assign update_list = update_list | push: elem %} + {% assign all_list = all_list | push: elem %} {% endfor %} -{% assign update_list = update_list | sort | reverse %} +{% assign all_list = all_list | sort | reverse %} + +{% assign update_list = "" | split: "" %} + +{% for entry in all_list limit:MAX_SIZE %} + {% assign update_list = update_list | push: entry %} +{% endfor %} diff --git a/assets/js/data/cache-list.js b/assets/js/data/cache-list.js index ab88073..8de9a3d 100644 --- a/assets/js/data/cache-list.js +++ b/assets/js/data/cache-list.js @@ -53,8 +53,9 @@ const include = [ {% endfor %} {% include update-list.html %} + {% for item in update_list %} - {% assign url = item | split: "::" | last | prepend: "/posts/" | append: "/" %} + {% assign url = item | split: "::" | last | url_encode | prepend: "/posts/" | append: "/" | relative_url %} {% assign post_list = post_list | push: url %} {% endfor %}