From 0176419d17e6bdc38b914b2c27617379eb5d42e6 Mon Sep 17 00:00:00 2001 From: cuu Date: Wed, 21 Feb 2024 23:17:55 -0800 Subject: [PATCH] try to fix Liquid Exception: Liquid error (line 2): Cannot sort a null object. in /github/workspace/_global/Special:*** --- _global/Special:Categories.html | 3 ++- _global/Special:LongPages.html | 2 ++ _global/Special:RecentChanges.html | 2 ++ _global/Special:ShortPages.html | 4 ++++ _global/feed.xml | 2 ++ 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/_global/Special:Categories.html b/_global/Special:Categories.html index 6e7bce9..3512b46 100644 --- a/_global/Special:Categories.html +++ b/_global/Special:Categories.html @@ -4,6 +4,7 @@ title: Tags menu: ['global'] --- diff --git a/_global/Special:LongPages.html b/_global/Special:LongPages.html index 8deeecb..7b0c8a5 100644 --- a/_global/Special:LongPages.html +++ b/_global/Special:LongPages.html @@ -3,6 +3,7 @@ layout: default title: Long pages menu: ['global'] --- +{% if site.data.wiki_pages %} {%- assign long_pages = site.data.wiki_pages | sort: 'bytes' | reverse -%}
    {%- for page in long_pages limit:50 -%} @@ -11,3 +12,4 @@ menu: ['global'] {%- endfor -%}
+{% endif %} diff --git a/_global/Special:RecentChanges.html b/_global/Special:RecentChanges.html index d268eac..f2c9094 100644 --- a/_global/Special:RecentChanges.html +++ b/_global/Special:RecentChanges.html @@ -3,6 +3,7 @@ layout: default title: Recent changes menu: ['global'] --- +{% if site.data.wiki_pages %} {%- assign recent_changes = site.data.wiki_pages | where_exp: 'page', 'page.modified' | sort: 'modified' | reverse -%} +{% endif %} diff --git a/_global/Special:ShortPages.html b/_global/Special:ShortPages.html index 91d9250..7a38c41 100644 --- a/_global/Special:ShortPages.html +++ b/_global/Special:ShortPages.html @@ -3,6 +3,8 @@ layout: default title: Short pages menu: ['global'] --- +{% if site.data.wiki_pages %} + {%- assign long_pages = site.data.wiki_pages | sort: 'bytes' -%}
    {%- for page in long_pages limit:50 -%} @@ -11,3 +13,5 @@ menu: ['global'] {%- endfor -%}
+ +{% endif %} diff --git a/_global/feed.xml b/_global/feed.xml index 3163900..3489328 100644 --- a/_global/feed.xml +++ b/_global/feed.xml @@ -7,6 +7,7 @@ layout: null {{ site.title }} {{ site.description }} {{ site.url }} + {% if site.data.wiki_pages %} {% assign wiki_pages = site.data.wiki_pages | sort: 'created' %} {% for post in wiki_pages reversed%} {% unless post.draft %} @@ -19,5 +20,6 @@ layout: null {% endunless %} {% endfor %} + {% endif %}