2019-09-30 15:38:41 +03:00
|
|
|
---
|
|
|
|
layout: page
|
2023-03-18 01:28:44 +03:00
|
|
|
refactor: true
|
2019-09-30 15:38:41 +03:00
|
|
|
---
|
|
|
|
|
2023-05-06 02:22:29 +03:00
|
|
|
{% include lang.html %}
|
|
|
|
|
2023-03-17 19:31:52 +03:00
|
|
|
{% assign pinned = site.posts | where: 'pin', 'true' %}
|
|
|
|
{% assign default = site.posts | where_exp: 'item', 'item.pin != true and item.hidden != true' %}
|
2020-06-06 07:45:33 +03:00
|
|
|
|
2023-03-17 19:31:52 +03:00
|
|
|
{% assign posts = '' | split: '' %}
|
2020-06-06 07:45:33 +03:00
|
|
|
|
|
|
|
<!-- Get pinned posts -->
|
|
|
|
|
|
|
|
{% assign offset = paginator.page | minus: 1 | times: paginator.per_page %}
|
|
|
|
{% assign pinned_num = pinned.size | minus: offset %}
|
|
|
|
|
|
|
|
{% if pinned_num > 0 %}
|
|
|
|
{% for i in (offset..pinned.size) limit: pinned_num %}
|
|
|
|
{% assign posts = posts | push: pinned[i] %}
|
|
|
|
{% endfor %}
|
|
|
|
{% else %}
|
|
|
|
{% assign pinned_num = 0 %}
|
|
|
|
{% endif %}
|
|
|
|
|
2020-06-08 16:44:59 +03:00
|
|
|
<!-- Get default posts -->
|
2020-06-06 07:45:33 +03:00
|
|
|
|
|
|
|
{% assign default_beg = offset | minus: pinned.size %}
|
|
|
|
|
|
|
|
{% if default_beg < 0 %}
|
|
|
|
{% assign default_beg = 0 %}
|
|
|
|
{% endif %}
|
|
|
|
|
2023-03-17 19:31:52 +03:00
|
|
|
{% assign default_num = paginator.posts | size | minus: pinned_num %}
|
2020-06-06 07:45:33 +03:00
|
|
|
{% assign default_end = default_beg | plus: default_num | minus: 1 %}
|
|
|
|
|
|
|
|
{% if default_num > 0 %}
|
|
|
|
{% for i in (default_beg..default_end) %}
|
|
|
|
{% assign posts = posts | push: default[i] %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
|
2019-09-30 15:38:41 +03:00
|
|
|
<div id="post-list">
|
2023-03-17 19:31:52 +03:00
|
|
|
{% for post in posts %}
|
2023-03-18 01:28:44 +03:00
|
|
|
<a href="{{ post.url | relative_url }}" class="card-wrapper">
|
2023-03-21 02:20:32 +03:00
|
|
|
<div class="card post-preview flex-md-row-reverse">
|
2023-03-18 01:28:44 +03:00
|
|
|
{% if post.image %}
|
|
|
|
{% if post.image.lqip %}
|
|
|
|
{% capture lqip %}lqip="{{ post.image.lqip }}"{% endcapture %}
|
|
|
|
{% endif %}
|
|
|
|
<img src="{{ post.image.path | default: post.image }}" w="15" h="8" {{ lqip }}>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<div class="card-body d-flex flex-column">
|
2023-03-17 19:31:52 +03:00
|
|
|
<h1 class="card-title">
|
|
|
|
{{ post.title }}
|
|
|
|
</h1>
|
|
|
|
|
|
|
|
<div class="card-text post-content">
|
|
|
|
<p>
|
|
|
|
{% include no-linenos.html content=post.content %}
|
|
|
|
{{ content | markdownify | strip_html | truncate: 200 | escape }}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
2023-03-18 01:28:44 +03:00
|
|
|
<div class="post-meta flex-grow-1 d-flex align-items-end">
|
2023-03-17 19:31:52 +03:00
|
|
|
<div class="mr-auto">
|
|
|
|
<!-- posted date -->
|
2023-03-18 01:28:44 +03:00
|
|
|
<i class="far fa-calendar fa-fw mr-1"></i>
|
2023-05-06 02:22:29 +03:00
|
|
|
{% include datetime.html date=post.date lang=lang %}
|
2023-03-17 19:31:52 +03:00
|
|
|
|
|
|
|
<!-- categories -->
|
|
|
|
{% if post.categories.size > 0 %}
|
2023-03-18 01:28:44 +03:00
|
|
|
<i class="far fa-folder-open fa-fw mr-1"></i>
|
|
|
|
<span class="categories">
|
2023-03-17 19:31:52 +03:00
|
|
|
{% for category in post.categories %}
|
|
|
|
{{ category }}
|
|
|
|
{%- unless forloop.last -%},{%- endunless -%}
|
|
|
|
{% endfor %}
|
|
|
|
</span>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% if post.pin %}
|
2023-03-18 01:28:44 +03:00
|
|
|
<div class="pin ml-1">
|
2023-03-17 19:31:52 +03:00
|
|
|
<i class="fas fa-thumbtack fa-fw"></i>
|
2023-05-06 02:22:29 +03:00
|
|
|
<span>{{ site.data.locales[lang].post.pin_prompt }}</span>
|
2023-03-17 19:31:52 +03:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
<!-- .post-meta -->
|
|
|
|
</div>
|
2023-03-18 01:28:44 +03:00
|
|
|
<!-- .card-body -->
|
|
|
|
</div>
|
|
|
|
</a>
|
2023-03-17 19:31:52 +03:00
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
<!-- #post-list -->
|
2019-09-30 15:38:41 +03:00
|
|
|
|
2023-03-18 01:28:44 +03:00
|
|
|
{% if paginator.total_pages > 1 %}
|
2020-02-22 02:09:09 +03:00
|
|
|
{% include post-paginator.html %}
|
2019-09-30 15:38:41 +03:00
|
|
|
{% endif %}
|