1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-06-08 00:27:58 +00:00

Merge branch 'master' into production

This commit is contained in:
Cotes Chung 2025-05-18 21:16:09 +08:00
commit d84b72706a
No known key found for this signature in database
GPG Key ID: 0D9E54843167A808
27 changed files with 443 additions and 59 deletions

View File

@ -213,7 +213,7 @@ exclude:
- README.md - README.md
- LICENSE - LICENSE
- purgecss.js - purgecss.js
- rollup.config.js - "*.config.js"
- "package*.json" - "package*.json"
jekyll-archives: jekyll-archives:

84
_data/locales/ca-ES.yml Normal file
View File

@ -0,0 +1,84 @@
# The layout text of site
# ----- Commons label -----
layout:
post: Entrada
category: Categoria
tag: Etiqueta
# The tabs of sidebar
tabs:
# format: <filename_without_extension>: <value>
home: Inici
categories: Categories
tags: Etiquetes
archives: Arxiu
about: Sobre
# the text displayed in the search bar & search results
search:
hint: Cercar
cancel: Cancel·lar
no_results: Ups! No s'han trobat resultats.
panel:
lastmod: Actualitzat recentment
trending_tags: Etiquetes populars
toc: Taula de continguts
copyright:
# Shown at the bottom of the post
license:
template: Aquesta entrada està llicenciada sota :LICENSE_NAME per l'autor.
name: CC BY 4.0
link: https://creativecommons.org/licenses/by/4.0/
# Displayed in the footer
brief: Alguns drets reservats.
verbose: >-
Excepte que s'indiqui explícitament, les entrades d'aquest blog estan llicenciades
sota la llicència Creative Commons Attribution 4.0 International (CC BY 4.0) per l'autor.
meta: Fet amb :PLATFORM utilitzant el tema :THEME
not_found:
statement: Ho sentim, hem perdut aquesta URL o apunta a alguna cosa que no existeix.
notification:
update_found: Hi ha una nova versió de contingut disponible.
update: Actualitzar
# ----- Posts related labels -----
post:
written_by: Per
posted: Publicat
updated: Actualitzat
words: paraules
pageview_measure: visites
read_time:
unit: min
prompt: " de lectura"
relate_posts: Entrades relacionades
share: Compartir
button:
next: Següent
previous: Anterior
copy_code:
succeed: Copiat!
share_link:
title: Copiar enllaç
succeed: Enllaç copiat!
# Date time format.
# See: <http://strftime.net/>, <https://day.js.org/docs/en/display/format>
df:
post:
strftime: "%Y/%m/%d"
dayjs: "YYYY/MM/DD"
# categories page
categories:
category_measure: categories
post_measure: entrades

91
_data/locales/fa-IR.yaml Normal file
View File

@ -0,0 +1,91 @@
# The layout text of site
# ----- Commons label -----
layout:
post: پست
category: دسته‌بندی
tag: برچسب
# The tabs of sidebar
tabs:
# format: <filename_without_extension>: <value>
home: خانه
categories: دسته‌بندی‌ها
tags: برچسب‌ها
archives: آرشیو
about: درباره
# the text displayed in the search bar & search results
search:
hint: جستجو
cancel: لغو
no_results: متأسفیم! هیچ نتیجه‌ای یافت نشد.
panel:
lastmod: آخرین به‌روزرسانی
trending_tags: برچسب‌های پرطرفدار
toc: فهرست مطالب
copyright:
# Shown at the bottom of the post
license:
template: این پست تحت مجوز :LICENSE_NAME توسط نویسنده منتشر شده است.
name: CC BY 4.0
link: https://creativecommons.org/licenses/by/4.0/
# Displayed in the footer
brief: برخی حقوق محفوظ است.
verbose: >-
مگر اینکه خلاف آن ذکر شده باشد، پست‌های وبلاگ در این سایت
تحت مجوز Creative Commons Attribution 4.0 International (CC BY 4.0) توسط نویسنده منتشر شده‌اند.
meta: با استفاده از :PLATFORM قالب :THEME
not_found:
statement: متأسفیم، لینک زیر معتبر نیست یا به صفحه‌ای که وجود ندارد اشاره می‌کند.
notification:
update_found: نسخه جدیدی از محتوا موجود است.
update: به‌روزرسانی
# ----- Posts related labels -----
post:
written_by: نوشته شده توسط
posted: منتشر شده
updated: به‌روزرسانی شده
words: کلمات
pageview_measure: بازدیدها
read_time:
unit: دقیقه
prompt: زمان مطالعه
relate_posts: بیشتر بخوانید
share: اشتراک‌گذاری
button:
next: جدیدتر
previous: قدیمی‌تر
copy_code:
succeed: کپی شد!
share_link:
title: کپی لینک
succeed: لینک با موفقیت کپی شد!
# 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: دسته‌بندی
plural: دسته‌بندی‌ها
post_measure:
singular: پست
plural: پست‌ها

