chore: add recent links widget
This commit is contained in:
parent
7443d797a9
commit
56f28f7e3f
22 changed files with 91 additions and 62 deletions
8
src/_includes/partials/addon-links.liquid
Normal file
8
src/_includes/partials/addon-links.liquid
Normal 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>
|
|
@ -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>
|
||||
|
|
|
@ -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 %}
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
15
src/_includes/partials/recent-links.liquid
Normal file
15
src/_includes/partials/recent-links.liquid
Normal 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 %}
|
|
@ -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>
|
Reference in a new issue