feat: update templates

This commit is contained in:
2024-08-13 13:55:11 +09:00
parent 3b2a99daa8
commit c14db6ba74
2 changed files with 91 additions and 158 deletions

View File

@@ -1,5 +1,5 @@
---
layout: page
layout: default
refactor: true
panel_includes:
- toc
@@ -11,98 +11,117 @@ tail_includes:
{% include lang.html %}
<header>
<h1 data-toc-skip>{{ page.title }}</h1>
<article class="px-1">
<header>
<h1 data-toc-skip>{{ page.title }}</h1>
{% if page.description %}
<p class="post-desc fw-light mb-4">{{ page.description }}</p>
{% endif %}
<div class="post-meta text-muted">
<!-- published date -->
<span>
{{ site.data.locales[lang].post.posted }}
{% include datetime.html date=page.date tooltip=true lang=lang %}
</span>
<div class="d-flex justify-content-between">
<!-- author(s) -->
<div class="post-meta text-muted">
<!-- published date -->
<span>
{% if page.author %}
{% assign authors = page.author %}
{% elsif page.authors %}
{% assign authors = page.authors %}
{% endif %}
{{ site.data.locales[lang].post.written_by }}
<em>
{% if authors %}
{% for author in authors %}
<a href="{{ site.data.authors[author].url }}">{{ site.data.authors[author].name }}</a>
{% unless forloop.last %}{{ '</em>, <em>' }}{% endunless %}
{% endfor %}
{% else %}
<a href="{{ site.social.links[0] }}">{{ site.social.name }}</a>
{% endif %}
</em>
{{ site.data.locales[lang].post.posted }} {% include datetime.html
date=page.date tooltip=true lang=lang %}
</span>
<!-- read time -->
{% include read-time.html content=content prompt=true lang=lang %}
<!-- lastmod date -->
{% if page.last_modified_at and page.last_modified_at != page.date %}
<span>
{{ site.data.locales[lang].post.updated }} {% include datetime.html
date=page.last_modified_at tooltip=true lang=lang %}
</span>
{% endif %}
<div class="d-flex justify-content-between">
<!-- author(s) -->
<span>
{% if page.author %} {% assign authors = page.author %} {% elsif
page.authors %} {% assign authors = page.authors %} {% endif %} {{
site.data.locales[lang].post.written_by }}
<em>
{% if authors %} {% for author in authors %} {% if
site.data.authors[author].url -%}
<a href="{{ site.data.authors[author].url }}"
>{{ site.data.authors[author].name }}</a
>
{%- else -%} {{ site.data.authors[author].name }} {%- endif %} {%
unless forloop.last %}{{ '</em
>,
<em
>' }}{% endunless %} {% endfor %} {% else %}
<a href="{{ site.social.links[0] }}">{{ site.social.name }}</a>
{% endif %}
</em>
</span>
<div>
<!-- pageviews -->
{% if site.pageviews.provider and
site.analytics[site.pageviews.provider].id %}
<span>
<em id="pageviews">
<i class="fas fa-spinner fa-spin small"></i>
</em>
{{ site.data.locales[lang].post.pageview_measure }}
</span>
{% endif %}
<!-- read time -->
{% include read-time.html content=content prompt=true lang=lang %}
</div>
</div>
</div>
<!-- .d-flex -->
</div>
<!-- .post-meta -->
</header>
</header>
<div class="content">
{{ content }}
</div>
<div class="content">{{ content }}</div>
<div class="post-tail-wrapper text-muted">
<!-- categories -->
{% if page.categories.size > 0 %}
<div class="post-tail-wrapper text-muted">
<!-- categories -->
{% if page.categories.size > 0 %}
<div class="post-meta mb-3">
<i class="far fa-folder-open fa-fw me-1"></i>
{% for category in page.categories %}
<a href="{{ site.baseurl }}/categories/{{ category | slugify | url_encode }}/">{{ category }}</a>
{%- unless forloop.last -%},{%- endunless -%}
{% endfor %}
<a
href="{{ site.baseurl }}/categories/{{ category | slugify | url_encode }}/"
>{{ category }}</a
>
{%- unless forloop.last -%},{%- endunless -%} {% endfor %}
</div>
{% endif %}
{% endif %}
<!-- tags -->
{% if page.tags.size > 0 %}
<!-- tags -->
{% if page.tags.size > 0 %}
<div class="post-tags">
<i class="fa fa-tags fa-fw me-1"></i>
{% for tag in page.tags %}
<a
href="{{ site.baseurl }}/tags/{{ tag | slugify | url_encode }}/"
class="post-tag no-text-decoration"
>
{{- tag -}}
</a>
<a
href="{{ site.baseurl }}/tags/{{ tag | slugify | url_encode }}/"
class="post-tag no-text-decoration"
>
{{- tag -}}
</a>
{% endfor %}
</div>
{% endif %}
{% endif %}
<div
class="
post-tail-bottom
d-flex justify-content-between align-items-center mt-5 pb-2
"
>
<div class="license-wrapper">
{% if site.data.locales[lang].copyright.license.template %}
{% capture _replacement %}
<div
class="post-tail-bottom d-flex justify-content-between align-items-center mt-5 pb-2"
>
<div class="license-wrapper">
{% if site.data.locales[lang].copyright.license.template %} {% capture
_replacement %}
<a href="{{ site.data.locales[lang].copyright.license.link }}">
{{ site.data.locales[lang].copyright.license.name }}
</a>
{% endcapture %}
{% endcapture %} {{ site.data.locales[lang].copyright.license.template |
replace: ':LICENSE_NAME', _replacement }} {% endif %}
</div>
{{ site.data.locales[lang].copyright.license.template | replace: ':LICENSE_NAME', _replacement }}
{% endif %}
{% include post-sharing.html lang=lang %}
</div>
{% include post-sharing.html lang=lang %}
<!-- .post-tail-bottom -->
</div>
<!-- .post-tail-bottom -->
</div>
<!-- div.post-tail-wrapper -->
<!-- div.post-tail-wrapper -->
</article>