84
_data/locales/ja-JP.yml Normal file
View File

@ -0,0 +1,84 @@
# The layout text of site
# ----- Commons label -----
layout:
post: 投稿
category: カテゴリー
tag: タグ
# The tabs of sidebar
tabs:
# format: <filename_without_extension>: <value>
home: ホーム
categories: カテゴリー
tags: タグ
archives: アーカイブ
about: このサイトについて
# the text displayed in the search bar & search results
search:
hint: 検索
cancel: キャンセル
no_results: 該当なし
panel:
lastmod: 最近更新された投稿
trending_tags: トレンドのタグ
toc: コンテンツ
copyright:
# Shown at the bottom of the post
license:
template: この投稿は投稿者によって :LICENSE_NAME の下でライセンスされています。
name: CC BY 4.0
link: https://creativecommons.org/licenses/by/4.0/
# Displayed in the footer
brief: Some 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: :PLATFORM 用の :THEME を使用しています。
not_found:
statement: このURLは存在しないものを指し示しています。
notification:
update_found: 新しいバージョンが利用可能です。
update: 更新
# ----- Posts related labels -----
post:
written_by: 投稿者
posted: 投稿日
updated: 更新日
words:
pageview_measure: 回閲覧
read_time:
unit:
prompt: で読めます
relate_posts: さらに読む
share: シェア
button:
next:
previous:
copy_code:
succeed: コピーしました
share_link:
title: リンクをコピー
succeed: リンクをコピーしました
# Date time format.
# See: <http://strftime.net/>, <https://day.js.org/docs/en/display/format>
df:
post:
strftime: "%Y/%m/%d"
dayjs: "YYYY/MM/DD"
# categories page
categories:
category_measure: カテゴリー
post_measure: 投稿

90
_data/locales/nl-NL.yml Normal file
View File

@ -0,0 +1,90 @@
# The layout text of site
# ----- Commons label -----
layout:
post: Post
category: Categorie
tag: Tag
# The tabs of sidebar
tabs:
# format: <filename_without_extension>: <value>
home: Startpagina
categories: Categorieën
tags: Tags
archives: Archief
about: Over
# the text displayed in the search bar & search results
search:
hint: Zoek
cancel: Annuleer
no_results: Oops! Geen resultaat gevonden.
panel:
lastmod: Recent Bijgewerkt
trending_tags: Trending Tags
toc: Inhoud
copyright:
# Shown at the bottom of the post
license:
template: Alle posts zijn onder :LICENSE_NAME gepubliceerd door de auteur.
name: CC BY 4.0
link: https://creativecommons.org/licenses/by/4.0/
# Displayed in the footer
brief: Sommige rechten voorbehouden.
verbose: >-
Tenzij anders vermeld, alle posts zijn onder de
Creative Commons Attribution 4.0 International (CC BY 4.0) gepubliceerd door de auteur.
meta: Gebruikt :THEME
not_found:
statement: Sorry, we hebben de URL verkeerd geplaatst of hij verwijst naar iets dat niet bestaat.
notification:
update_found: Nieuwe versie van inhoud beschikbaar.
update: Update
# ----- Posts related labels -----
post:
written_by: Door
posted: Posted
updated: Bijgewerkt
words: woorden
pageview_measure: Gelezen
read_time:
unit: min
prompt: lees
relate_posts: Verder Lezen
share: Deel
button:
next: Volgende
previous: Vorige
copy_code:
succeed: Gekopieerd!
share_link:
title: Link kopiëren
succeed: Succesvol gekopieerd!
# 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: categorie
plural: categorieën
post_measure:
singular: post
plural: posts

