💄 style: redesign post listing and other minor changes
parent
14156b590a
commit
cd2ab356be
@ -0,0 +1,79 @@
|
|||||||
|
.bloglist-container {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bloglist-row {
|
||||||
|
background-color: var(--navbar-color);
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
padding: 2.5rem 0;
|
||||||
|
|
||||||
|
.date {
|
||||||
|
font-size: 0.85rem;
|
||||||
|
font-weight: 300;
|
||||||
|
color: var(--meta-color);
|
||||||
|
width: 14.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bloglist-tags {
|
||||||
|
margin-top: -0.5rem;
|
||||||
|
|
||||||
|
.tag {
|
||||||
|
margin-right: 0.7rem;
|
||||||
|
font-size: 0.7rem;
|
||||||
|
font-weight: 400;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bloglist-content {
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
|
||||||
|
.bloglist-title {
|
||||||
|
font-size: 1.2em;
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: var(--text-color-high-contrast);
|
||||||
|
font-weight: 550;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: var(--hover-color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.description {
|
||||||
|
margin: 0.5rem 0 1rem;
|
||||||
|
color: var(--text-color);
|
||||||
|
font-family: var(--sans-serif-font);
|
||||||
|
font-size: 0.9rem;
|
||||||
|
font-weight: 250;
|
||||||
|
line-height: 1.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.all-posts {
|
||||||
|
font-size: 1.3rem;
|
||||||
|
font-weight: 350;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 1100px) {
|
||||||
|
.bloglist-row {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
padding: 2rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date {
|
||||||
|
margin-bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bloglist-content {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
@ -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">
|
<div class="bloglist-container">
|
||||||
{% if page.date %}
|
{% for post in posts %}
|
||||||
{{ macros_format_date::format_date(date=page.date) }}
|
{% if loop.index <= max %}
|
||||||
|
{% if loop.index == max %}
|
||||||
|
<section class="bloglist-row">
|
||||||
|
{% elif loop.last %}
|
||||||
|
<section class="bloglist-row">
|
||||||
|
{% else %}
|
||||||
|
<section class="bloglist-row bottom-divider">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<br/>
|
{% if post.date %}
|
||||||
<span>{{ page.reading_time }} min read</span>
|
<div class="date">
|
||||||
{% if page.draft %}
|
{{ macros_format_date::format_date(date=post.date) }}
|
||||||
<span class="draft-label">DRAFT</span>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
|
||||||
|
|
||||||
<br/>
|
<div class="bloglist-content">
|
||||||
<div class="description">
|
<div class="bloglist-title">
|
||||||
{% if page.description %}
|
<a href="{{ post.permalink }}">{{ post.title }}</a>
|
||||||
{{ page.description }}
|
</div>
|
||||||
{% elif page.summary %}
|
|
||||||
{{ page.summary | safe }}…
|
|
||||||
{% else %}
|
|
||||||
{% set hide_read_more = true %}
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% if not hide_read_more %}
|
{% if post.taxonomies.tags %}
|
||||||
<a class="readmore" href={{ page.permalink }}>Read more ⟶</a>
|
<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 %}
|
{% endif %}
|
||||||
</section>
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{% macro page_header(title) %}
|
{% macro page_header(title) %}
|
||||||
<div class="title-container section-title">
|
<div class="title-container section-title bottom-divider">
|
||||||
{{ title }}
|
{{ title }}
|
||||||
</div>
|
</div>
|
||||||
{% endmacro page_header %}
|
{% endmacro page_header %}
|
||||||
|
@ -1,26 +1,26 @@
|
|||||||
<header>
|
<header>
|
||||||
<nav class="navbar">
|
<nav class="navbar">
|
||||||
<div class="nav-title">
|
<div class="nav-title">
|
||||||
<a class="home-title" href={{ config.base_url }}>{{ config.title }}</a>
|
<a class="home-title" href={{ config.base_url }}>{{ config.title }}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{%- if config.extra.menu %}
|
{%- if config.extra.menu %}
|
||||||
<div class="nav-navs">
|
<div class="nav-navs">
|
||||||
<div>
|
<div>
|
||||||
{% for menu in config.extra.menu %}
|
{% 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 class="nav-links no-hover-padding" href={{ menu.url | safe | replace(from="$BASE_URL" , to=config.base_url) }}>{{ menu.name
|
||||||
}}</a>
|
}}</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
<label class="theme-switcher" for="themeswitch">
|
<label class="theme-switcher" for="themeswitch">
|
||||||
<input type="checkbox" id="themeswitch">
|
<input type="checkbox" id="themeswitch">
|
||||||
<div class="switch">
|
<div class="switch">
|
||||||
<img alt="set dark theme" class="moon" src="{{ config.base_url }}/menu_icon/moon.svg">
|
<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">
|
<img alt="set light theme" class="sun" src="{{ config.base_url }}/menu_icon/sun.svg">
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
Loading…
Reference in New Issue