From 562fcd4fd8dbc783f68cc754859698f9e06fa210 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Fri, 17 Jul 2020 16:27:11 +0800 Subject: [PATCH] Fixed posts' base-url on cache list. --- assets/js/data/cache-list.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/assets/js/data/cache-list.js b/assets/js/data/cache-list.js index 8de9a3d..df6f7d2 100644 --- a/assets/js/data/cache-list.js +++ b/assets/js/data/cache-list.js @@ -42,14 +42,10 @@ const include = [ /* The posts of first Home page and recent update list */ {% assign post_list = "" | split: "" %} - {% assign sum = 0 %} - {% for post in site.posts %} - {% assign post_list = post_list | push: post.url %} - {% assign sum = sum | plus: 1 %} - {% if sum >= site.paginate %} - {% break %} - {% endif %} + {% for post in site.posts limit: site.paginate %} + {% capture post_url %}{{ post.url | relative_url }}{% endcapture %} + {% assign post_list = post_list | push: post_url %} {% endfor %} {% include update-list.html %}