View File

@ -18,7 +18,7 @@ platforms:
# #
# - type: Linkedin # - type: Linkedin
# icon: "fab fa-linkedin" # icon: "fab fa-linkedin"
# link: "https://www.linkedin.com/sharing/share-offsite/?url=URL" # link: "https://www.linkedin.com/feed/?shareActive=true&shareUrl=URL"
# #
# - type: Weibo # - type: Weibo
# icon: "fab fa-weibo" # icon: "fab fa-weibo"

View File

@ -70,7 +70,7 @@
<!-- Bootstrap --> <!-- Bootstrap -->
{% unless jekyll.environment == 'production' %} {% unless jekyll.environment == 'production' %}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.6/dist/css/bootstrap.min.css">
{% endunless %} {% endunless %}
<!-- Theme style --> <!-- Theme style -->

View File

@ -66,7 +66,7 @@
{% if page.math %} {% if page.math %}
<!-- MathJax --> <!-- MathJax -->
<script async src="{{ '/assets/js/data/mathjax.js' | relative_url }}"></script> <script src="{{ '/assets/js/data/mathjax.js' | relative_url }}"></script>
<script async src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script> <script async src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="{{ site.data.origin[type].mathjax.js | relative_url }}"></script> <script id="MathJax-script" async src="{{ site.data.origin[type].mathjax.js | relative_url }}"></script>
{% endif %} {% endif %}

View File

@ -1,10 +0,0 @@
{% comment %}
Remove the line number of the code snippet.
{% endcomment %}
{% assign content = include.content %}
{% if content contains '<td class="rouge-gutter gl"><pre class="lineno">' %}
{% assign content = content | replace: '<td class="rouge-gutter gl"><pre class="lineno">', '<!-- <td class="rouge-gutter gl"><pre class="lineno">'%}
{% assign content = content | replace: '</td><td class="rouge-code">', '</td> --><td class="rouge-code">' %}
{% endif %}

View File

@ -8,8 +8,17 @@
{%- if post.description -%} {%- if post.description -%}
{{- post.description -}} {{- post.description -}}
{%- else -%} {%- else -%}
{%- include no-linenos.html content=post.content -%} {% comment %}
{{- content | markdownify | strip_html -}} Remove the line number of the code snippet.
{% endcomment %}
{% assign content = post.content %}
{% if content contains '<td class="rouge-gutter gl"><pre class="lineno">' %}
{% assign content = content | replace: '<td class="rouge-gutter gl"><pre class="lineno">', '<!-- <td class="rouge-gutter gl"><pre class="lineno">'%}
{% assign content = content | replace: '</td><td class="rouge-code">', '</td> --><td class="rouge-code">' %}
{% endif %}
{{- content | markdownify | strip_html | newline_to_br | replace: '<br />', ' ' | strip_newlines -}}
{%- endif -%} {%- endif -%}
{%- endcapture -%} {%- endcapture -%}

View File

