feat: more performant popular posts
This commit is contained in:
parent
7e3503fbb4
commit
3ef783fd18
11 changed files with 28 additions and 32 deletions
|
@ -1,6 +1,6 @@
|
|||
<div class="addon-links">
|
||||
{%- if analytics.size > 0 -%}
|
||||
<div>{% render "partials/widgets/popular-posts.liquid", posts:posts, analytics:analytics %}</div>
|
||||
{%- if popularPosts.size > 0 -%}
|
||||
<div>{% render "partials/widgets/popular-posts.liquid", popularPosts:popularPosts %}</div>
|
||||
{%- endif -%}
|
||||
{%- if links.size > 0 -%}
|
||||
<div>{% render "partials/widgets/recent-links.liquid", links:links %}</div>
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
{% assign postData = posts | getPopularPosts: analytics %}
|
||||
{% if postData.size > 0 %}
|
||||
{% if popularPosts.size > 0 %}
|
||||
<h2 class="link-list-header flex-centered">
|
||||
{% tablericon "flame" "Popular" %}
|
||||
Popular posts
|
||||
</h2>
|
||||
<ul class="link-list">
|
||||
{% for post in postData limit: 5 %}
|
||||
{% for post in popularPosts limit: 5 %}
|
||||
<li>
|
||||
<a class="no-underline" href="{{ post.slug }}" title="{{ post.title | escape}}">
|
||||
{{ post.title }}
|
||||
|
|
Reference in a new issue