enhance blog to work well at small screen

This commit is contained in:
2024-03-13 11:51:53 +02:00
parent 02c40e26e6
commit 398e8bf92d
3 changed files with 21 additions and 18 deletions

View File

@@ -1,8 +1,8 @@
{% block content %} {% block content %}
<div class="text-center main-title px-0 md:w-2/3 lg:w-2/3 mx-8 md:mx-12"> <div class="text-center main-title px-0 md:w-2/3 mx-8 md:mx-12">
<h1 <h2
class="tracking-tight text-left text-2xl md:text-4xl lg:text-5xl fw-500 leading-snug font-normal mb-10" class="tracking-tight text-left text-2xl md:text-4xl fw-500 leading-snug font-medium"
> >
{% set path_array = current_path | split(pat="/") %} {% set path_array = current_path | split(pat="/") %}
{% set taxonomy = path_array[1] %} {% set taxonomy = path_array[1] %}
@@ -11,9 +11,9 @@
{% if taxonomy == "categories" %} - {% if taxonomy == "categories" %} -
{{category | replace(from='-', to=' ' ) | title}} {{category | replace(from='-', to=' ' ) | title}}
{% endif %} {% endif %}
</h1> </h2>
<div> <div>
<div class="mt-12 grid gap-5 max-w-lg mx-auto lg:grid-cols-2 xl:grid-cols-3 lg:max-w-none"> <div class="mt-3 grid gap-5 max-w-lg mx-auto md:grid-cols-2 lg:grid-cols-3 lg:max-w-none">
{%- for post in paginator.pages %} {%- for post in paginator.pages %}
{% if not post.extra.hidden %} {% if not post.extra.hidden %}
{% include "partials/postCard.html" %} {% include "partials/postCard.html" %}

View File

@@ -1,14 +1,14 @@
<div class="mx-8 md:mx-4 flex flex-col"> <div class="mx-8 md:mx-4 flex flex-col mt-2 md:mt-8">
<div class="flex flex-col mb-12 mr-8 lg:mr-24"> <div class="flex flex-col mb-12">
<h4 class="text-base not-italic font-medium leading-6 text-gray-600 mb-6"> FILTER POSTS BY</h4> <h4 class="text-base not-italic font-medium leading-6 text-gray-600 mb-4"> FILTER POSTS BY</h4>
<a id="all" class="mb-3 text-black font-normal" href="/blog">All</a> <a id="all" class="mb-2 text-black font-normal" href="/blog">All</a>
{% set taxonomy = get_taxonomy(kind="categories") %} {% set taxonomy = get_taxonomy(kind="categories") %}
{% set categories = taxonomy.items %} {% set categories = taxonomy.items %}
{% for category in categories %} {% for category in categories %}
{% set path = category.name | slugify %} {% set path = category.name | slugify %}
{% set fullpath = "/categories/" ~ path %} {% set fullpath = "/categories/" ~ path %}
<a id="{{path}}" class="mb-3 text-black font-normal" href={{fullpath}}> {{category.name}} </a> <a id="{{path}}" class="mb-2 text-black font-normal" href={{fullpath}}> {{category.name}} </a>
{% endfor %} {% endfor %}
</div> </div>

View File

@@ -9,27 +9,30 @@
<body> <body>
<div class="md:grid md:grid-cols-2 md:gap-8 relative mt-16 lg:mt-16 items-center container mx-auto"> <div class="md:grid md:grid-cols-2 md:gap-8 relative mt-12 md:mt-10 items-center container mx-auto">
<div class="relative lg:ml-8 my-8 w-full md:w-auto"> <div class="relative my-8 w-full md:w-auto mx-3 lg:mx-12">
<h3 class="text-base not-italic leading-6 text-gray-600">FEATURED POST</h3> <h3 class="text-base not-italic font-medium leading-6 text-gray-600 mb-4">FEATURED POST</h3>
<a href={{featured.permalink}} class=""> <a href={{featured.permalink}} class="">
<h2 <h2
class="mt-8 text-2xl main-title sm:text-3xl md:text-4xl lg:text-5xl fw-500 leading-snug font-normal mb-4 md:mb-10 "> class="text-2xl main-title md:text-4xl fw-500 leading-snug font-medium">
{{ featured.title }} {{ featured.title }}
</h2> </h2>
<p class="mt-2 text-base font-normal text-gray-500 text-left">
{{ featured.description }}
</p>
</a> </a>
<h4 class="text-sm not-italic font-light leading-6 text-gray-600"> <h4 class="my-2 text-sm not-italic font-light leading-6 text-gray-600">
{{ featured.date | date(format="%B %e, %Y", timezone="America/Chicago")}} - {{ featured.date | date(format="%B %e, %Y", timezone="America/Chicago")}} -
</h4> </h4>
</div> </div>
<div class="mx-4 relative lg:mt-0 max-w-full"> <div class="relative lg:mt-0 max-w-full">
<img class="relative mx-auto md:w-auto rounded md:max-w-full max-h-80" src={{featured.permalink}}{{featured.extra.imgPath}} alt="" /> <img class="relative rounded mx-auto max-h-64 p-2 border-2 border-gray-100" src={{featured.permalink}}{{featured.extra.imgPath}} alt="" />
</div> </div>
</div> </div>
<hr class="mt-6"> <hr class="mt-6 max-w-7xl mx-auto">
</div> </div>
</div> </div>