@ -88,9 +88,41 @@
{% endfor %} {% endfor %}
<!-- take out classes --> <!-- take out classes -->
{% assign _wrapper_class = '' %}
{% if _class %} {% if _class %}
{% capture _old_class %}class="{{ _class }}"{% endcapture %} {% assign _remain = _class %}
{% assign _left = _left | remove: _old_class %} {% assign _class_array = _class | split: ' ' %}
{% for c in _class_array %}
{% assign _pick = false %}
{% case c %}
{% when 'preview-img', 'normal', 'left', 'right', 'light', 'dark' %}
{% assign _pick = true %}
{% else %}
{% if c contains '-' %}
{% assign start = c | split: '-' | first %}
{% if start == 'w' %}
{% assign _pick = true %}
{% endif %}
{% endif %}
{% endcase %}
{% if _pick %}
{% assign _remain = _remain | remove: c | strip %}
{% assign _wrapper_class = _wrapper_class | append: ' ' | append: c %}
{% endif %}
{% endfor %}
{% unless _wrapper_class == '' %}
{% capture _old_class %}class="{{ _class }}"{% endcapture %}
{% assign _left = _left | remove: _old_class %}
{% unless _remain == '' %}
{% capture _new_class %}class="{{ _remain }}"{% endcapture %}
{% assign _left = _left | append: _new_class %}
{% endunless %}
{% endunless %}
{% endif %} {% endif %}
{% assign _final_src = null %} {% assign _final_src = null %}
@ -110,7 +142,7 @@
{% if _lqip %} {% if _lqip %}
{% assign _lazyload = false %} {% assign _lazyload = false %}
{% assign _class = _class | append: ' blur' %} {% assign _wrapper_class = _wrapper_class | append: ' blur' %}
{% unless _lqip contains 'data:' %} {% unless _lqip contains 'data:' %}
{% assign _lqip_alt = 'lqip="' | append: _path_prefix %} {% assign _lqip_alt = 'lqip="' | append: _path_prefix %}
@ -121,7 +153,7 @@
{% assign _left = _left | replace: 'src=', 'data-src=' | replace: ' lqip=', ' data-lqip="true" src=' %} {% assign _left = _left | replace: 'src=', 'data-src=' | replace: ' lqip=', ' data-lqip="true" src=' %}
{% else %} {% else %}
{% assign _class = _class | append: ' shimmer' %} {% assign _wrapper_class = _wrapper_class | append: ' shimmer' %}
{% endif %} {% endif %}
<!-- lazy-load images --> <!-- lazy-load images -->
@ -153,8 +185,8 @@
{% assign _wrapper_start = _final_src {% assign _wrapper_start = _final_src
| default: _src | default: _src
| prepend: '<a href="' | prepend: '<a href="'
| append: '" class="popup img-link ' | append: '" class="popup img-link'
| append: _class | append: _wrapper_class
| append: '">' | append: '">'
%} %}

View File

@ -12,7 +12,7 @@
{tags} {tags}
</div> </div>
</header> </header>
<p>{snippet}</p> <p>{content}</p>
</article> </article>
{% endcapture %} {% endcapture %}

View File

@ -3,7 +3,7 @@
<div id="search-result-wrapper" class="d-flex justify-content-center d-none"> <div id="search-result-wrapper" class="d-flex justify-content-center d-none">
<div class="col-11 content"> <div class="col-11 content">
<div id="search-hints"> <div id="search-hints">
{% include_cached trending-tags.html %} {% include_cached trending-tags.html lang=include.lang %}
</div> </div>
<div id="search-results" class="d-flex flex-wrap justify-content-center text-muted mt-3"></div> <div id="search-results" class="d-flex flex-wrap justify-content-center text-muted mt-3"></div>
</div> </div>

View File

@ -1,6 +1,6 @@
<!-- The Top Bar --> <!-- The Top Bar -->
<header id="topbar-wrapper" aria-label="Top Bar"> <header id="topbar-wrapper" class="flex-shrink-0" aria-label="Top Bar">
<div <div
id="topbar" id="topbar"
class="d-flex align-items-center justify-content-between px-lg-3 h-100" class="d-flex align-items-center justify-content-between px-lg-3 h-100"
@ -40,7 +40,7 @@
</nav> </nav>
<!-- endof #breadcrumb --> <!-- endof #breadcrumb -->
<button type="button" id="sidebar-trigger" class="btn btn-link"> <button type="button" id="sidebar-trigger" class="btn btn-link" aria-label="Sidebar">
<i class="fas fa-bars fa-fw"></i> <i class="fas fa-bars fa-fw"></i>
</button> </button>
@ -55,7 +55,7 @@
{% endif %} {% endif %}
</div> </div>
<button type="button" id="search-trigger" class="btn btn-link"> <button type="button" id="search-trigger" class="btn btn-link" aria-label="Search">
<i class="fas fa-search fa-fw"></i> <i class="fas fa-search fa-fw"></i>
</button> </button>

