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,91 +1,5 @@
# The layout text of site
# ----- Commons label -----
layout:
post: Post
category: Category
tag: Tag
# The tabs of sidebar
tabs:
# format: <filename_without_extension>: <value>
home: Home
categories: Categories
tags: Tags
archives: Archives
about: About
# the text displayed in the search bar & search results
search:
hint: search
cancel: Cancel
no_results: Oops! No results found.
panel:
lastmod: Recently Updated
trending_tags: Trending Tags
toc: Contents
copyright: copyright:
# Shown at the bottom of the post
license:
template: This post is licensed under :LICENSE_NAME by the author.
name: CC BY 4.0
link: https://creativecommons.org/licenses/by/4.0/
# Displayed in the footer # Displayed in the footer
brief: All rights reserved. brief: All rights reserved.
verbose: >-
Except where otherwise noted, the blog posts on this site are licensed
under the Creative Commons Attribution 4.0 International (CC BY 4.0) License by the author.
meta: "" meta: ""
not_found:
statment: Sorry, we've misplaced that URL or it's pointing to something that doesn't exist.
notification:
update_found: A new version of content is available.
update: Update
# ----- Posts related labels -----
post:
written_by: By
posted: Posted
updated: Updated
words: words
pageview_measure: views
read_time:
unit: min
prompt: read
relate_posts: Further Reading
share: Share
button:
next: Newer
previous: Older
copy_code:
succeed: Copied!
share_link:
title: Copy link
succeed: Link copied successfully!
# Date time format.
# See: <http://strftime.net/>, <https://day.js.org/docs/en/display/format>
df:
post:
strftime: "%b %e, %Y"
dayjs: "ll"
archives:
strftime: "%b"
dayjs: "MMM"
# categories page
categories:
category_measure:
singular: category
plural: categories
post_measure:
singular: post
plural: posts

View File

@@ -1,5 +1,5 @@
--- ---
layout: page layout: default
refactor: true refactor: true
panel_includes: panel_includes:
- toc - toc
@@ -11,60 +11,83 @@ tail_includes:
{% include lang.html %} {% include lang.html %}
<header> <article class="px-1">
<header>
<h1 data-toc-skip>{{ page.title }}</h1> <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"> <div class="post-meta text-muted">
<!-- published date --> <!-- published date -->
<span> <span>
{{ site.data.locales[lang].post.posted }} {{ site.data.locales[lang].post.posted }} {% include datetime.html
{% include datetime.html date=page.date tooltip=true lang=lang %} date=page.date tooltip=true lang=lang %}
</span> </span>
<!-- 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"> <div class="d-flex justify-content-between">
<!-- author(s) --> <!-- author(s) -->
<span> <span>
{% if page.author %} {% if page.author %} {% assign authors = page.author %} {% elsif
{% assign authors = page.author %} page.authors %} {% assign authors = page.authors %} {% endif %} {{
{% elsif page.authors %} site.data.locales[lang].post.written_by }}
{% assign authors = page.authors %}
{% endif %}
{{ site.data.locales[lang].post.written_by }}
<em> <em>
{% if authors %} {% if authors %} {% for author in authors %} {% if
{% for author in authors %} site.data.authors[author].url -%}
<a href="{{ site.data.authors[author].url }}">{{ site.data.authors[author].name }}</a> <a href="{{ site.data.authors[author].url }}"
{% unless forloop.last %}{{ '</em>, <em>' }}{% endunless %} >{{ site.data.authors[author].name }}</a
{% endfor %} >
{% else %} {%- 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> <a href="{{ site.social.links[0] }}">{{ site.social.name }}</a>
{% endif %} {% endif %}
</em> </em>
</span> </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 --> <!-- read time -->
{% include read-time.html content=content prompt=true lang=lang %} {% include read-time.html content=content prompt=true lang=lang %}
</div> </div>
<!-- .d-flex -->
</div> </div>
<!-- .post-meta --> </div>
</header> </header>
<div class="content"> <div class="content">{{ content }}</div>
{{ content }}
</div>
<div class="post-tail-wrapper text-muted"> <div class="post-tail-wrapper text-muted">
<!-- categories --> <!-- categories -->
{% if page.categories.size > 0 %} {% if page.categories.size > 0 %}
<div class="post-meta mb-3"> <div class="post-meta mb-3">
<i class="far fa-folder-open fa-fw me-1"></i> <i class="far fa-folder-open fa-fw me-1"></i>
{% for category in page.categories %} {% for category in page.categories %}
<a href="{{ site.baseurl }}/categories/{{ category | slugify | url_encode }}/">{{ category }}</a> <a
{%- unless forloop.last -%},{%- endunless -%} href="{{ site.baseurl }}/categories/{{ category | slugify | url_encode }}/"
{% endfor %} >{{ category }}</a
>
{%- unless forloop.last -%},{%- endunless -%} {% endfor %}
</div> </div>
{% endif %} {% endif %}
@@ -84,25 +107,21 @@ tail_includes:
{% endif %} {% endif %}
<div <div
class=" class="post-tail-bottom d-flex justify-content-between align-items-center mt-5 pb-2"
post-tail-bottom
d-flex justify-content-between align-items-center mt-5 pb-2
"
> >
<div class="license-wrapper"> <div class="license-wrapper">
{% if site.data.locales[lang].copyright.license.template %} {% if site.data.locales[lang].copyright.license.template %} {% capture
{% capture _replacement %} _replacement %}
<a href="{{ site.data.locales[lang].copyright.license.link }}"> <a href="{{ site.data.locales[lang].copyright.license.link }}">
{{ site.data.locales[lang].copyright.license.name }} {{ site.data.locales[lang].copyright.license.name }}
</a> </a>
{% endcapture %} {% endcapture %} {{ site.data.locales[lang].copyright.license.template |
replace: ':LICENSE_NAME', _replacement }} {% endif %}
{{ site.data.locales[lang].copyright.license.template | replace: ':LICENSE_NAME', _replacement }}
{% endif %}
</div> </div>
{% include post-sharing.html lang=lang %} {% include post-sharing.html lang=lang %}
</div> </div>
<!-- .post-tail-bottom --> <!-- .post-tail-bottom -->
</div> </div>
<!-- div.post-tail-wrapper --> <!-- div.post-tail-wrapper -->
</article>