💄 style: redesign post listing and other minor changes
This commit is contained in:
@@ -1,38 +1,55 @@
|
||||
{% macro list_posts(pages) %}
|
||||
{% macro list_posts(posts, max) %}
|
||||
|
||||
<div class="bloglist-container">
|
||||
{% for page in pages %}
|
||||
<section class="bloglist-table-row">
|
||||
<div class="bloglist-title">
|
||||
<a href="{{ page.permalink }}">{{ page.title }}</a>
|
||||
</div>
|
||||
|
||||
<div class="card-meta">
|
||||
{% if page.date %}
|
||||
{{ macros_format_date::format_date(date=page.date) }}
|
||||
{% endif %}
|
||||
|
||||
<br/>
|
||||
<span>{{ page.reading_time }} min read</span>
|
||||
{% if page.draft %}
|
||||
<span class="draft-label">DRAFT</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div class="description">
|
||||
{% if page.description %}
|
||||
{{ page.description }}
|
||||
{% elif page.summary %}
|
||||
{{ page.summary | safe }}…
|
||||
{% for post in posts %}
|
||||
{% if loop.index <= max %}
|
||||
{% if loop.index == max %}
|
||||
<section class="bloglist-row">
|
||||
{% elif loop.last %}
|
||||
<section class="bloglist-row">
|
||||
{% else %}
|
||||
{% set hide_read_more = true %}
|
||||
<section class="bloglist-row bottom-divider">
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if not hide_read_more %}
|
||||
<a class="readmore" href={{ page.permalink }}>Read more ⟶</a>
|
||||
{% if post.date %}
|
||||
<div class="date">
|
||||
{{ macros_format_date::format_date(date=post.date) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="bloglist-content">
|
||||
<div class="bloglist-title">
|
||||
<a href="{{ post.permalink }}">{{ post.title }}</a>
|
||||
</div>
|
||||
|
||||
{% if post.taxonomies.tags %}
|
||||
<div class="bloglist-tags">
|
||||
{% for tag in post.taxonomies.tags %}
|
||||
<a class="tag" href="{{ get_taxonomy_url(kind="tags", name=tag) }}">{{ tag }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="description">
|
||||
{% if post.description %}
|
||||
{{ post.description }}
|
||||
{% elif post.summary %}
|
||||
{{ post.summary | safe }}…
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<a class="readmore" href={{ post.permalink }}>Read more →</a>
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
{% if not loop.last %}
|
||||
{% if loop.index == max %}
|
||||
<div class="all-posts">
|
||||
<a href="{{ get_url(path="/blog/") }}">All posts ⟶</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% endmacro %}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
{% macro page_header(title) %}
|
||||
<div class="title-container section-title">
|
||||
<div class="title-container section-title bottom-divider">
|
||||
{{ title }}
|
||||
</div>
|
||||
{% endmacro page_header %}
|
||||
|
@@ -3,7 +3,7 @@
|
||||
<nav class="socials nav-navs">
|
||||
{%- if config.extra.socials %}
|
||||
{% for social in config.extra.socials %}
|
||||
<a rel="noopener noreferrer" target="_blank" class="nav-links social" href={{ social.url | safe | replace(from="$BASE_URL", to=config.base_url) }}>
|
||||
<a rel="noopener noreferrer" target="_blank" class="nav-links no-hover-padding social" href={{ social.url | safe | replace(from="$BASE_URL", to=config.base_url) }}>
|
||||
<img alt={{ social.name }} title={{ social.name }} src="{{config.base_url}}/social_icons/{{ social.icon }}.svg">
|
||||
</a>
|
||||
{% endfor %}
|
||||
|
@@ -1,26 +1,26 @@
|
||||
<header>
|
||||
<nav class="navbar">
|
||||
<div class="nav-title">
|
||||
<a class="home-title" href={{ config.base_url }}>{{ config.title }}</a>
|
||||
</div>
|
||||
<nav class="navbar">
|
||||
<div class="nav-title">
|
||||
<a class="home-title" href={{ config.base_url }}>{{ config.title }}</a>
|
||||
</div>
|
||||
|
||||
{%- if config.extra.menu %}
|
||||
<div class="nav-navs">
|
||||
<div>
|
||||
{% for menu in config.extra.menu %}
|
||||
<a class="nav-links" href={{ menu.url | safe | replace(from="$BASE_URL" , to=config.base_url) }}>{{ menu.name
|
||||
}}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<label class="theme-switcher" for="themeswitch">
|
||||
<input type="checkbox" id="themeswitch">
|
||||
<div class="switch">
|
||||
<img alt="set dark theme" class="moon" src="{{ config.base_url }}/menu_icon/moon.svg">
|
||||
<img alt="set light theme" class="sun" src="{{ config.base_url }}/menu_icon/sun.svg">
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
{%- if config.extra.menu %}
|
||||
<div class="nav-navs">
|
||||
<div>
|
||||
{% for menu in config.extra.menu %}
|
||||
<a class="nav-links no-hover-padding" href={{ menu.url | safe | replace(from="$BASE_URL" , to=config.base_url) }}>{{ menu.name
|
||||
}}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<label class="theme-switcher" for="themeswitch">
|
||||
<input type="checkbox" id="themeswitch">
|
||||
<div class="switch">
|
||||
<img alt="set dark theme" class="moon" src="{{ config.base_url }}/menu_icon/moon.svg">
|
||||
<img alt="set light theme" class="sun" src="{{ config.base_url }}/menu_icon/sun.svg">
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</nav>
|
||||
</header>
|
||||
</nav>
|
||||
</header>
|
||||
|
Reference in New Issue
Block a user