View File

@ -39,7 +39,10 @@ class Theme {
} }
static get #mode() { static get #mode() {
return sessionStorage.getItem(this.#modeKey); return (
sessionStorage.getItem(this.#modeKey) ||
document.documentElement.getAttribute(this.#modeAttr)
);
} }
static get #isDarkMode() { static get #isDarkMode() {

View File

@ -21,7 +21,7 @@ Basically, you need to fill the [Front Matter](https://jekyllrb.com/docs/front-m
--- ---
title: TITLE title: TITLE
date: YYYY-MM-DD HH:MM:SS +/-TTTT date: YYYY-MM-DD HH:MM:SS +/-TTTT
categories: [TOP_CATEGORIE, SUB_CATEGORIE] categories: [TOP_CATEGORY, SUB_CATEGORY]
tags: [TAG] # TAG names should always be lowercase tags: [TAG] # TAG names should always be lowercase
--- ---
``` ```

View File

@ -68,7 +68,7 @@ For Unix-like systems, you can set up the environment natively for optimal perfo
To run the site locally, use the following command: To run the site locally, use the following command:
```terminal ```terminal
$ bundle exec jekyll s $ bundle exec jekyll serve
``` ```
> If you are using Dev Containers, you must run that command in the **VS Code** Terminal. > If you are using Dev Containers, you must run that command in the **VS Code** Terminal.

View File

@ -31,7 +31,10 @@
} }
%tag-hover { %tag-hover {
@extend %link-color;
background: var(--tag-hover); background: var(--tag-hover);
border-color: var(--tag-hover);
transition: background 0.35s ease-in-out; transition: background 0.35s ease-in-out;
} }

View File

@ -143,9 +143,7 @@ header {
.post-tag { .post-tag {
&:hover { &:hover {
@extend %link-hover;
@extend %tag-hover; @extend %tag-hover;
@extend %no-bottom-border;
} }
} }
} }

View File

@ -2,11 +2,6 @@
layout: page layout: page
title: "404: Page not found" title: "404: Page not found"
permalink: /404.html permalink: /404.html
redirect_from:
- /norobots/
- /assets/
- /posts/
--- ---
{% include lang.html %} {% include lang.html %}

View File

@ -1,6 +1,7 @@
--- ---
--- ---
/* prettier-ignore */
@use 'main @use 'main
{%- if jekyll.environment == 'production' -%} {%- if jekyll.environment == 'production' -%}
.bundle .bundle

View File

@ -5,16 +5,16 @@ swcache: true
[ [
{% for post in site.posts %} {% for post in site.posts %}
{%- capture description -%}
{% include post-description.html %}
{%- endcapture -%}
{ {
"title": {{ post.title | jsonify }}, "title": {{ post.title | jsonify }},
"url": {{ post.url | relative_url | jsonify }}, "url": {{ post.url | relative_url | jsonify }},
"categories": {{ post.categories | join: ', ' | jsonify }}, "categories": {{ post.categories | join: ', ' | jsonify }},
"tags": {{ post.tags | join: ', ' | jsonify }}, "tags": {{ post.tags | join: ', ' | jsonify }},
"date": "{{ post.date }}", "date": "{{ post.date }}",
{% include no-linenos.html content=post.content %} "content": "{{ description }}"
{% assign _content = content | strip_html | strip_newlines %}
"snippet": {{ _content | truncate: 200 | jsonify }},
"content": {{ _content | jsonify }}
}{% unless forloop.last %},{% endunless %} }{% unless forloop.last %},{% endunless %}
{% endfor %} {% endfor %}
] ]

