mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-06-08 00:27:58 +00:00
Optimized update list & fixed sw cache list.
This commit is contained in:
parent
9f3619e54a
commit
22115f3797
@ -28,12 +28,7 @@
|
|||||||
|
|
||||||
{% if post %}
|
{% if post %}
|
||||||
{% assign url = post.url | relative_url %}
|
{% assign url = post.url | relative_url %}
|
||||||
|
|
||||||
<li><a href="{{ url }}">{{ post.title }}</a></li>
|
<li><a href="{{ url }}">{{ post.title }}</a></li>
|
||||||
|
|
||||||
{% assign sum = sum | plus: 1 %}
|
|
||||||
{% if sum >= MAX_SIZE %} {% break %} {% endif %}
|
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -7,15 +7,20 @@
|
|||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
|
|
||||||
{% assign MAX_SIZE = 5 %}
|
{% assign MAX_SIZE = 5 %}
|
||||||
{% assign sum = 0 %}
|
|
||||||
{% assign update_list = "" | split: "" %}
|
{% assign all_list = "" | split: "" %}
|
||||||
|
|
||||||
{% for entry in site.data.updates %}
|
{% for entry in site.data.updates %}
|
||||||
{% capture elem %}
|
{% capture elem %}
|
||||||
{{- entry.lastmod -}}::{{- entry.filename -}}
|
{{- entry.lastmod -}}::{{- entry.filename -}}
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
|
{% assign all_list = all_list | push: elem %}
|
||||||
{% assign update_list = update_list | push: elem %}
|
|
||||||
{% endfor %}
|
{% 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 %}
|
||||||
|
@ -53,8 +53,9 @@ const include = [
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% include update-list.html %}
|
{% include update-list.html %}
|
||||||
|
|
||||||
{% for item in update_list %}
|
{% 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 %}
|
{% assign post_list = post_list | push: url %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user