File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,12 +28,7 @@ <h3 data-toc-skip>
2828
2929 {% if post %}
3030 {% assign url = post.url | relative_url %}
31-
3231 < li > < a href ="{{ url }} "> {{ post.title }}</ a > </ li >
33-
34- {% assign sum = sum | plus: 1 %}
35- {% if sum > = MAX_SIZE %} {% break %} {% endif %}
36-
3732 {% endif %}
3833
3934 {% endfor %}
Original file line number Diff line number Diff line change 77{% endcomment %}
88
99{% assign MAX_SIZE = 5 %}
10- {% assign sum = 0 %}
11- {% assign update_list = "" | split: "" %}
10+
11+ {% assign all_list = "" | split: "" %}
1212
1313{% for entry in site.data.updates %}
1414 {% capture elem %}
1515 {{- entry.lastmod -}}::{{- entry.filename -}}
1616 {% endcapture %}
17-
18- {% assign update_list = update_list | push: elem %}
17+ {% assign all_list = all_list | push: elem %}
1918{% endfor %}
2019
21- {% assign update_list = update_list | sort | reverse %}
20+ {% assign all_list = all_list | sort | reverse %}
21+
22+ {% assign update_list = "" | split: "" %}
23+
24+ {% for entry in all_list limit:MAX_SIZE %}
25+ {% assign update_list = update_list | push: entry %}
26+ {% endfor %}
Original file line number Diff line number Diff line change @@ -53,8 +53,9 @@ const include = [
5353 { % endfor % }
5454
5555 { % include update - list . html % }
56+
5657 { % for item in update_list % }
57- { % assign url = item | split : "::" | last | prepend : "/posts/" | append : "/" % }
58+ { % assign url = item | split : "::" | last | url_encode | prepend : "/posts/" | append : "/" | relative_url % }
5859 { % assign post_list = post_list | push : url % }
5960 { % endfor % }
6061
You can’t perform that action at this time.
0 commit comments