@ -1 +1 @@
Subproject commit b9e18a1510e3be5de250ed34205da318b76474e0 Subproject commit 02f4ada65dc75197654c3265a37a6f5fbc39f17c

5
eslint.config.js Normal file
View File

@ -0,0 +1,5 @@
export default [
{
files: ['_javascript/**/*.js']
}
];

View File

@ -27,7 +27,6 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency "jekyll", "~> 4.3" spec.add_runtime_dependency "jekyll", "~> 4.3"
spec.add_runtime_dependency "jekyll-paginate", "~> 1.1" spec.add_runtime_dependency "jekyll-paginate", "~> 1.1"
spec.add_runtime_dependency "jekyll-redirect-from", "~> 0.16"
spec.add_runtime_dependency "jekyll-seo-tag", "~> 2.8" spec.add_runtime_dependency "jekyll-seo-tag", "~> 2.8"
spec.add_runtime_dependency "jekyll-archives", "~> 2.2" spec.add_runtime_dependency "jekyll-archives", "~> 2.2"
spec.add_runtime_dependency "jekyll-sitemap", "~> 1.4" spec.add_runtime_dependency "jekyll-sitemap", "~> 1.4"

View File

@ -25,29 +25,29 @@
}, },
"dependencies": { "dependencies": {
"@popperjs/core": "^2.11.8", "@popperjs/core": "^2.11.8",
"bootstrap": "^5.3.3" "bootstrap": "^5.3.6"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.26.0", "@babel/core": "^7.27.1",
"@babel/plugin-transform-class-properties": "^7.25.9", "@babel/plugin-transform-class-properties": "^7.27.1",
"@babel/plugin-transform-private-methods": "^7.25.9", "@babel/plugin-transform-private-methods": "^7.27.1",
"@babel/preset-env": "^7.26.0", "@babel/preset-env": "^7.27.2",
"@commitlint/cli": "^19.6.0", "@commitlint/cli": "^19.8.1",
"@commitlint/config-conventional": "^19.6.0", "@commitlint/config-conventional": "^19.8.1",
"@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-node-resolve": "^15.3.0", "@rollup/plugin-node-resolve": "^16.0.1",
"@rollup/plugin-terser": "^0.4.4", "@rollup/plugin-terser": "^0.4.4",
"@semantic-release/changelog": "^6.0.3", "@semantic-release/changelog": "^6.0.3",
"@semantic-release/exec": "^6.0.3", "@semantic-release/exec": "^7.1.0",
"@semantic-release/git": "^10.0.1", "@semantic-release/git": "^10.0.1",
"concurrently": "^9.1.0", "concurrently": "^9.1.2",
"conventional-changelog-conventionalcommits": "^8.0.0", "conventional-changelog-conventionalcommits": "^8.0.0",
"husky": "^9.1.7", "husky": "^9.1.7",
"purgecss": "^7.0.2", "purgecss": "^7.0.2",
"rollup": "^4.27.4", "rollup": "^4.41.0",
"semantic-release": "^24.2.0", "semantic-release": "^24.2.4",
"stylelint": "^16.10.0", "stylelint": "^16.19.1",
"stylelint-config-standard-scss": "^13.1.0" "stylelint-config-standard-scss": "^15.0.1"
}, },
"prettier": { "prettier": {
"trailingComma": "none" "trailingComma": "none"

View File

@ -80,7 +80,7 @@ export default [
build('page'), build('page'),
build('post'), build('post'),
build('misc'), build('misc'),
build('theme', { src: `${SRC_DEFAULT}/modules`, outputName: 'Theme' }), build('theme', { outputName: 'Theme' }),
build('app', { src: SRC_PWA, jekyll: true }), build('app', { src: SRC_PWA, jekyll: true }),
build('sw', { src: SRC_PWA, jekyll: true }) build('sw', { src: SRC_PWA, jekyll: true })
]; ];