feat: restore link widgets

This commit is contained in:
Cory Dransfeldt 2024-10-28 13:36:39 -07:00
parent d813bd505f
commit 5911b30917
No known key found for this signature in database
18 changed files with 319 additions and 17 deletions

View file

@ -0,0 +1,9 @@
<div class="addon-links">
{%- if popularPosts.size > 0 -%}
{% render "blocks/popular-posts.liquid", popularPosts:popularPosts %}
{%- endif -%}
{%- if links.size > 0 -%}
{% render "blocks/recent-links.liquid", links:links %}
{%- endif -%}
</div>

View file

@ -14,5 +14,7 @@
{{ block.text | markdown }}
{%- when 'divider' -%}
{{ block.markup | markdown }}
{%- when 'addon_links' -%}
{% render "blocks/addon-links.liquid", popularPosts:collections.popularPosts, links:links %}
{%- endcase -%}
{%- endfor -%}

View file

@ -0,0 +1,15 @@
{%- if popularPosts.size > 0 -%}
<article>
<h3 class="article">
{% tablericon "chart-bar-popular" "Popular" %}
Popular posts
</h3>
<ol type="1">
{%- for post in popularPosts limit: 5 -%}
<li>
<a href="{{ post.url }}">{{ post.title }}</a>
</li>
{%- endfor -%}
</ol>
</article>
{%- endif -%}

View file

@ -0,0 +1,18 @@
{%- if links.size > 0 -%}
<article>
<h3 class="link">
{% tablericon "link" "Links" %}
Recent links
</h3>
<ul>
{%- for link in links limit: 5 -%}
<li>
<a href="{{ link.link }}" title="{{ link.title | escape }}">
{{ link.title }}
</a>
{% if link.author %} via <a href="{{ link.author.url }}">{{ link.author.name }}</a>{% endif %}
</li>
{%- endfor -%}
</ul>
</article>
{%- endif -%}