💄 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) %}
|
||||
<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>
|
||||
{% macro list_posts(posts, max) %}
|
||||
|
||||
<div class="card-meta">
|
||||
{% if page.date %}
|
||||
{{ macros_format_date::format_date(date=page.date) }}
|
||||
<div class="bloglist-container">
|
||||
{% for post in posts %}
|
||||
{% 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 %}
|
||||
|
||||
<br/>
|
||||
<span>{{ page.reading_time }} min read</span>
|
||||
{% if page.draft %}
|
||||
<span class="draft-label">DRAFT</span>
|
||||
{% if post.date %}
|
||||
<div class="date">
|
||||
{{ macros_format_date::format_date(date=post.date) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div class="description">
|
||||
{% if page.description %}
|
||||
{{ page.description }}
|
||||
{% elif page.summary %}
|
||||
{{ page.summary | safe }}…
|
||||
{% else %}
|
||||
{% set hide_read_more = true %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="bloglist-content">
|
||||
<div class="bloglist-title">
|
||||
<a href="{{ post.permalink }}">{{ post.title }}</a>
|
||||
</div>
|
||||
|
||||
{% if not hide_read_more %}
|
||||
<a class="readmore" href={{ page.permalink }}>Read more ⟶</a>
|
||||
{% 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 %}
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue