automated featured blog display

This commit is contained in:
timurgordon
2022-02-22 22:40:15 +03:00
parent 267a0fb061
commit 228c93b9c1
9 changed files with 75 additions and 44 deletions

View File

@@ -3,16 +3,25 @@
<div class="lg:pt-24 flex flex-col mb-12 mr-24">
<h4 class="text-base not-italic font-medium leading-6 text-gray-600 mb-6"> FILTER POSTS BY</h4>
<a class="mb-3" href="/blog">All</a>
<a class="mb-3" href="/categories/engineering">Engineering</a>
<a class="mb-3" href="/categories/community">Community</a>
<a class="mb-3" href="/categories/use-cases">Use Cases</a>
{% set taxonomy = get_taxonomy(kind="categories") %}
{% set categories = taxonomy.items %}
{% for category in categories %}
{% set path = category.name | slugify %}
{% set fullpath = "/categories/" ~ path %}
<a class="mb-3" href={{fullpath}}> {{category.name}} </a>
{% endfor %}
</div>
{% set section = get_section(path="blog/_index.md")%}
<div class="lg:pt-6 flex flex-col mb-12 w-64 mr-24">
<h4 class="text-base not-italic font-medium leading-6 text-gray-600 mb-6"> POPULAR POSTS</h4>
<a class="mb-3 text-blue-700" href="">NEAR Launches Nightshade Sharding, Paving the Way for Mass Adoption</a>
<a class="mb-3" href="/categories/engineering">Engineering</a>
<a class="mb-3" href="/categories/community">Community</a>
<a class="mb-3" href="">Use Cases</a>
<h4 class="text-base not-italic font-medium leading-6 text-gray-600 mb-6"> FEATURED POSTS</h4>
{% for page in section.pages %}
{% if page.extra.isFeatured %}
<a class="mb-3 text-blue-700" href={{page.permalink}}>{{ page.title }}</a>
{% endif %}
{% endfor %}
</div>
</div>

View File

@@ -2,20 +2,22 @@
<div class="relative mt-12 lg:mt-16 lg:grid lg:grid-cols-2 lg:gap-8 lg:items-center">
<div class="relative mx-24">
<h3 class="text-base not-italic leading-6 text-gray-600">FEATURED POST</h3>
<h1 class="text-5xl fw-500 leading-snug font-normal mb-10">
{{ section.title }}
</h1>
<h3 class="text-base not-italic leading-6 text-gray-600">FEATURED POST</h3>
<a href={{featured.permalink}} class="">
<h1 class="text-5xl fw-500 leading-snug font-normal mb-10">
{{ featured.title }}
</h1>
</a>
<h4 class="text-sm not-italic font-light leading-6 text-gray-600">
{{ section.extra.date | date(format="%B %e, %Y", timezone="America/Chicago")}} -
{{ section.extra.author }}
{{ featured.date | date(format="%B %e, %Y", timezone="America/Chicago")}} -
{{ featured.extra.author }}
</h4>
</div>
<div class="mt-10 -mx-4 relative lg:mt-0 max-w-full">
<img class="relative mx-auto max-w-full max-h-80" src=/{{section.extra.imgPath}} alt="" />
<img class="relative mx-auto max-w-full max-h-80" src=/{{featured.extra.imgPath}} alt="" />
</div>
</div>