chore: add recent links widget

This commit is contained in:
Cory Dransfeldt 2024-03-13 16:18:47 -07:00
parent 7443d797a9
commit 56f28f7e3f
No known key found for this signature in database
22 changed files with 91 additions and 62 deletions

View file

@ -0,0 +1,8 @@
{% capture css %}
{% render "../../assets/styles/components/addon-links.css" %}
{% endcapture %}
<style>{{ css }}</style>
<div class="addon-links__wrapper">
<div>{% render "partials/popular-posts.liquid", posts:posts, analytics:analytics %}</div>
<div>{% render "partials/recent-links.liquid", links:links %}</div>
</div>

View file

@ -1,5 +1,5 @@
{% if albumReleases.size > 0 %}
<h2 id="album-releases" class="now__section--header flex--centered">
<h2 id="album-releases" class="flex--centered">
{% tablericon "calendar-time" "Anticipated albums" %}
Anticipated albums
</h2>

View file

@ -1,15 +0,0 @@
{% if links.size > 0 %}
<h2 id="links" class="now__section--header flex--centered">
{% tablericon "link" "Links" %}
Links
</h2>
<ul class="link__list">
{% for link in links limit: 5 %}
<li>
<a href="{{link.url}}" title="{{link.title | escape}}">
{{ link.title }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}

View file

@ -7,7 +7,7 @@
<style>{{ css }}</style>
{% endif %}
{% assign media = data | normalizeMedia %}
<h2 id="{{ title | downcase }}" class="now__section--header flex--centered">
<h2 id="{{ title | downcase }}" class="flex--centered">
{% tablericon icon title %}
{{ title }}
</h2>

View file

@ -1,20 +1,14 @@
{% capture css %}
{% render "../../assets/styles/components/popular-posts.css" %}
{% endcapture %}
<style>{{ css }}</style>
{% assign posts = posts | getPopularPosts: analytics %}
<div class="popular-posts">
<h2 class="flex--centered">
{% tablericon "flame" "Popular" %}
Popular posts
</h2>
<ul class="link__list">
{% for post in posts limit: 5 %}
<li>
<a class="no-underline" href="{{post.url}}" title="{{ post.data.title | escape}}">
{{ post.data.title }}
</a>
</li>
{% endfor %}
</ul>
</div>
<h2 class="flex--centered">
{% tablericon "flame" "Popular" %}
Popular posts
</h2>
<ul class="link__list">
{% for post in posts limit: 5 %}
<li>
<a class="no-underline" href="{{post.url}}" title="{{ post.data.title | escape}}">
{{ post.data.title }}
</a>
</li>
{% endfor %}
</ul>

View file

@ -0,0 +1,15 @@
{% if links.size > 0 %}
<h2 id="links" class="flex--centered">
{% tablericon "link" "Links" %}
Recent links
</h2>
<ul class="link__list">
{% for link in links limit: 5 %}
<li>
<a href="{{link.url}}" title="{{link.title | escape}}">
{{ link.title }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}

View file

@ -1,4 +1,6 @@
{% assign filteredTags = tags | filterTags %}
{% for tag in filteredTags limit: 10 %}
<div{% if hasSpace %} style="margin-bottom:var(--sizing-md)"{% endif %}>
{% for tag in filteredTags limit: 10 %}
<a class="tag" href="/tags/{{ tag | downcase }}" data-pagefind-filter="tags">{{ tag | formatTag }}</a>
{% endfor %}
{% endfor %}
</div>