Fix homepage recent posts rendering
This commit is contained in:
@@ -7,7 +7,12 @@
|
|||||||
{% set sectionConfig = section.config or {} %}
|
{% set sectionConfig = section.config or {} %}
|
||||||
{% set maxItems = sectionConfig.maxItems or 5 %}
|
{% set maxItems = sectionConfig.maxItems or 5 %}
|
||||||
{% set showSummary = sectionConfig.showSummary if sectionConfig.showSummary is defined else true %}
|
{% set showSummary = sectionConfig.showSummary if sectionConfig.showSummary is defined else true %}
|
||||||
{% set listedPosts = collections.posts | excludeUnlistedPosts %}
|
{% set primaryPosts = collections.posts if (collections and collections.posts) else [] %}
|
||||||
|
{% set fallbackRecentPosts = collections.recentPosts if (collections and collections.recentPosts) else [] %}
|
||||||
|
{% set listedPosts = primaryPosts | excludeUnlistedPosts %}
|
||||||
|
{% if not (listedPosts and listedPosts.length) %}
|
||||||
|
{% set listedPosts = fallbackRecentPosts | excludeUnlistedPosts %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if listedPosts and listedPosts.length %}
|
{% if listedPosts and listedPosts.length %}
|
||||||
<section class="mb-8 sm:mb-12">
|
<section class="mb-8 sm:mb-12">
|
||||||
@@ -68,7 +73,7 @@
|
|||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% unfurl likedUrl %}
|
{{ likedUrl | unfurlCard | safe }}
|
||||||
<a class="u-like-of text-xs text-surface-600 dark:text-surface-400 hover:underline break-all mt-1 inline-block" href="{{ likedUrl }}">
|
<a class="u-like-of text-xs text-surface-600 dark:text-surface-400 hover:underline break-all mt-1 inline-block" href="{{ likedUrl }}">
|
||||||
{{ likedUrl }}
|
{{ likedUrl }}
|
||||||
</a>
|
</a>
|
||||||
@@ -112,7 +117,7 @@
|
|||||||
<a class="hover:text-amber-600 dark:hover:text-amber-400" href="{{ post.url }}">{{ post.data.title }}</a>
|
<a class="hover:text-amber-600 dark:hover:text-amber-400" href="{{ post.url }}">{{ post.data.title }}</a>
|
||||||
</h3>
|
</h3>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% unfurl bookmarkedUrl %}
|
{{ bookmarkedUrl | unfurlCard | safe }}
|
||||||
<a class="u-bookmark-of text-xs text-surface-600 dark:text-surface-400 hover:underline break-all mt-1 inline-block" href="{{ bookmarkedUrl }}">
|
<a class="u-bookmark-of text-xs text-surface-600 dark:text-surface-400 hover:underline break-all mt-1 inline-block" href="{{ bookmarkedUrl }}">
|
||||||
{{ bookmarkedUrl }}
|
{{ bookmarkedUrl }}
|
||||||
</a>
|
</a>
|
||||||
@@ -151,7 +156,7 @@
|
|||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% unfurl repostedUrl %}
|
{{ repostedUrl | unfurlCard | safe }}
|
||||||
<a class="u-repost-of text-xs text-surface-600 dark:text-surface-400 hover:underline break-all mt-1 inline-block" href="{{ repostedUrl }}">
|
<a class="u-repost-of text-xs text-surface-600 dark:text-surface-400 hover:underline break-all mt-1 inline-block" href="{{ repostedUrl }}">
|
||||||
{{ repostedUrl }}
|
{{ repostedUrl }}
|
||||||
</a>
|
</a>
|
||||||
@@ -190,7 +195,7 @@
|
|||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% unfurl replyToUrl %}
|
{{ replyToUrl | unfurlCard | safe }}
|
||||||
<a class="u-in-reply-to text-xs text-surface-600 dark:text-surface-400 hover:underline break-all mt-1 inline-block" href="{{ replyToUrl }}">
|
<a class="u-in-reply-to text-xs text-surface-600 dark:text-surface-400 hover:underline break-all mt-1 inline-block" href="{{ replyToUrl }}">
|
||||||
{{ replyToUrl }}
|
{{ replyToUrl }}
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -7,7 +7,12 @@
|
|||||||
{% set sectionConfig = section.config or {} %}
|
{% set sectionConfig = section.config or {} %}
|
||||||
{% set maxItems = sectionConfig.maxItems or 5 %}
|
{% set maxItems = sectionConfig.maxItems or 5 %}
|
||||||
{% set showSummary = sectionConfig.showSummary if sectionConfig.showSummary is defined else true %}
|
{% set showSummary = sectionConfig.showSummary if sectionConfig.showSummary is defined else true %}
|
||||||
{% set listedPosts = collections.posts | excludeUnlistedPosts %}
|
{% set primaryPosts = collections.posts if (collections and collections.posts) else [] %}
|
||||||
|
{% set fallbackRecentPosts = collections.recentPosts if (collections and collections.recentPosts) else [] %}
|
||||||
|
{% set listedPosts = primaryPosts | excludeUnlistedPosts %}
|
||||||
|
{% if not (listedPosts and listedPosts.length) %}
|
||||||
|
{% set listedPosts = fallbackRecentPosts | excludeUnlistedPosts %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if listedPosts and listedPosts.length %}
|
{% if listedPosts and listedPosts.length %}
|
||||||
<section class="mb-8 sm:mb-12">
|
<section class="mb-8 sm:mb-12">
|
||||||
@@ -68,7 +73,7 @@
|
|||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% unfurl likedUrl %}
|
{{ likedUrl | unfurlCard | safe }}
|
||||||
<a class="u-like-of text-xs text-surface-600 dark:text-surface-400 hover:underline break-all mt-1 inline-block" href="{{ likedUrl }}">
|
<a class="u-like-of text-xs text-surface-600 dark:text-surface-400 hover:underline break-all mt-1 inline-block" href="{{ likedUrl }}">
|
||||||
{{ likedUrl }}
|
{{ likedUrl }}
|
||||||
</a>
|
</a>
|
||||||
@@ -112,7 +117,7 @@
|
|||||||
<a class="hover:text-amber-600 dark:hover:text-amber-400" href="{{ post.url }}">{{ post.data.title }}</a>
|
<a class="hover:text-amber-600 dark:hover:text-amber-400" href="{{ post.url }}">{{ post.data.title }}</a>
|
||||||
</h3>
|
</h3>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% unfurl bookmarkedUrl %}
|
{{ bookmarkedUrl | unfurlCard | safe }}
|
||||||
<a class="u-bookmark-of text-xs text-surface-600 dark:text-surface-400 hover:underline break-all mt-1 inline-block" href="{{ bookmarkedUrl }}">
|
<a class="u-bookmark-of text-xs text-surface-600 dark:text-surface-400 hover:underline break-all mt-1 inline-block" href="{{ bookmarkedUrl }}">
|
||||||
{{ bookmarkedUrl }}
|
{{ bookmarkedUrl }}
|
||||||
</a>
|
</a>
|
||||||
@@ -151,7 +156,7 @@
|
|||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% unfurl repostedUrl %}
|
{{ repostedUrl | unfurlCard | safe }}
|
||||||
<a class="u-repost-of text-xs text-surface-600 dark:text-surface-400 hover:underline break-all mt-1 inline-block" href="{{ repostedUrl }}">
|
<a class="u-repost-of text-xs text-surface-600 dark:text-surface-400 hover:underline break-all mt-1 inline-block" href="{{ repostedUrl }}">
|
||||||
{{ repostedUrl }}
|
{{ repostedUrl }}
|
||||||
</a>
|
</a>
|
||||||
@@ -190,7 +195,7 @@
|
|||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% unfurl replyToUrl %}
|
{{ replyToUrl | unfurlCard | safe }}
|
||||||
<a class="u-in-reply-to text-xs text-surface-600 dark:text-surface-400 hover:underline break-all mt-1 inline-block" href="{{ replyToUrl }}">
|
<a class="u-in-reply-to text-xs text-surface-600 dark:text-surface-400 hover:underline break-all mt-1 inline-block" href="{{ replyToUrl }}">
|
||||||
{{ replyToUrl }}
|
{{ replyToUrl }}
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user