Merge branch 'master' into production

This commit is contained in:
Cotes Chung 2023-10-10 13:00:51 +08:00
commit fa8a2a0ada
No known key found for this signature in database
GPG key ID: 0D9E54843167A808
56 changed files with 857 additions and 738 deletions

26
.github/DISCUSSION_TEMPLATE/general.yml vendored Normal file
View file

@ -0,0 +1,26 @@
body:
- type: checkboxes
attributes:
label: Checklist
description: Following the guidelines can make you more likely to get responses.
options:
- label: >-
I have read and accepted the
[contributing guidelines](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/CONTRIBUTING.md).
required: true
- type: dropdown
attributes:
label: What is the topic?
options:
- Sharing tips and tricks
- Just chatting
validations:
required: true
- type: textarea
attributes:
label: Description
description: Please describe in detail what you want to share.
validations:
required: true

40
.github/DISCUSSION_TEMPLATE/q-a.yml vendored Normal file
View file

@ -0,0 +1,40 @@
body:
- type: checkboxes
attributes:
label: Checklist
description: Following the guidelines can make you more likely to get responses.
options:
- label: >-
I have read and accepted the
[contributing guidelines](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/CONTRIBUTING.md).
required: true
- type: dropdown
id: download
attributes:
label: How did you create the site?
options:
- Generated from `chirpy-starter`
- Built from `jekyll-theme-chirpy`
validations:
required: true
- type: textarea
attributes:
label: Description
description: Please describe your need in detail.
validations:
required: true
- type: textarea
attributes:
label: Operations you have already tried
description: Describe the effort you went through.
validations:
required: true
- type: textarea
attributes:
label: Anything else?
description: |
Links? References? Or logs? Anything that will give us more context about the issue you are encountering!

View file

@ -1,61 +0,0 @@
---
name: Bug Report
about: Create a report to help us improve
---
> **Tips**: Remember, contributions to this repository should follow the [contributing guidelines](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/CONTRIBUTING.md).
## Describe the bug
<!-- A clear and concise description of what the bug is. -->
## To Reproduce
Steps to reproduce the behavior:
<!--
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
-->
## Expected behavior
<!-- A clear and concise description of what you expected to happen. -->
## Logs/Screenshots
<!-- If applicable, add logs/screenshots to help explain your problem. -->
## Environment
| Command | Version |
|-----------------------------------|---------|
| `ruby -v` | |
| `gem -v` | |
| `bundle -v` | |
| `bundle exec jekyll -v` | |
| `bundle info jekyll-theme-chirpy` | |
<!-- If necessary, uncomment and fill in the following list:
### Desktop
- OS: [e.g. macOS 10.15.6]
- Browser: [e.g. Chrome 85.0.4183.83 (64-bit)]
-->
<!-- If necessary, uncomment and fill in the following list:
### Smartphone
- Device: [e.g. iPhone 6]
- OS: [e.g. iOS 13.6.1]
- Browser: [e.g. Chrome 22]
-->
## Additional context
<!-- Add any other context about the problem here. -->

64
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View file

@ -0,0 +1,64 @@
name: Bug Report
description: Create a report to help us improve
body:
- type: checkboxes
attributes:
label: Checklist
description: Following the guidelines can make you more likely to get responses.
options:
- label: >-
I have read and accepted the
[contributing guidelines](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/CONTRIBUTING.md).
required: true
- type: dropdown
id: download
attributes:
label: How did you create the site?
options:
- Generated from `chirpy-starter`
- Built from `jekyll-theme-chirpy`
validations:
required: true
- type: textarea
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
attributes:
label: Steps To Reproduce
description: Steps to reproduce the behavior.
placeholder: |
1. In this environment...
2. With this config...
3. Run '...'
4. See error...
validations:
required: true
- type: textarea
attributes:
label: Expected Behavior
description: A concise description of what you expected to happen.
validations:
required: true
- type: textarea
attributes:
label: Environment
value: |
- Ruby: <!-- run `ruby -v` -->
- Jekyll: <!-- run `bundle exec jekyll -v` -->
- Chirpy: <!-- run `bundle info jekyll-theme-chirpy` -->
validations:
required: true
- type: textarea
attributes:
label: Anything else?
description: |
Links? References? Or logs? Anything that will give us more context about the issue you are encountering!

View file

@ -1,26 +0,0 @@
---
name: Feature Request
about: Suggest an idea for this project
labels: enhancement
---
> **Tips**: Remember, contributions to this repository should follow the [contributing guidelines](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/CONTRIBUTING.md).
## Is your feature request related to a problem? Please describe
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
## Describe the solution you'd like
<!-- A clear and concise description of what you want to happen. -->
## Describe alternatives you've considered
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
## Additional context
<!-- Add any other context or screenshots about the feature request here. -->

View file

@ -0,0 +1,38 @@
name: Feature Request
description: Suggest an idea for this project
labels:
- enhancement
body:
- type: checkboxes
attributes:
label: Checklist
description: Following the guidelines can make you more likely to get responses.
options:
- label: >-
I have read and accepted the
[contributing guidelines](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/CONTRIBUTING.md).
required: true
- type: textarea
attributes:
label: Is your feature request related to a problem? Please describe
description: A clear and concise description of what the problem is.
validations:
required: true
- type: textarea
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've considered.
- type: textarea
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request here.

View file

@ -1,29 +1,17 @@
## Description
<!--
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
-->
## Type of change ## Type of change
<!-- Please select the desired item checkbox and change it from `[ ]` to `[x]` and then delete the irrelevant options. -->
<!--
Please select the desired item checkbox and change it to "[x]", then delete options that are not relevant.
-->
- [ ] Bug fix (non-breaking change which fixes an issue) - [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality) - [ ] New feature (non-breaking change which adds functionality)
- [ ] Improvement (refactoring and improving code) - [ ] Improvement (refactoring and improving code)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update - [ ] Documentation update
## Additional context ## Description
<!-- e.g. Fixes #(issue) -->
## How has this been tested
<!-- <!--
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context.
List any dependencies that are required for this change.
--> -->
- [ ] I have run `bash ./tools/test` (at the root of the project) locally and passed ## Additional context
- [ ] I have tested this feature in the browser <!-- e.g. Fixes #(issue) -->

View file

@ -15,7 +15,7 @@
"scss/operator-no-newline-after": null, "scss/operator-no-newline-after": null,
"rule-empty-line-before": [ "rule-empty-line-before": [
"always", "always",
{ "ignore": ["after-comment", "first-nested", "inside-block"] } { "ignore": ["after-comment", "first-nested"] }
], ],
"value-keyword-case": ["lower", { "ignoreProperties": ["/^\\$/"] }], "value-keyword-case": ["lower", { "ignoreProperties": ["/^\\$/"] }],
"media-feature-range-notation": "prefix" "media-feature-range-notation": "prefix"

View file

@ -21,8 +21,3 @@ gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem # Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
# do not have a Java counterpart. # do not have a Java counterpart.
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby] gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]
# Lock jekyll-sass-converter to 2.x on Linux-musl
if RUBY_PLATFORM =~ /linux-musl/
gem "jekyll-sass-converter", "~> 2.0"
end

View file

@ -19,45 +19,44 @@
## Features ## Features
<details> <details>
<summary> <summary>Click to expand/close details</summary>
<i>Click to view features</i> &nbsp;
</summary>
<p>
- Dark / Light Theme Mode - Dark / Light Theme Mode
- Localized UI language - Localized UI language
- Pinned Posts on Home Page - Pinned Posts on Home Page
- Hierarchical Categories - Hierarchical Categories
- Trending Tags - Trending Tags
- Table of Contents - Table of Contents
- Last Modified Date - Last Modified Date
- Syntax Highlighting - Syntax Highlighting
- Mathematical Expressions - Mathematical Expressions
- Mermaid Diagrams & Flowcharts - Mermaid Diagrams & Flowcharts
- Dark / Light Mode Images - Dark / Light Mode Images
- Embed Videos - Embed Videos
- Disqus / Utterances / Giscus Comments - Disqus / Giscus / Utterances Comments
- Built-in Search - Built-in Search
- Atom Feeds - Atom Feeds
- PWA - PWA
- Google Analytics - Google Analytics
- SEO & Performance Optimization - SEO & Performance Optimization
</p>
</details> </details>
## Documentation ## Documentation
To explore usage, development, and upgrade guide of the project, please refer to the [**Wiki**][wiki]. To learn how to use, develop, and upgrade the project, please refer to the [Wiki][wiki].
## Contributing ## Contributing
Contributions (Issues/PRs/Discussions) are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. For details, see the "[Contributing Guidelines][contribute-guide]". Contributions (_pull requests_, _issues_, and _discussions_) are what make the open-source community such an amazing place
to learn, inspire, and create. Any contributions you make are greatly appreciated.
For details, see the "[Contributing Guidelines][contribute-guide]".
## Credits ## Credits
This theme is mainly built with [Jekyll][jekyllrb] ecosystem, This project is mainly built with [Jekyll][jekyllrb] ecosystem,
[Bootstrap][bootstrap], [Font Awesome][icons] and some other [wonderful tools][lib]. [Bootstrap][bootstrap], [Font Awesome][icons], and some other [wonderful tools][lib].
The avatar and favicon design come from [Clipart Max][image]. The avatar and favicon design come from [Clipart Max][image].
Many thanks to the [contributors][contributors] who participated in the development Many thanks to the [contributors][contributors] who participated in the development
@ -67,15 +66,15 @@ Last but not least, thanks to [JetBrains][jetbrains] for providing the _Open Sou
## Sponsoring ## Sponsoring
If you'd like to sponsor this project, the following options are available. If you like this project or have built something through it, please consider sponsoring it, and your support would be greatly appreciated.
[![Ko-fi](https://img.shields.io/badge/Support_Me_on_Ko--fi-ff5e5b?logo=ko-fi&logoColor=white)][ko-fi]&nbsp; [![Ko-fi](https://img.shields.io/badge/Support_Me_on_Ko--fi-ff5e5b?logo=ko-fi&logoColor=white)][ko-fi]&nbsp;
[![Wechat Pay](https://img.shields.io/badge/Tip_Me_on_WeChat-brightgreen?logo=wechat&logoColor=white)][donation]&nbsp; [![Wechat Pay](https://img.shields.io/badge/Support_Me_on_WeChat-brightgreen?logo=wechat&logoColor=white)][donation]&nbsp;
[![Alipay](https://img.shields.io/badge/Tip_Me_on_Alipay-blue?logo=alipay&logoColor=white)][donation] [![Alipay](https://img.shields.io/badge/Support_Me_on_Alipay-blue?logo=alipay&logoColor=white)][donation]
## License ## License
This work is published under [MIT License][license]. This project is published under [MIT License][license].
[gem]: https://rubygems.org/gems/jekyll-theme-chirpy [gem]: https://rubygems.org/gems/jekyll-theme-chirpy
[ci]: https://github.com/cotes2020/jekyll-theme-chirpy/actions/workflows/ci.yml?query=event%3Apush+branch%3Amaster [ci]: https://github.com/cotes2020/jekyll-theme-chirpy/actions/workflows/ci.yml?query=event%3Apush+branch%3Amaster

View file

@ -3,10 +3,6 @@
# Import the theme # Import the theme
theme: jekyll-theme-chirpy theme: jekyll-theme-chirpy
# Change the following value to '/PROJECT_NAME' ONLY IF your site type is GitHub Pages Project sites
# and doesn't have a custom domain.
baseurl: ""
# The language of the webpage http://www.lingoes.net/en/translator/langcode.htm # The language of the webpage http://www.lingoes.net/en/translator/langcode.htm
# If it has the same name as one of the files in folder `_data/locales`, the layout language will also be changed, # If it has the same name as one of the files in folder `_data/locales`, the layout language will also be changed,
# otherwise, the layout language will use the default value of 'en'. # otherwise, the layout language will use the default value of 'en'.
@ -25,7 +21,8 @@ tagline: A text-focused Jekyll theme # it will display as the sub-title
description: >- # used by seo meta and the atom feed description: >- # used by seo meta and the atom feed
A minimal, responsive and feature-rich Jekyll theme for technical writing. A minimal, responsive and feature-rich Jekyll theme for technical writing.
# fill in the protocol & hostname for your site, e.g., 'https://username.github.io' # Fill in the protocol & hostname for your site.
# e.g. 'https://username.github.io', note that it does not end with a '/'.
url: "" url: ""
github: github:
@ -114,6 +111,9 @@ pwa:
paginate: 10 paginate: 10
# The base URL of your site
baseurl: ""
# ------------ The following options are not recommended to be modified ------------------ # ------------ The following options are not recommended to be modified ------------------
kramdown: kramdown:
@ -180,7 +180,6 @@ exclude:
- docs - docs
- tools - tools
- README.md - README.md
- CHANGELOG.md
- LICENSE - LICENSE
- rollup.config.js - rollup.config.js
- package*.json - package*.json

View file

@ -58,7 +58,7 @@ post:
pageview_measure: Aufrufe pageview_measure: Aufrufe
read_time: read_time:
unit: Minuten unit: Minuten
prompt: lesen prompt: Lesezeit
relate_posts: Weiterlesen relate_posts: Weiterlesen
share: Teilen share: Teilen
button: button:
@ -70,6 +70,13 @@ post:
title: Link kopieren title: Link kopieren
succeed: Link erfolgreich kopiert! succeed: Link erfolgreich kopiert!
# Date time format.
# See: <http://strftime.net/>, <https://day.js.org/docs/en/display/format>
df:
post:
strftime: "%d.%m.%Y"
dayjs: "DD.MM.YYYY"
# categories page # categories page
categories: categories:
category_measure: category_measure:

View file

@ -40,7 +40,7 @@ copyright:
Except where otherwise noted, the blog posts on this site are licensed 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. under the Creative Commons Attribution 4.0 International (CC BY 4.0) License by the author.
meta: Using the :PLATFORM theme :THEME meta: Using the :THEME theme for :PLATFORM
not_found: not_found:
statment: Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. statment: Sorry, we've misplaced that URL or it's pointing to something that doesn't exist.

View file

@ -3,14 +3,14 @@
# ----- Commons label ----- # ----- Commons label -----
layout: layout:
post: Публикация post: Пост
category: Категория category: Категория
tag: Тег tag: Тег
# The tabs of sidebar # The tabs of sidebar
tabs: tabs:
# format: <filename_without_extension>: <value> # format: <filename_without_extension>: <value>
home: Домашняя страница home: Главная
categories: Категории categories: Категории
tags: Теги tags: Теги
archives: Архив archives: Архив
@ -19,8 +19,8 @@ tabs:
# the text displayed in the search bar & search results # the text displayed in the search bar & search results
search: search:
hint: поиск hint: поиск
cancel: Отменить cancel: Отмена
no_results: Ох! Ничего не найдено. no_results: Упс! Ничего не найдено.
panel: panel:
lastmod: Недавно обновлено lastmod: Недавно обновлено
@ -30,48 +30,58 @@ panel:
copyright: copyright:
# Shown at the bottom of the post # Shown at the bottom of the post
license: license:
template: Публикация защищена лицензией :LICENSE_NAME. template: Авторский пост защищен лицензией :LICENSE_NAME.
name: CC BY 4.0 name: CC BY 4.0
link: https://creativecommons.org/licenses/by/4.0/ link: https://creativecommons.org/licenses/by/4.0/
# Displayed in the footer # Displayed in the footer
brief: Некоторые права защищены. brief: Некоторые права защищены.
verbose: >- verbose: >-
Публикации на сайте защищены лицензией Creative Commons Attribution 4.0 International (CC BY 4.0), Если не указано иное, авторские посты на этом сайте защищены лицензией Creative Commons Attribution 4.0 International (CC BY 4.0).
если в тексте публикации не указано иное.
meta: Powered by :PLATFORM with :THEME theme meta: Использует тему :THEME для :PLATFORM
not_found: not_found:
statment: Извините, эта ссылка указывает на ресурс который не существует. statment: Извините, мы перепутали URL-адрес или он указывает на что-то несуществующее.
notification: notification:
update_found: Доступна новая версия контента. update_found: Доступна новая версия контента.
update: Обновлять update: Обновить
# ----- Posts related labels ----- # ----- Posts related labels -----
post: post:
written_by: Автор written_by: Автор
posted: Время публикации posted: Опубликовано
updated: Обновлено updated: Обновлено
words: слов words: слов
pageview_measure: просмотров pageview_measure: просмотров
read_time: read_time:
unit: минут unit: мин.
prompt: чтения prompt: чтения
relate_posts: Вам также может быть интересно relate_posts: Похожие посты
share: Поделиться share: Поделиться
button: button:
next: Предыдущая публикация next: Следующий пост
previous: Следующая публикация previous: Предыдущий пост
copy_code: copy_code:
succeed: Скопировано успешно! succeed: Скопировано!
share_link: share_link:
title: Скопировать ссылку title: Скопировать ссылку
succeed: Ссылка успешно скопирована! succeed: Ссылка успешно скопирована!
# Date time format.
# See: <http://strftime.net/>, <https://day.js.org/docs/en/display/format>
df:
post:
strftime: "%d.%m.%Y"
dayjs: "DD.MM.YYYY"
# categories page # categories page
categories: categories:
category_measure: категории category_measure:
post_measure: публикации singular: категория
plural: категории
post_measure:
singular: пост
plural: посты

View file

@ -35,14 +35,12 @@ magnific-popup:
css: /assets/lib/magnific-popup/magnific-popup.css css: /assets/lib/magnific-popup/magnific-popup.css
js: /assets/lib/magnific-popup/jquery.magnific-popup.min.js js: /assets/lib/magnific-popup/jquery.magnific-popup.min.js
lazysizes: lazy-polyfill:
js: /assets/lib/lazysizes/lazysizes.min.js css: /assets/lib/loading-attribute-polyfill/loading-attribute-polyfill.min.css
js: /assets/lib/loading-attribute-polyfill/loading-attribute-polyfill.umd.min.js
clipboard: clipboard:
js: /assets/lib/clipboard/clipboard.min.js js: /assets/lib/clipboard/clipboard.min.js
polyfill:
js: /assets/lib/polyfill-v3-es6/polyfill.min.js
mathjax: mathjax:
js: /assets/lib/mathjax/tex-chtml.js js: /assets/lib/mathjax/tex-chtml.js

View file

@ -19,12 +19,12 @@ jquery:
js: https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js js: https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js
bootstrap: bootstrap:
css: https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css css: https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css
js: https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/js/bootstrap.bundle.min.js js: https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js
toc: toc:
css: https://cdn.jsdelivr.net/npm/tocbot@4.21.1/dist/tocbot.min.css css: https://cdn.jsdelivr.net/npm/tocbot@4.21.2/dist/tocbot.min.css
js: https://cdn.jsdelivr.net/npm/tocbot@4.21.1/dist/tocbot.min.js js: https://cdn.jsdelivr.net/npm/tocbot@4.21.2/dist/tocbot.min.js
fontawesome: fontawesome:
css: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.4.2/css/all.min.css css: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.4.2/css/all.min.css
@ -33,27 +33,25 @@ search:
js: https://cdn.jsdelivr.net/npm/simple-jekyll-search@1.10.0/dest/simple-jekyll-search.min.js js: https://cdn.jsdelivr.net/npm/simple-jekyll-search@1.10.0/dest/simple-jekyll-search.min.js
mermaid: mermaid:
js: https://cdn.jsdelivr.net/npm/mermaid@10.4.0/dist/mermaid.min.js js: https://cdn.jsdelivr.net/npm/mermaid@10.5.0/dist/mermaid.min.js
dayjs: dayjs:
js: js:
common: https://cdn.jsdelivr.net/npm/dayjs@1.11.9/dayjs.min.js common: https://cdn.jsdelivr.net/npm/dayjs@1.11.10/dayjs.min.js
locale: https://cdn.jsdelivr.net/npm/dayjs@1.11.9/locale/:LOCALE.min.js locale: https://cdn.jsdelivr.net/npm/dayjs@1.11.10/locale/:LOCALE.min.js
relativeTime: https://cdn.jsdelivr.net/npm/dayjs@1.11.9/plugin/relativeTime.min.js relativeTime: https://cdn.jsdelivr.net/npm/dayjs@1.11.10/plugin/relativeTime.min.js
localizedFormat: https://cdn.jsdelivr.net/npm/dayjs@1.11.9/plugin/localizedFormat.min.js localizedFormat: https://cdn.jsdelivr.net/npm/dayjs@1.11.10/plugin/localizedFormat.min.js
magnific-popup: magnific-popup:
css: https://cdn.jsdelivr.net/npm/magnific-popup@1.1.0/dist/magnific-popup.min.css css: https://cdn.jsdelivr.net/npm/magnific-popup@1.1.0/dist/magnific-popup.min.css
js: https://cdn.jsdelivr.net/npm/magnific-popup@1.1.0/dist/jquery.magnific-popup.min.js js: https://cdn.jsdelivr.net/npm/magnific-popup@1.1.0/dist/jquery.magnific-popup.min.js
lazysizes: lazy-polyfill:
js: https://cdn.jsdelivr.net/npm/lazysizes@5.3.2/lazysizes.min.js css: https://cdn.jsdelivr.net/npm/loading-attribute-polyfill@2.1.1/dist/loading-attribute-polyfill.min.css
js: https://cdn.jsdelivr.net/npm/loading-attribute-polyfill@2.1.1/dist/loading-attribute-polyfill.umd.min.js
clipboard: clipboard:
js: https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js js: https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js
polyfill:
js: https://polyfill.io/v3/polyfill.min.js?features=es6
mathjax: mathjax:
js: https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-chtml.js js: https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-chtml.js

View file

@ -1,6 +1,6 @@
<!-- The Disqus lazy loading. --> <!-- The Disqus lazy loading. -->
<div id="disqus_thread" class="mb-5"> <div id="disqus_thread">
<p class="text-center text-muted small">Comments powered by <a href="https://disqus.com/">Disqus</a>.</p> <p class="text-center text-muted small">Comments powered by <a href="https://disqus.com/">Disqus</a>.</p>
</div> </div>

View file

@ -30,6 +30,7 @@
'data-theme': initTheme, 'data-theme': initTheme,
'data-input-position': '{{ site.comments.giscus.input_position | default: 'bottom' }}', 'data-input-position': '{{ site.comments.giscus.input_position | default: 'bottom' }}',
'data-lang': '{{ site.comments.giscus.lang | default: lang }}', 'data-lang': '{{ site.comments.giscus.lang | default: lang }}',
'data-loading': 'lazy',
crossorigin: 'anonymous', crossorigin: 'anonymous',
async: '' async: ''
}; };

View file

@ -1,51 +1,50 @@
<!-- https://utteranc.es/ --> <!-- https://utteranc.es/ -->
<script src="https://utteranc.es/client.js" <script
repo="{{ site.comments.utterances.repo }}" src="https://utteranc.es/client.js"
issue-term="{{ site.comments.utterances.issue_term }}" repo="{{ site.comments.utterances.repo }}"
crossorigin="anonymous" issue-term="{{ site.comments.utterances.issue_term }}"
async> crossorigin="anonymous"
</script> async
></script>
<script type="text/javascript"> <script type="text/javascript">
$(function() { (function () {
const origin = "https://utteranc.es"; const origin = 'https://utteranc.es';
const iframe = "iframe.utterances-frame"; const iframe = 'iframe.utterances-frame';
const lightTheme = "github-light"; const lightTheme = 'github-light';
const darkTheme = "github-dark"; const darkTheme = 'github-dark';
let initTheme = lightTheme; let initTheme = lightTheme;
const html = document.documentElement;
if ($("html[data-mode=dark]").length > 0 if (
|| ($("html[data-mode]").length == 0 (html.hasAttribute('data-mode') && html.getAttribute('data-mode') === 'dark') ||
&& window.matchMedia("(prefers-color-scheme: dark)").matches)) { (!html.hasAttribute('data-mode') && window.matchMedia('(prefers-color-scheme: dark)').matches)
) {
initTheme = darkTheme; initTheme = darkTheme;
} }
addEventListener("message", (event) => { addEventListener('message', (event) => {
let theme; let theme;
/* credit to <https://github.com/utterance/utterances/issues/170#issuecomment-594036347> */ /* credit to <https://github.com/utterance/utterances/issues/170#issuecomment-594036347> */
if (event.origin === origin) { if (event.origin === origin) {
/* page initial */ /* page initial */
theme = initTheme; theme = initTheme;
} else if (event.source === window && event.data && event.data.direction === ModeToggle.ID) {
} else if (event.source === window && event.data &&
event.data.direction === ModeToggle.ID) {
/* global theme mode changed */ /* global theme mode changed */
const mode = event.data.message; const mode = event.data.message;
theme = (mode === ModeToggle.DARK_MODE ? darkTheme : lightTheme); theme = mode === ModeToggle.DARK_MODE ? darkTheme : lightTheme;
} else { } else {
return; return;
} }
const message = { const message = {
type: "set-theme", type: 'set-theme',
theme: theme theme: theme
}; };
const utterances = document.querySelector(iframe).contentWindow; const utterances = document.querySelector(iframe).contentWindow;
utterances.postMessage(message, origin); utterances.postMessage(message, origin);
}); });
})();
});
</script> </script>

View file

@ -1,4 +1,7 @@
<iframe class="embed-video twitch lazyload" <iframe
class="embed-video twitch"
src="https://player.twitch.tv/?video={{ include.id }}&parent={{ site.url | split: '://' | last | remove: '/' }}" src="https://player.twitch.tv/?video={{ include.id }}&parent={{ site.url | split: '://' | last | remove: '/' }}"
frameborder="0" allowfullscreen="true" frameborder="0"
scrolling="no"></iframe> allowfullscreen="true"
scrolling="no"
></iframe>

View file

@ -1,6 +1,9 @@
<iframe class="embed-video youtube lazyload" <iframe
class="embed-video youtube"
loading="lazy"
src="https://www.youtube.com/embed/{{ include.id }}" src="https://www.youtube.com/embed/{{ include.id }}"
title="YouTube video player" title="YouTube video player"
frameborder="0" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen></iframe> allowfullscreen
></iframe>

View file

@ -80,6 +80,10 @@
<link rel="stylesheet" href="{{ site.data.origin[type].toc.css | relative_url }}"> <link rel="stylesheet" href="{{ site.data.origin[type].toc.css | relative_url }}">
{% endif %} {% endif %}
{% if page.layout == 'post' or page.layout == 'page' or page.layout == 'home' %}
<link rel="stylesheet" href="{{ site.data.origin[type]['lazy-polyfill'].css | relative_url }}">
{% endif %}
{% if page.layout == 'page' or page.layout == 'post' %} {% if page.layout == 'page' or page.layout == 'post' %}
<!-- Manific Popup --> <!-- Manific Popup -->
<link rel="stylesheet" href="{{ site.data.origin[type].magnific-popup.css | relative_url }}"> <link rel="stylesheet" href="{{ site.data.origin[type].magnific-popup.css | relative_url }}">

View file

@ -12,7 +12,7 @@
<!-- layout specified --> <!-- layout specified -->
{% if page.layout == 'post' or page.layout == 'page' or page.layout == 'home' %} {% if page.layout == 'post' or page.layout == 'page' or page.layout == 'home' %}
{% assign urls = urls | append: ',' | append: site.data.origin[type].lazysizes.js %} {% assign urls = urls | append: ',' | append: site.data.origin[type]['lazy-polyfill'].js %}
{% unless page.layout == 'home' %} {% unless page.layout == 'home' %}
<!-- image lazy-loading & popup & clipboard --> <!-- image lazy-loading & popup & clipboard -->
@ -87,7 +87,7 @@
} }
}; };
</script> </script>
<script src="{{ site.data.origin[type].polyfill.js | relative_url }}"></script> <script src="https://polyfill.io/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

@ -30,22 +30,22 @@
{% endif %} {% endif %}
<!-- Change the icon of checkbox --> <!-- Change the icon of checkbox -->
{% if _content contains '<input type="checkbox"' %} {% if _content contains '<input type="checkbox"' %}
{% assign _content = _content {% assign _content = _content
| replace: | replace: '<input type="checkbox" class="task-list-item-checkbox" disabled="disabled" checked="checked" />',
'<input type="checkbox" class="task-list-item-checkbox" disabled="disabled" checked="checked" />', '<i class="fas fa-check-circle fa-fw checked"></i>'
'<i class="fas fa-check-circle fa-fw checked"></i>' | replace: '<input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />',
| replace: '<i class="far fa-circle fa-fw"></i>'
'<input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />',
'<i class="far fa-circle fa-fw"></i>'
%} %}
{% endif %} {% endif %}
<!-- images --> <!-- Handle images -->
{% assign IMG_TAG = '<img ' %} {% assign IMG_TAG = '<img ' %}
{% if _content contains IMG_TAG %} {% if _content contains IMG_TAG %}
{% assign _img_content = nil %} {% assign _img_content = null %}
{% assign _img_snippets = _content | split: IMG_TAG %} {% assign _img_snippets = _content | split: IMG_TAG %}
<!-- CDN URL --> <!-- CDN URL -->
@ -81,10 +81,9 @@
{% assign _left = _left | remove: ' /' | replace: ' w=', ' width=' | replace: ' h=', ' height=' %} {% assign _left = _left | remove: ' /' | replace: ' w=', ' width=' | replace: ' h=', ' height=' %}
{% assign _attrs = _left | split: '" ' %} {% assign _attrs = _left | split: '" ' %}
{% assign _width = nil %} {% assign _src = null %}
{% assign _height = nil %} {% assign _lqip = null %}
{% assign _lqip = nil %} {% assign _class = null %}
{% assign _class = nil %}
{% for _attr in _attrs %} {% for _attr in _attrs %}
{% unless _attr contains '=' %} {% unless _attr contains '=' %}
@ -96,10 +95,6 @@
{% capture _value %}{{ _pair | last | remove: '"' }}{% endcapture %} {% capture _value %}{{ _pair | last | remove: '"' }}{% endcapture %}
{% case _key %} {% case _key %}
{% when 'width' %}
{% assign _width = _value %}
{% when 'height' %}
{% assign _height = _value %}
{% when 'src' %} {% when 'src' %}
{% assign _src = _value %} {% assign _src = _value %}
{% when 'lqip' %} {% when 'lqip' %}
@ -115,54 +110,40 @@
{% assign _left = _left | remove: _old_class %} {% assign _left = _left | remove: _old_class %}
{% endif %} {% endif %}
{% assign _final_src = nil %} {% assign _final_src = null %}
{% assign _lazyload = true %}
{% unless _src contains '//' %} {% unless _src contains '//' %}
{% assign _final_src = _path_prefix | append: _src %} {% assign _final_src = _path_prefix | append: _src %}
{% capture _src_from %}"{{ _src }}"{% endcapture %} {% assign _src_alt = 'src="' | append: _path_prefix %}
{% capture _src_to %}"{{ _final_src }}"{% endcapture %} {% assign _left = _left | replace: 'src="', _src_alt %}
{% assign _left = _left | replace: _src_from, _src_to %}
{% endunless %} {% endunless %}
{% if _lqip %} {% if _lqip %}
{% unless _lqip contains ':' %} {% assign _lazyload = false %}
{% assign _final_lqip = _path_prefix | append: _lqip %} {% assign _class = _class | append: ' blur' %}
{% capture _lqip_from %}"{{ _lqip }}"{% endcapture %}
{% capture _lqip_to %}"{{ _final_lqip }}"{% endcapture %} {% unless _lqip contains 'data:' %}
{% assign _left = _left | replace: _lqip_from, _lqip_to %} {% assign _lqip_alt = 'lqip="' | append: _path_prefix %}
{% assign _left = _left | replace: 'lqip="', _lqip_alt %}
{% endunless %} {% endunless %}
{% endif %}
<!-- lazy-load images <https://github.com/aFarkas/lazysizes#readme> --> <!-- add image placeholder -->
{% assign _left = _left | replace: 'src=', 'data-src=' %} {% assign _left = _left | replace: 'src=', 'data-src=' | replace: ' lqip=', ' data-lqip="true" src=' %}
{% if _left contains 'class=' %}
{% assign _left = _left | replace: 'class="', 'class="lazyload '%}
{% else %} {% else %}
{% assign _left = _left | append: ' class="lazyload"' %} {% assign _class = _class | append: ' shimmer' %}
{% endif %} {% endif %}
<!-- add image placeholder --> <!-- lazy-load images -->
{% if _lqip %} {% if _lazyload %}
{% assign _left = _left | replace: ' lqip=', ' data-lqip="true" src=' %} {% assign _left = _left | append: ' loading="lazy"' %}
{% else %}
{% if _width and _height %}
<!-- add SVG placehoder -->
{%- capture _svg -%}
src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 {{ _width }} {{ _height }}'%3E%3C/svg%3E"
{%- endcapture -%}
{% assign _left = _svg | append: ' ' | append: _left %}
{% assign _class = _class | append: ' shimmer' %}
{% endif %}
{% endif %} {% endif %}
<!-- Bypass the HTML-proofer test -->
{% assign _left = _left | append: ' data-proofer-ignore' %}
{% if page.layout == 'home' %} {% if page.layout == 'home' %}
<!-- create the image wrapper --> <!-- create the image wrapper -->
{%- capture _wrapper_start -%} {% assign _wrapper_start = '<div class="preview-img ' | append: _class | append: '">' %}
<div class="preview-img {{ _class | strip }}">
{%- endcapture -%}
{% assign _img_content = _img_content | append: _wrapper_start %} {% assign _img_content = _img_content | append: _wrapper_start %}
{% assign _right = _right | prepend: '></div' %} {% assign _right = _right | prepend: '></div' %}
@ -176,26 +157,30 @@
{% capture _class %} {% capture _class %}
class="img-link{% unless _lqip %} shimmer{% endunless %}" class="img-link{% unless _lqip %} shimmer{% endunless %}"
{% endcapture %} {% endcapture %}
{% assign _img_content = _img_content | slice: 0, _size | append: _class | append: '>' %} {% assign _img_content = _img_content | slice: 0, _size | append: _class | append: '>' %}
{% else %} {% else %}
<!-- create the image wrapper --> <!-- create the image wrapper -->
{%- capture _wrapper_start -%} {% assign _wrapper_start = _final_src
<a href="{{ _final_src | default: _src }}" class="popup img-link {{ _class }}"> | default: _src
{%- endcapture -%} | prepend: '<a href="'
| append: '" class="popup img-link '
| append: _class
| append: '">'
%}
{% assign _img_content = _img_content | append: _wrapper_start %} {% assign _img_content = _img_content | append: _wrapper_start %}
{% assign _right = _right | prepend: '></a' %} {% assign _right = '></a' | append: _right %}
{% endif %} {% endif %}
{% endif %} {% endif %}
<!-- combine --> <!-- combine -->
{% assign _img_content = _img_content | append: debug | append: IMG_TAG | append: _left | append: _right %} {% assign _img_content = _img_content | append: IMG_TAG | append: _left | append: _right %}
{% endfor %} {% endfor %}
{% if _img_content %} {% if _img_content %}
{% assign _content = _img_content %} {% assign _content = _img_content %}
{% endif %} {% endif %}
{% endif %} {% endif %}
<!-- Add header for code snippets --> <!-- Add header for code snippets -->
@ -205,13 +190,11 @@
{% assign _new_content = '' %} {% assign _new_content = '' %}
{% for _snippet in _code_spippets %} {% for _snippet in _code_spippets %}
{% if forloop.last %} {% if forloop.last %}
{% assign _new_content = _new_content | append: _snippet %} {% assign _new_content = _new_content | append: _snippet %}
{% else %} {% else %}
{% assign _left = _snippet | split: '><' | last %}
{% assign _left = _snippet | split: '><' | last%}
{% if _left contains 'file="' %} {% if _left contains 'file="' %}
{% assign _label_text = _left | split: 'file="' | last | split: '"' | first %} {% assign _label_text = _left | split: 'file="' | last | split: '"' | first %}
@ -226,21 +209,19 @@
<span data-label-text="{{ _label_text | strip }}"><i class="{{ _label_icon }}"></i></span> <span data-label-text="{{ _label_text | strip }}"><i class="{{ _label_icon }}"></i></span>
{% endcapture %} {% endcapture %}
{% assign _new_content = _new_content | append: _snippet {% assign _new_content = _new_content
| append: '<div class="code-header">' | append: _snippet
| append: _label | append: '<div class="code-header">'
| append: '<button aria-label="copy" data-title-succeed="' | append: _label
| append: site.data.locales[include.lang].post.button.copy_code.succeed | append: '<button aria-label="copy" data-title-succeed="'
| append: '"><i class="far fa-clipboard"></i></button></div>' | append: site.data.locales[include.lang].post.button.copy_code.succeed
| append: '<div class="highlight"><code>' | append: '"><i class="far fa-clipboard"></i></button></div>'
| append: '<div class="highlight"><code>'
%} %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% assign _content = _new_content %} {% assign _content = _new_content %}
{% endif %} {% endif %}
<!-- Create heading anchors --> <!-- Create heading anchors -->
@ -249,11 +230,11 @@
{% assign _heading_content = _content %} {% assign _heading_content = _content %}
{% for level in heading_levels %} {% for level in heading_levels %}
{% capture mark_start %}<h{{ level }} id="{% endcapture %} {% assign mark_start = '<h' | append: level | append: ' id="' %}
{% capture mark_end %}</h{{ level }}>{% endcapture %} {% assign mark_end = '</h' | append: level | append: '>' %}
{% if _heading_content contains mark_start %} {% if _heading_content contains mark_start %}
{% assign _new_content = nil %} {% assign _new_content = null %}
{% assign heading_snippets = _heading_content | split: mark_start %} {% assign heading_snippets = _heading_content | split: mark_start %}
{% for snippet in heading_snippets %} {% for snippet in heading_snippets %}
@ -263,20 +244,19 @@
{% endif %} {% endif %}
{% assign id = snippet | split: '"' | first %} {% assign id = snippet | split: '"' | first %}
{% capture anchor %}<a href="#{{ id }}" class="anchor text-muted"><i class="fas fa-hashtag"></i></a>{% endcapture %} {% assign anchor = '<a href="#'
| append: id
| append: '" class="anchor text-muted"><i class="fas fa-hashtag"></i></a>'
%}
{% assign left = snippet | split: mark_end | first %} {% assign left = snippet | split: mark_end | first %}
{% assign right = snippet | slice: left.size, snippet.size %} {% assign right = snippet | slice: left.size, snippet.size %}
{% assign left = left | replace_first: '">', '"><span class="me-2">' | append: '</span>' %} {% assign left = left | replace_first: '">', '"><span class="me-2">' | append: '</span>' %}
{% assign _new_content = _new_content | append: mark_start {% assign _new_content = _new_content | append: mark_start | append: left | append: anchor | append: right %}
| append: left | append: anchor | append: right
%}
{% endfor %} {% endfor %}
{% assign _heading_content = _new_content %} {% assign _heading_content = _new_content %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}

View file

@ -78,9 +78,9 @@
<article class="col"> <article class="col">
<a href="{{ post.url | relative_url }}" class="post-preview card h-100"> <a href="{{ post.url | relative_url }}" class="post-preview card h-100">
<div class="card-body"> <div class="card-body">
{% include datetime.html date=post.date class="small" lang=include.lang %} {% include datetime.html date=post.date lang=include.lang %}
<h4 class="pt-0 my-2">{{ post.title }}</h4> <h4 class="pt-0 my-2">{{ post.title }}</h4>
<div class="text-muted small"> <div class="text-muted">
<p> <p>
{% include no-linenos.html content=post.content %} {% include no-linenos.html content=post.content %}
{{ content | markdownify | strip_html | truncate: 200 | escape }} {{ content | markdownify | strip_html | truncate: 200 | escape }}

View file

@ -6,7 +6,7 @@
{% endif %} {% endif %}
{% if enable_toc %} {% if enable_toc %}
<section id="toc-wrapper" class="ps-0 pe-4 mb-5"> <section id="toc-wrapper" class="ps-0 pe-4">
<h2 class="panel-heading ps-3 pt-2 mb-2">{{- site.data.locales[include.lang].panel.toc -}}</h2> <h2 class="panel-heading ps-3 pt-2 mb-2">{{- site.data.locales[include.lang].panel.toc -}}</h2>
<nav id="toc"></nav> <nav id="toc"></nav>
</section> </section>

View file

@ -1,8 +1,8 @@
import { basic, initSidebar, initTopbar } from './modules/layouts'; import { basic, initSidebar, initTopbar } from './modules/layouts';
import { initLocaleDatetime, imgLazy } from './modules/plugins'; import { initLocaleDatetime, loadImg } from './modules/plugins';
basic(); basic();
initSidebar(); initSidebar();
initTopbar(); initTopbar();
initLocaleDatetime(); initLocaleDatetime();
imgLazy(); loadImg();

View file

@ -126,6 +126,5 @@ export function initClipboard() {
btnCopyLink.on('mouseleave', function (e) { btnCopyLink.on('mouseleave', function (e) {
const target = $(e.target); const target = $(e.target);
target.tooltip('hide'); target.tooltip('hide');
console.log('mouse leave...');
}); });
} }

View file

@ -1,27 +0,0 @@
/**
* Set up image lazy-load
*/
function stopShimmer($node) {
$node.parent().removeClass('shimmer');
}
export function imgLazy() {
const $images = $('main img[data-src]');
if ($images.length <= 0) {
return;
}
/* Stop shimmer when image loaded */
document.addEventListener('lazyloaded', function (e) {
stopShimmer($(e.target));
});
/* Stop shimmer from cached images */
$images.each(function () {
if ($(this).hasClass('ls-is-cached')) {
stopShimmer($(this));
}
});
}

View file

@ -0,0 +1,61 @@
/**
* Setting up image lazy loading and LQIP switching
*/
const ATTR_DATA_SRC = 'data-src';
const ATTR_DATA_LQIP = 'data-lqip';
const cover = {
SHIMMER: 'shimmer',
BLUR: 'blur'
};
function removeCover(clzss) {
$(this).parent().removeClass(clzss);
}
function handleImage() {
if (!this.complete) {
return;
}
if (this.hasAttribute(ATTR_DATA_LQIP)) {
removeCover.call(this, cover.BLUR);
} else {
removeCover.call(this, cover.SHIMMER);
}
}
/**
* Switches the LQIP with the real image URL.
*/
function switchLQIP() {
const $img = $(this);
const src = $img.attr(ATTR_DATA_SRC);
$img.attr('src', encodeURI(src));
$img.removeAttr(ATTR_DATA_SRC);
}
export function loadImg() {
const $images = $('article img');
if ($images.length) {
$images.on('load', handleImage);
}
// Images loaded from the browser cache do not trigger the 'load' event
$('article img[loading="lazy"]').each(function () {
if (this.complete) {
removeCover.call(this, cover.SHIMMER);
}
});
// LQIPs set by the data URI or WebP will not trigger the 'load' event,
// so manually convert the URI to the URL of a high-resolution image.
const $lqips = $(`article img[${ATTR_DATA_LQIP}="true"]`);
if ($lqips.length) {
$lqips.each(switchLQIP);
}
}

View file

@ -1,6 +1,6 @@
export { categoryCollapse } from './components/category-collapse'; export { categoryCollapse } from './components/category-collapse';
export { initClipboard } from './components/clipboard'; export { initClipboard } from './components/clipboard';
export { imgLazy } from './components/img-lazyload'; export { loadImg } from './components/img-loading';
export { imgPopup } from './components/img-popup'; export { imgPopup } from './components/img-popup';
export { initLocaleDatetime } from './components/locale-datetime'; export { initLocaleDatetime } from './components/locale-datetime';
export { toc } from './components/toc'; export { toc } from './components/toc';

View file

@ -1,9 +1,9 @@
import { basic, initSidebar, initTopbar } from './modules/layouts'; import { basic, initSidebar, initTopbar } from './modules/layouts';
import { imgLazy, imgPopup, initClipboard } from './modules/plugins'; import { loadImg, imgPopup, initClipboard } from './modules/plugins';
basic(); basic();
initSidebar(); initSidebar();
initTopbar(); initTopbar();
imgLazy(); loadImg();
imgPopup(); imgPopup();
initClipboard(); initClipboard();

View file

@ -1,17 +1,17 @@
import { basic, initSidebar, initTopbar } from './modules/layouts'; import { basic, initSidebar, initTopbar } from './modules/layouts';
import { import {
imgLazy, loadImg,
imgPopup, imgPopup,
initLocaleDatetime, initLocaleDatetime,
initClipboard, initClipboard,
toc toc
} from './modules/plugins'; } from './modules/plugins';
basic();
initSidebar(); initSidebar();
initTopbar(); initTopbar();
imgLazy(); loadImg();
imgPopup(); imgPopup();
initLocaleDatetime(); initLocaleDatetime();
initClipboard(); initClipboard();
toc(); toc();
basic();

View file

@ -1,6 +1,5 @@
--- ---
layout: compress layout: compress
# Default layout
--- ---
<!doctype html> <!doctype html>
@ -9,14 +8,8 @@ layout: compress
{% include lang.html %} {% include lang.html %}
{% capture prefer_mode %} {% if site.theme_mode %}
{% if site.theme_mode %} {% capture prefer_mode %}data-mode="{{ site.theme_mode }}"{% endcapture %}
data-mode="{{ site.theme_mode }}"
{% endif %}
{% endcapture %}
{% if layout.tail_includes %}
{% assign has_tail = true %}
{% endif %} {% endif %}
<!-- `site.alt_lang` can specify a language different from the UI --> <!-- `site.alt_lang` can specify a language different from the UI -->
@ -27,19 +20,20 @@ layout: compress
{% include sidebar.html lang=lang %} {% include sidebar.html lang=lang %}
<div id="main-wrapper" class="d-flex justify-content-center"> <div id="main-wrapper" class="d-flex justify-content-center">
<div class="container px-xxl-5"> <div class="container d-flex flex-column px-xxl-5">
{% include topbar.html lang=lang %} {% include topbar.html lang=lang %}
<div class="row"> <div class="row flex-grow-1">
<main <main aria-label="Main Content" class="col-12 col-lg-11 col-xl-9 px-md-4">
aria-label="Main Content" {% if layout.refactor or layout.layout == 'default' %}
class="col-12 col-lg-11 col-xl-9 px-md-4{% unless has_tail %} pb-5{% endunless %}" {% include refactor-content.html content=content lang=lang %}
> {% else %}
{{ content }} {{ content }}
{% endif %}
</main> </main>
<!-- panel --> <!-- panel -->
<aside aria-label="Panel" id="panel-wrapper" class="col-xl-3 ps-2 text-muted"> <aside aria-label="Panel" id="panel-wrapper" class="col-xl-3 ps-2 mb-5 text-muted">
<div class="access"> <div class="access">
{% include_cached update-list.html lang=lang %} {% include_cached update-list.html lang=lang %}
{% include_cached trending-tags.html lang=lang %} {% include_cached trending-tags.html lang=lang %}
@ -55,12 +49,10 @@ layout: compress
<div class="row"> <div class="row">
<!-- tail --> <!-- tail -->
<div id="tail-wrapper" class="col-12 col-lg-11 col-xl-9 px-md-4"> <div id="tail-wrapper" class="col-12 col-lg-11 col-xl-9 px-md-4">
{% if has_tail %} {% for _include in layout.tail_includes %}
{% for _include in layout.tail_includes %} {% assign _include_path = _include | append: '.html' %}
{% assign _include_path = _include | append: '.html' %} {% include {{ _include_path }} lang=lang %}
{% include {{ _include_path }} lang=lang %} {% endfor %}
{% endfor %}
{% endif %}
{% include_cached footer.html lang=lang %} {% include_cached footer.html lang=lang %}
</div> </div>

View file

@ -1,5 +1,6 @@
--- ---
layout: default layout: default
refactor: true
--- ---
{% include lang.html %} {% include lang.html %}
@ -39,15 +40,13 @@ layout: default
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% capture content %} <div id="post-list" class="flex-grow-1 px-xl-1">
{% for post in posts %} {% for post in posts %}
<article class="card-wrapper"> <article class="card-wrapper card">
<a href="{{ post.url | relative_url }}" class="card post-preview flex-md-row-reverse"> <a href="{{ post.url | relative_url }}" class="post-preview row g-0 flex-md-row-reverse">
{% if post.image %} {% assign card_body_col = '12' %}
{% if post.image.lqip %}
{% capture lqip %}lqip="{{ post.image.lqip }}"{% endcapture %}
{% endif %}
{% if post.image %}
{% assign src = post.image.path | default: post.image %} {% assign src = post.image.path | default: post.image %}
{% unless src contains '//' %} {% unless src contains '//' %}
{% assign src = post.img_path | append: '/' | append: src | replace: '//', '/' %} {% assign src = post.img_path | append: '/' | append: src | replace: '//', '/' %}
@ -55,54 +54,62 @@ layout: default
{% assign alt = post.image.alt | xml_escape | default: 'Preview Image' %} {% assign alt = post.image.alt | xml_escape | default: 'Preview Image' %}
<img src="{{ src }}" w="17" h="10" alt="{{ alt }}" {{ lqip }}> {% assign lqip = null %}
{% if post.image.lqip %}
{% capture lqip %}lqip="{{ post.image.lqip }}"{% endcapture %}
{% endif %}
<div class="col-md-5">
<img src="{{ src }}" alt="{{ alt }}" {{ lqip }}>
</div>
{% assign card_body_col = '7' %}
{% endif %} {% endif %}
<div class="card-body d-flex flex-column"> <div class="col-md-{{ card_body_col }}">
<h1 class="card-title my-2 mt-md-0">{{ post.title }}</h1> <div class="card-body d-flex flex-column">
<h1 class="card-title my-2 mt-md-0">{{ post.title }}</h1>
<div class="card-text content mt-0 mb-2"> <div class="card-text content mt-0 mb-3">
<p> <p>
{% include no-linenos.html content=post.content %} {% include no-linenos.html content=post.content %}
{{ content | markdownify | strip_html | truncate: 200 | escape }} {{ content | markdownify | strip_html | truncate: 200 | escape }}
</p> </p>
</div>
<div class="post-meta flex-grow-1 d-flex align-items-end">
<div class="me-auto">
<!-- posted date -->
<i class="far fa-calendar fa-fw me-1"></i>
{% include datetime.html date=post.date lang=lang %}
<!-- categories -->
{% if post.categories.size > 0 %}
<i class="far fa-folder-open fa-fw me-1"></i>
<span class="categories">
{% for category in post.categories %}
{{ category }}
{%- unless forloop.last -%},{%- endunless -%}
{% endfor %}
</span>
{% endif %}
</div> </div>
{% if post.pin %} <div class="post-meta flex-grow-1 d-flex align-items-end">
<div class="pin ms-1"> <div class="me-auto">
<i class="fas fa-thumbtack fa-fw"></i> <!-- posted date -->
<span>{{ site.data.locales[lang].post.pin_prompt }}</span> <i class="far fa-calendar fa-fw me-1"></i>
{% include datetime.html date=post.date lang=lang %}
<!-- categories -->
{% if post.categories.size > 0 %}
<i class="far fa-folder-open fa-fw me-1"></i>
<span class="categories">
{% for category in post.categories %}
{{ category }}
{%- unless forloop.last -%},{%- endunless -%}
{% endfor %}
</span>
{% endif %}
</div> </div>
{% endif %}
{% if post.pin %}
<div class="pin ms-1">
<i class="fas fa-thumbtack fa-fw"></i>
<span>{{ site.data.locales[lang].post.pin_prompt }}</span>
</div>
{% endif %}
</div>
<!-- .post-meta -->
</div> </div>
<!-- .post-meta --> <!-- .card-body -->
</div> </div>
<!-- .card-body -->
</a> </a>
</article> </article>
{% endfor %} {% endfor %}
{% endcapture %}
<div id="post-list" class="flex-grow-1 pe-xl-2">
{% include refactor-content.html content=content lang=lang %}
</div> </div>
<!-- #post-list --> <!-- #post-list -->

View file

@ -2,13 +2,7 @@
layout: default layout: default
--- ---
{% capture _content %} {% include lang.html %}
{% if layout.refactor or page.layout == 'page' %}
{% include refactor-content.html content=content lang=lang %}
{% else %}
{{ content }}
{% endif %}
{% endcapture %}
<article class="px-1"> <article class="px-1">
{% if page.layout == 'page' or page.collection == 'tabs' %} {% if page.layout == 'page' or page.collection == 'tabs' %}
@ -18,9 +12,9 @@ layout: default
{{ title }} {{ title }}
</h1> </h1>
<div class="content"> <div class="content">
{{ _content }} {{ content }}
</div> </div>
{% else %} {% else %}
{{ _content }} {{ content }}
{% endif %} {% endif %}
</article> </article>

View file

@ -1,5 +1,5 @@
--- ---
layout: page layout: default
refactor: true refactor: true
panel_includes: panel_includes:
- toc - toc
@ -11,125 +11,125 @@ tail_includes:
{% include lang.html %} {% include lang.html %}
<header> <article class="px-1">
<h1 data-toc-skip>{{ page.title }}</h1> <header>
<h1 data-toc-skip>{{ page.title }}</h1>
<div class="post-meta text-muted"> <div class="post-meta text-muted">
<!-- published date --> <!-- published date -->
<span>
{{ site.data.locales[lang].post.posted }}
{% include datetime.html date=page.date tooltip=true lang=lang %}
</span>
<!-- lastmod date -->
{% if page.last_modified_at and page.last_modified_at != page.date %}
<span> <span>
{{ site.data.locales[lang].post.updated }} {{ site.data.locales[lang].post.posted }}
{% include datetime.html date=page.last_modified_at tooltip=true lang=lang %} {% include datetime.html date=page.date tooltip=true lang=lang %}
</span> </span>
{% endif %}
{% if page.image %} <!-- lastmod date -->
{% capture src %}src="{{ page.image.path | default: page.image }}"{% endcapture %} {% if page.last_modified_at and page.last_modified_at != page.date %}
{% capture class %}class="preview-img{% if page.image.no_bg %}{{ ' no-bg' }}{% endif %}"{% endcapture %} <span>
{% capture alt %}alt="{{ page.image.alt | xml_escape | default: "Preview Image" }}"{% endcapture %} {{ site.data.locales[lang].post.updated }}
{% include datetime.html date=page.last_modified_at tooltip=true lang=lang %}
{% capture lqip %} </span>
{% if page.image.lqip %}
lqip="{{ page.image.lqip }}"
{% endif %} {% endif %}
{% endcapture %}
<div class="mt-3 mb-3"> {% if page.image %}
<img {{ src }} {{ class }} {{ alt }} w="1200" h="630" {{ lqip | strip }}> {% capture src %}src="{{ page.image.path | default: page.image }}"{% endcapture %}
{%- if page.image.alt -%} {% capture class %}class="preview-img{% if page.image.no_bg %}{{ ' no-bg' }}{% endif %}"{% endcapture %}
<figcaption class="text-center pt-2 pb-2">{{ page.image.alt }}</figcaption> {% capture alt %}alt="{{ page.image.alt | xml_escape | default: "Preview Image" }}"{% endcapture %}
{%- endif -%}
{% if page.image.lqip %}
{%- capture lqip -%}lqip="{{ page.image.lqip }}"{%- endcapture -%}
{% endif %}
<div class="mt-3 mb-3">
<img {{ src }} {{ class }} {{ alt }} w="1200" h="630" {{ lqip }}>
{%- if page.image.alt -%}
<figcaption class="text-center pt-2 pb-2">{{ page.image.alt }}</figcaption>
{%- endif -%}
</div>
{% 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 %}
<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>
</span>
<!-- read time -->
{% include read-time.html content=content prompt=true lang=lang %}
</div>
<!-- .d-flex -->
</div>
<!-- .post-meta -->
</header>
<div class="content">
{{ content }}
</div>
<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 %}
</div> </div>
{% endif %} {% endif %}
<div class="d-flex justify-content-between"> <!-- tags -->
<!-- author(s) --> {% if page.tags.size > 0 %}
<span> <div class="post-tags">
{% if page.author %} <i class="fa fa-tags fa-fw me-1"></i>
{% assign authors = page.author %} {% for tag in page.tags %}
{% elsif page.authors %} <a
{% assign authors = page.authors %} href="{{ site.baseurl }}/tags/{{ tag | slugify | url_encode }}/"
{% endif %} class="post-tag no-text-decoration"
>
{{- tag -}}
</a>
{% endfor %}
</div>
{% endif %}
{{ site.data.locales[lang].post.written_by }} <div
class="
<em> post-tail-bottom
{% if authors %} d-flex justify-content-between align-items-center mt-5 pb-2
{% for author in authors %} "
<a href="{{ site.data.authors[author].url }}">{{ site.data.authors[author].name }}</a> >
{% unless forloop.last %}{{ '</em>, <em>' }}{% endunless %} <div class="license-wrapper">
{% endfor %} {% if site.data.locales[lang].copyright.license.template %}
{% else %} {% capture _replacement %}
<a href="{{ site.social.links[0] }}">{{ site.social.name }}</a>
{% endif %}
</em>
</span>
<!-- read time -->
{% include read-time.html content=content prompt=true lang=lang %}
</div>
<!-- .d-flex -->
</div>
<!-- .post-meta -->
</header>
<div class="content">
{{ content }}
</div>
<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 %}
</div>
{% endif %}
<!-- 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>
{% endfor %}
</div>
{% 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 %}
<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 }} {{ site.data.locales[lang].copyright.license.template | replace: ':LICENSE_NAME', _replacement }}
{% endif %} {% endif %}
</div> </div>
{% include post-sharing.html lang=lang %} {% include post-sharing.html lang=lang %}
</div>
<!-- .post-tail-bottom -->
</div> </div>
<!-- .post-tail-bottom --> <!-- div.post-tail-wrapper -->
</div> </article>
<!-- div.post-tail-wrapper -->

View file

@ -17,13 +17,17 @@ This post is to show Markdown syntax rendering on [**Chirpy**](https://github.co
## Headings ## Headings
<h1 class="mt-5">H1 - heading</h1> # H1 - heading
{: .mt-4 .mb-0 }
<h2 data-toc-skip>H2 - heading</h2> ## H2 - heading
{: data-toc-skip='' .mt-4 .mb-0 }
<h3 data-toc-skip>H3 - heading</h3> ### H3 - heading
{: data-toc-skip='' .mt-4 .mb-0 }
<h4 data-toc-skip>H4 - heading</h4> #### H4 - heading
{: data-toc-skip='' .mt-4 }
## Paragraph ## Paragraph

View file

@ -107,9 +107,33 @@ math: true
--- ---
``` ```
After enabling the mathematical feature, you can add math equations with the following syntax:
- **Block math** should be added with `$$ math $$` with **mandatory** blank lines before and after `$$`
- **Inline math** (in lines) should be added with `$$ math $$` without any blank line before or after `$$`
- **Inline math** (in lists) should be added with `\$$ math $$`
```markdown
<!-- Block math, keep all blank lines -->
$$
LaTeX_math_expression
$$
<!-- Inline math in lines, NO blank lines -->
"Lorem ipsum dolor sit amet, $$ LaTeX_math_expression $$ consectetur adipiscing elit."
<!-- Inline math in lists, escape the first `$` -->
1. \$$ LaTeX_math_expression $$
2. \$$ LaTeX_math_expression $$
3. \$$ LaTeX_math_expression $$
```
## Mermaid ## Mermaid
[**Mermaid**](https://github.com/mermaid-js/mermaid) is a great diagrams generation tool. To enable it on your post, add the following to the YAML block: [**Mermaid**](https://github.com/mermaid-js/mermaid) is a great diagram generation tool. To enable it on your post, add the following to the YAML block:
```yaml ```yaml
--- ---
@ -123,7 +147,7 @@ Then you can use it like other markdown languages: surround the graph code with
### Caption ### Caption
Add italics to the next line of an imagethen it will become the caption and appear at the bottom of the image: Add italics to the next line of an image, then it will become the caption and appear at the bottom of the image:
```markdown ```markdown
![img-description](/path/to/image) ![img-description](/path/to/image)

View file

@ -70,9 +70,9 @@ Social contact options are displayed at the bottom of the sidebar. You can turn
### Customizing Stylesheet ### Customizing Stylesheet
If you need to customize the stylesheet, copy the theme's `assets/css/style.scss`{: .filepath} to the same path on your Jekyll site, and then add the custom style at the end of it. If you need to customize the stylesheet, copy the theme's `assets/css/jekyll-theme-chirpy.scss`{: .filepath} to the same path on your Jekyll site, and then add the custom style at the end of it.
Starting with version `4.1.0`, if you want to overwrite the SASS variables defined in `_sass/addon/variables.scss`{: .filepath}, copy the main sass file `_sass/jekyll-theme-chirpy.scss`{: .filepath} into the `_sass`{: .filepath} directory in your site's source, then create a new file `_sass/variables-hook.scss`{: .filepath} and assign new value. Starting with version `6.2.0`, if you want to overwrite the SASS variables defined in `_sass/addon/variables.scss`{: .filepath}, copy the main sass file `_sass/main.scss`{: .filepath} into the `_sass`{: .filepath} directory in your site's source, then create a new file `_sass/variables-hook.scss`{: .filepath} and assign new value.
### Customing Static Assets ### Customing Static Assets
@ -88,15 +88,6 @@ You may want to preview the site contents before publishing, so just run it by:
$ bundle exec jekyll s $ bundle exec jekyll s
``` ```
Or run the site on Docker with the following command:
```console
$ docker run -it --rm \
--volume="$PWD:/srv/jekyll" \
-p 4000:4000 jekyll/jekyll \
jekyll serve
```
After a few seconds, the local service will be published at _<http://127.0.0.1:4000>_. After a few seconds, the local service will be published at _<http://127.0.0.1:4000>_.
## Deployment ## Deployment
@ -136,16 +127,6 @@ Go to the root of the source project, and build your site as follows:
$ JEKYLL_ENV=production bundle exec jekyll b $ JEKYLL_ENV=production bundle exec jekyll b
``` ```
Or build the site on Docker:
```console
$ docker run -it --rm \
--env JEKYLL_ENV=production \
--volume="$PWD:/srv/jekyll" \
jekyll/jekyll \
jekyll build
```
Unless you specified the output path, the generated site files will be placed in folder `_site`{: .filepath} of the project's root directory. Now you should upload those files to the target server. Unless you specified the output path, the generated site files will be placed in folder `_site`{: .filepath} of the project's root directory. Now you should upload those files to the target server.
[nodejs]: https://nodejs.org/ [nodejs]: https://nodejs.org/

View file

@ -73,52 +73,11 @@ img {
height: auto; height: auto;
transition: all 0.35s ease-in-out; transition: all 0.35s ease-in-out;
&[data-src] { .blur & {
&[data-lqip='true'] { $blur: 20px;
&.lazyload,
&.lazyloading {
-webkit-filter: blur(20px);
filter: blur(20px);
}
}
&:not([data-lqip='true']) { -webkit-filter: blur($blur);
&.lazyload, filter: blur($blur);
&.lazyloading {
background: var(--img-bg);
}
&.lazyloaded {
-webkit-animation: fade-in 0.35s ease-in;
animation: fade-in 0.35s ease-in;
}
}
&.shadow {
-webkit-filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.08));
filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.08));
box-shadow: none !important; /* cover the Bootstrap 4.6.1 styles */
}
@extend %img-caption;
}
@-webkit-keyframes fade-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes fade-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
} }
} }
@ -173,12 +132,11 @@ kbd {
} }
footer { footer {
font-size: 0.8rem;
background-color: var(--main-bg); background-color: var(--main-bg);
height: $footer-height; height: $footer-height;
border-top: 1px solid var(--main-border-color); border-top: 1px solid var(--main-border-color);
@extend %text-color; @extend %text-xs;
a { a {
@extend %text-highlight; @extend %text-highlight;
@ -189,7 +147,6 @@ footer {
} }
p { p {
line-height: 1.75;
text-align: center; text-align: center;
margin-bottom: 0; margin-bottom: 0;
} }
@ -273,6 +230,8 @@ i {
margin-bottom: 0.3rem; margin-bottom: 0.3rem;
} }
@extend %sup-fn-target;
> p { > p {
margin-left: 0.25em; margin-left: 0.25em;
margin-top: 0; margin-top: 0;
@ -287,10 +246,13 @@ i {
@include pl-pr(2px); @include pl-pr(2px);
border-bottom-style: none !important; border-bottom-style: none !important;
transition: background-color 1.5s ease-in-out;
} }
} }
sup {
@extend %sup-fn-target;
}
.reversefootnote { .reversefootnote {
@at-root a#{&} { @at-root a#{&} {
font-size: 0.6rem; font-size: 0.6rem;
@ -344,6 +306,27 @@ i {
/* --- post --- */ /* --- post --- */
.preview-img {
aspect-ratio: 40 / 21;
width: 100%;
height: 100%;
overflow: hidden;
@extend %rounded;
&:not(.no-bg) {
background: var(--img-bg);
}
img {
height: 100%;
-o-object-fit: cover;
object-fit: cover;
@extend %rounded;
}
}
.post-preview { .post-preview {
@extend %rounded; @extend %rounded;
@ -372,7 +355,6 @@ i {
main { main {
line-height: 1.75; line-height: 1.75;
min-height: calc(100vh - $topbar-height - $footer-height);
h1 { h1 {
margin-top: 2rem; margin-top: 2rem;
@ -380,7 +362,6 @@ main {
} }
p { p {
> img[data-src],
> a.popup { > a.popup {
&:not(.normal):not(.left):not(.right) { &:not(.normal):not(.left):not(.right) {
@include align-center; @include align-center;
@ -398,7 +379,7 @@ main {
} }
.post-meta { .post-meta {
font-size: 0.85rem; @extend %text-sm;
a { a {
&:not([class]):hover { &:not([class]):hover {
@ -534,14 +515,15 @@ main {
background: var(--shimmer-bg); background: var(--shimmer-bg);
height: 100%; height: 100%;
width: 100%; width: 100%;
-webkit-animation: shimmer 1s infinite; -webkit-animation: shimmer 1.3s infinite;
animation: shimmer 1s infinite; animation: shimmer 1.3s infinite;
} }
@-webkit-keyframes shimmer { @-webkit-keyframes shimmer {
0% { 0% {
transform: translateX(-100%); transform: translateX(-100%);
} }
100% { 100% {
transform: translateX(100%); transform: translateX(100%);
} }
@ -551,6 +533,7 @@ main {
0% { 0% {
transform: translateX(-100%); transform: translateX(-100%);
} }
100% { 100% {
transform: translateX(100%); transform: translateX(100%);
} }
@ -689,7 +672,6 @@ mjx-container {
/* --- sidebar layout --- */ /* --- sidebar layout --- */
$sidebar-display: 'sidebar-display'; $sidebar-display: 'sidebar-display';
$btn-gap: 0.8rem; // for the bottom icons
$btn-border-width: 3px; $btn-border-width: 3px;
$btn-mb: 0.5rem; $btn-mb: 0.5rem;
@ -834,9 +816,11 @@ $btn-mb: 0.5rem;
padding-right: 1rem; padding-right: 1rem;
margin-bottom: 1.5rem; margin-bottom: 1.5rem;
$btn-size: 1.75rem;
%button { %button {
width: 1.75rem; width: $btn-size;
height: 1.75rem; height: $btn-size;
margin-bottom: $btn-mb; // multi line gap margin-bottom: $btn-mb; // multi line gap
border-radius: 50%; border-radius: 50%;
color: var(--sidebar-btn-color); color: var(--sidebar-btn-color);
@ -858,12 +842,12 @@ $btn-mb: 0.5rem;
@extend %clickable-transition; @extend %clickable-transition;
&:not(:last-child) { &:not(:last-child) {
margin-right: $btn-gap; margin-right: $sb-btn-gap;
} }
} }
i { i {
line-height: 1.75rem; line-height: $btn-size;
} }
.mode-toggle { .mode-toggle {
@ -877,7 +861,7 @@ $btn-mb: 0.5rem;
.icon-border { .icon-border {
@extend %no-cursor; @extend %no-cursor;
@include ml-mr(calc(($btn-gap - $btn-border-width) / 2)); @include ml-mr(calc(($sb-btn-gap - $btn-border-width) / 2));
background-color: var(--sidebar-btn-color); background-color: var(--sidebar-btn-color);
content: ''; content: '';
@ -1121,12 +1105,16 @@ search {
} }
} }
/* --- main wrapper --- */ /* --- basic wrappers --- */
#main-wrapper { #main-wrapper {
position: relative; position: relative;
@include pl-pr(0); @include pl-pr(0);
> .container {
min-height: 100vh;
}
} }
#topbar-wrapper.row, #topbar-wrapper.row,
@ -1135,6 +1123,12 @@ search {
@include ml-mr(0); @include ml-mr(0);
} }
#tail-wrapper {
> :not(script) {
margin-top: 3rem;
}
}
/* --- button back-to-top --- */ /* --- button back-to-top --- */
#back-to-top { #back-to-top {
@ -1270,10 +1264,6 @@ search {
} }
} }
main {
min-height: calc(100vh - $topbar-height - $footer-height-large);
}
footer { footer {
@include slide; @include slide;
@ -1287,7 +1277,7 @@ search {
} }
#main-wrapper { #main-wrapper {
transform: translateX(#{$sidebar-width}); transform: translateX($sidebar-width);
} }
#back-to-top { #back-to-top {
@ -1298,8 +1288,8 @@ search {
#sidebar { #sidebar {
@include slide; @include slide;
transform: translateX(-#{$sidebar-width}); /* hide */ transform: translateX(-$sidebar-width); /* hide */
-webkit-transform: translateX(-#{$sidebar-width}); -webkit-transform: translateX(-$sidebar-width);
} }
#main-wrapper { #main-wrapper {
@ -1474,7 +1464,7 @@ search {
@media all and (min-width: 1400px) { @media all and (min-width: 1400px) {
#back-to-top { #back-to-top {
right: calc((100vw - #{$sidebar-width} - 1140px) / 2 + 3rem); right: calc((100vw - $sidebar-width - 1140px) / 2 + 3rem);
} }
} }
@ -1491,7 +1481,7 @@ search {
search { search {
margin-right: calc( margin-right: calc(
#{$main-content-max-width} * 0.25 - #{$search-max-width} - 0.75rem $main-content-max-width / 4 - $search-max-width - 0.75rem
); );
} }
@ -1508,15 +1498,13 @@ search {
#back-to-top { #back-to-top {
right: calc( right: calc(
(100vw - #{$sidebar-width-large} - #{$main-content-max-width}) / 2 + 2rem (100vw - $sidebar-width-large - $main-content-max-width) / 2 + 2rem
); );
} }
#sidebar { #sidebar {
width: $sidebar-width-large; width: $sidebar-width-large;
$icon-gap: 1rem; // for the bottom icons
.profile-wrapper { .profile-wrapper {
margin-top: 3.5rem; margin-top: 3.5rem;
margin-bottom: 2.5rem; margin-bottom: 2.5rem;
@ -1534,11 +1522,11 @@ search {
margin-bottom: 1.75rem; margin-bottom: 1.75rem;
a:not(:last-child) { a:not(:last-child) {
margin-right: $icon-gap; margin-right: $sb-btn-gap-lg;
} }
.icon-border { .icon-border {
@include ml-mr(calc(($icon-gap - $btn-border-width) / 2)); @include ml-mr(calc(($sb-btn-gap-lg - $btn-border-width) / 2));
} }
} }
} }

View file

@ -123,10 +123,28 @@
} }
%text-highlight { %text-highlight {
color: inherit; color: var(--text-muted-hightlight-color);
font-weight: 600; font-weight: 600;
} }
%text-sm {
font-size: 0.85rem;
}
%text-xs {
font-size: 0.8rem;
}
%sup-fn-target {
&:target {
background-color: var(--footnote-target-bg);
width: -moz-fit-content;
width: -webkit-fit-content;
width: fit-content;
transition: background-color 1.75s ease-in-out;
}
}
/* ---------- scss mixin --------- */ /* ---------- scss mixin --------- */
@mixin mt-mb($value) { @mixin mt-mb($value) {

View file

@ -186,7 +186,7 @@ div {
align-items: center; align-items: center;
height: $code-header-height; height: $code-header-height;
margin-left: 0.75rem; margin-left: 0.75rem;
margin-right: 0.5rem; margin-right: 0.25rem;
/* the label block */ /* the label block */
span { span {
@ -267,7 +267,7 @@ div {
.code-header { .code-header {
@include ml-mr(0); @include ml-mr(0);
$dot-margin: calc($code-header-height / 2); $dot-margin: 1rem;
&::before { &::before {
content: ''; content: '';

View file

@ -6,6 +6,8 @@
$sidebar-width: 260px !default; /* the basic width */ $sidebar-width: 260px !default; /* the basic width */
$sidebar-width-large: 300px !default; /* screen width: >= 1650px */ $sidebar-width-large: 300px !default; /* screen width: >= 1650px */
$sb-btn-gap: 0.8rem !default;
$sb-btn-gap-lg: 1rem !default;
/* other framework sizes */ /* other framework sizes */
@ -14,8 +16,7 @@ $search-max-width: 200px !default;
$footer-height: 5rem !default; $footer-height: 5rem !default;
$footer-height-large: 6rem !default; /* screen width: < 850px */ $footer-height-large: 6rem !default; /* screen width: < 850px */
$main-content-max-width: 1250px !default; $main-content-max-width: 1250px !default;
$bottom-min-height: 35rem !default; $base-radius: 0.625rem !default;
$base-radius: 0.5rem !default;
$back2top-size: 2.75rem !default; $back2top-size: 2.75rem !default;
/* syntax highlight */ /* syntax highlight */

View file

@ -24,18 +24,22 @@
.highlight table td { .highlight table td {
padding: 5px; padding: 5px;
} }
.highlight table pre { .highlight table pre {
margin: 0; margin: 0;
} }
.highlight, .highlight,
.highlight .w { .highlight .w {
color: #d0d0d0; color: #d0d0d0;
background-color: #151515; background-color: #151515;
} }
.highlight .err { .highlight .err {
color: #151515; color: #151515;
background-color: #ac4142; background-color: #ac4142;
} }
.highlight .c, .highlight .c,
.highlight .ch, .highlight .ch,
.highlight .cd, .highlight .cd,
@ -45,32 +49,40 @@
.highlight .cs { .highlight .cs {
color: #848484; color: #848484;
} }
.highlight .cp { .highlight .cp {
color: #f4bf75; color: #f4bf75;
} }
.highlight .nt { .highlight .nt {
color: #f4bf75; color: #f4bf75;
} }
.highlight .o, .highlight .o,
.highlight .ow { .highlight .ow {
color: #d0d0d0; color: #d0d0d0;
} }
.highlight .p, .highlight .p,
.highlight .pi { .highlight .pi {
color: #d0d0d0; color: #d0d0d0;
} }
.highlight .gi { .highlight .gi {
color: #90a959; color: #90a959;
} }
.highlight .gd { .highlight .gd {
color: #f08a8b; color: #f08a8b;
background-color: #320000; background-color: #320000;
} }
.highlight .gh { .highlight .gh {
color: #6a9fb5; color: #6a9fb5;
background-color: #151515; background-color: #151515;
font-weight: bold; font-weight: bold;
} }
.highlight .k, .highlight .k,
.highlight .kn, .highlight .kn,
.highlight .kp, .highlight .kp,
@ -78,15 +90,19 @@
.highlight .kv { .highlight .kv {
color: #aa759f; color: #aa759f;
} }
.highlight .kc { .highlight .kc {
color: #d28445; color: #d28445;
} }
.highlight .kt { .highlight .kt {
color: #d28445; color: #d28445;
} }
.highlight .kd { .highlight .kd {
color: #d28445; color: #d28445;
} }
.highlight .s, .highlight .s,
.highlight .sb, .highlight .sb,
.highlight .sc, .highlight .sc,
@ -98,30 +114,39 @@
.highlight .s1 { .highlight .s1 {
color: #90a959; color: #90a959;
} }
.highlight .sa { .highlight .sa {
color: #aa759f; color: #aa759f;
} }
.highlight .sr { .highlight .sr {
color: #75b5aa; color: #75b5aa;
} }
.highlight .si { .highlight .si {
color: #b76d45; color: #b76d45;
} }
.highlight .se { .highlight .se {
color: #b76d45; color: #b76d45;
} }
.highlight .nn { .highlight .nn {
color: #f4bf75; color: #f4bf75;
} }
.highlight .nc { .highlight .nc {
color: #f4bf75; color: #f4bf75;
} }
.highlight .no { .highlight .no {
color: #f4bf75; color: #f4bf75;
} }
.highlight .na { .highlight .na {
color: #6a9fb5; color: #6a9fb5;
} }
.highlight .m, .highlight .m,
.highlight .mb, .highlight .mb,
.highlight .mf, .highlight .mf,
@ -132,6 +157,7 @@
.highlight .mx { .highlight .mx {
color: #90a959; color: #90a959;
} }
.highlight .ss { .highlight .ss {
color: #90a959; color: #90a959;
} }

View file

@ -24,14 +24,17 @@
.highlight table td { .highlight table td {
padding: 5px; padding: 5px;
} }
.highlight table pre { .highlight table pre {
margin: 0; margin: 0;
} }
.highlight, .highlight,
.highlight .w { .highlight .w {
color: #24292f; color: #24292f;
background-color: #f6f8fa; background-color: #f6f8fa;
} }
.highlight .k, .highlight .k,
.highlight .kd, .highlight .kd,
.highlight .kn, .highlight .kn,
@ -41,41 +44,53 @@
.highlight .kv { .highlight .kv {
color: #cf222e; color: #cf222e;
} }
.highlight .gr { .highlight .gr {
color: #f6f8fa; color: #f6f8fa;
} }
.highlight .gd { .highlight .gd {
color: #82071e; color: #82071e;
background-color: #ffebe9; background-color: #ffebe9;
} }
.highlight .nb { .highlight .nb {
color: #953800; color: #953800;
} }
.highlight .nc { .highlight .nc {
color: #953800; color: #953800;
} }
.highlight .no { .highlight .no {
color: #953800; color: #953800;
} }
.highlight .nn { .highlight .nn {
color: #953800; color: #953800;
} }
.highlight .sr { .highlight .sr {
color: #116329; color: #116329;
} }
.highlight .na { .highlight .na {
color: #116329; color: #116329;
} }
.highlight .nt { .highlight .nt {
color: #116329; color: #116329;
} }
.highlight .gi { .highlight .gi {
color: #116329; color: #116329;
background-color: #dafbe1; background-color: #dafbe1;
} }
.highlight .kc { .highlight .kc {
color: #0550ae; color: #0550ae;
} }
.highlight .l, .highlight .l,
.highlight .ld, .highlight .ld,
.highlight .m, .highlight .m,
@ -88,21 +103,27 @@
.highlight .mx { .highlight .mx {
color: #0550ae; color: #0550ae;
} }
.highlight .sb { .highlight .sb {
color: #0550ae; color: #0550ae;
} }
.highlight .bp { .highlight .bp {
color: #0550ae; color: #0550ae;
} }
.highlight .ne { .highlight .ne {
color: #0550ae; color: #0550ae;
} }
.highlight .nl { .highlight .nl {
color: #0550ae; color: #0550ae;
} }
.highlight .py { .highlight .py {
color: #0550ae; color: #0550ae;
} }
.highlight .nv, .highlight .nv,
.highlight .vc, .highlight .vc,
.highlight .vg, .highlight .vg,
@ -110,18 +131,22 @@
.highlight .vm { .highlight .vm {
color: #0550ae; color: #0550ae;
} }
.highlight .o, .highlight .o,
.highlight .ow { .highlight .ow {
color: #0550ae; color: #0550ae;
} }
.highlight .gh { .highlight .gh {
color: #0550ae; color: #0550ae;
font-weight: bold; font-weight: bold;
} }
.highlight .gu { .highlight .gu {
color: #0550ae; color: #0550ae;
font-weight: bold; font-weight: bold;
} }
.highlight .s, .highlight .s,
.highlight .sa, .highlight .sa,
.highlight .sc, .highlight .sc,
@ -135,17 +160,21 @@
.highlight .ss { .highlight .ss {
color: #0a3069; color: #0a3069;
} }
.highlight .nd { .highlight .nd {
color: #8250df; color: #8250df;
} }
.highlight .nf, .highlight .nf,
.highlight .fm { .highlight .fm {
color: #8250df; color: #8250df;
} }
.highlight .err { .highlight .err {
color: #f6f8fa; color: #f6f8fa;
background-color: #82071e; background-color: #82071e;
} }
.highlight .c, .highlight .c,
.highlight .ch, .highlight .ch,
.highlight .cd, .highlight .cd,
@ -156,22 +185,28 @@
.highlight .cs { .highlight .cs {
color: #68717a; color: #68717a;
} }
.highlight .gl { .highlight .gl {
color: #68717a; color: #68717a;
} }
.highlight .gt { .highlight .gt {
color: #68717a; color: #68717a;
} }
.highlight .ni { .highlight .ni {
color: #24292f; color: #24292f;
} }
.highlight .si { .highlight .si {
color: #24292f; color: #24292f;
} }
.highlight .ge { .highlight .ge {
color: #24292f; color: #24292f;
font-style: italic; font-style: italic;
} }
.highlight .gs { .highlight .gs {
color: #24292f; color: #24292f;
font-weight: bold; font-weight: bold;

View file

@ -11,6 +11,7 @@
/* Common color */ /* Common color */
--text-color: rgb(175, 176, 177); --text-color: rgb(175, 176, 177);
--text-muted-color: #868686; --text-muted-color: #868686;
--text-muted-hightlight-color: #aeaeae;
--heading-color: #cccccc; --heading-color: #cccccc;
--label-color: #a7a7a7; --label-color: #a7a7a7;
--blockquote-border-color: rgb(66, 66, 66); --blockquote-border-color: rgb(66, 66, 66);

View file

@ -11,6 +11,7 @@
/* Common color */ /* Common color */
--text-color: #34343c; --text-color: #34343c;
--text-muted-color: #757575; --text-muted-color: #757575;
--text-muted-hightlight-color: inherit;
--heading-color: #2a2a2a; --heading-color: #2a2a2a;
--label-color: #585858; --label-color: #585858;
--blockquote-border-color: #eeeeee; --blockquote-border-color: #eeeeee;

View file

@ -6,8 +6,6 @@
margin-top: 2rem; margin-top: 2rem;
.card-wrapper { .card-wrapper {
display: block;
&:hover { &:hover {
text-decoration: none; text-decoration: none;
} }
@ -18,27 +16,23 @@
} }
.card { .card {
border: 0;
background: none;
%img-radius { %img-radius {
border-radius: $base-radius $base-radius 0 0; border-radius: $base-radius $base-radius 0 0;
} }
.preview-img { .preview-img {
height: 10rem;
@extend %img-radius; @extend %img-radius;
img { img {
width: 100%;
height: 100%;
-o-object-fit: cover;
object-fit: cover;
@extend %img-radius; @extend %img-radius;
} }
} }
.card-body { .card-body {
min-height: 10.5rem; height: 100%;
padding: 1rem; padding: 1rem;
.card-title { .card-title {
@ -136,20 +130,13 @@
/* Tablet */ /* Tablet */
@media all and (min-width: 768px) { @media all and (min-width: 768px) {
%img-radius {
border-radius: 0 $base-radius $base-radius 0;
}
#post-list { #post-list {
%img-radius {
border-radius: 0 $base-radius $base-radius 0;
}
.card { .card {
.preview-img {
width: 20rem;
height: 11.55rem; // can hold 2 lines each for title and content
}
.card-body { .card-body {
min-height: 10.75rem;
width: 60%;
padding: 1.75rem 1.75rem 1.25rem 1.75rem; padding: 1.75rem 1.75rem 1.25rem 1.75rem;
.card-text { .card-text {

View file

@ -22,30 +22,6 @@
padding-right: $pr; padding-right: $pr;
} }
%text-color {
color: var(--text-color);
}
.preview-img {
overflow: hidden;
aspect-ratio: 40 / 21;
@extend %rounded;
&:not(.no-bg) {
img.lazyloaded {
background: var(--img-bg);
}
}
img {
-o-object-fit: cover;
object-fit: cover;
@extend %rounded;
}
}
h1 + .post-meta { h1 + .post-meta {
> span + span::before { > span + span::before {
@include dot; @include dot;
@ -53,7 +29,7 @@ h1 + .post-meta {
em, em,
time { time {
color: var(--text-color); @extend %text-highlight;
} }
em { em {
@ -64,13 +40,10 @@ h1 + .post-meta {
} }
.post-tail-wrapper { .post-tail-wrapper {
@extend %text-sm;
margin-top: 6rem; margin-top: 6rem;
border-bottom: 1px double var(--main-border-color); border-bottom: 1px double var(--main-border-color);
font-size: 0.85rem;
.post-tail-bottom a {
color: inherit;
}
.license-wrapper { .license-wrapper {
line-height: 1.2rem; line-height: 1.2rem;
@ -84,7 +57,7 @@ h1 + .post-meta {
} }
span:last-child { span:last-child {
font-size: 0.85rem; @extend %text-sm;
} }
} /* .license-wrapper */ } /* .license-wrapper */
@ -324,6 +297,7 @@ h1 + .post-meta {
time { time {
@extend %normal-font-style; @extend %normal-font-style;
@extend %text-xs;
color: var(--text-muted-color); color: var(--text-muted-color);
} }
@ -340,27 +314,18 @@ h1 + .post-meta {
.card { .card {
h4 { h4 {
@extend %text-color;
@extend %text-clip; @extend %text-clip;
} }
} }
} }
#tail-wrapper { /* stylelint-disable-next-line selector-id-pattern */
min-height: 2rem; #disqus_thread {
min-height: 8.5rem;
}
> *:not(:last-child) { .utterances {
margin-top: 3rem; max-width: 100%;
}
> *:nth-last-child(2) {
margin-bottom: 3rem;
}
/* stylelint-disable-next-line selector-id-pattern */
#disqus_thread {
min-height: 8.5rem;
}
} }
%btn-share-hovor { %btn-share-hovor {
@ -376,10 +341,6 @@ h1 + .post-meta {
} }
@media all and (max-width: 576px) { @media all and (max-width: 576px) {
.preview-img[data-src] {
margin-top: 2.2rem;
}
.post-tail-bottom { .post-tail-bottom {
flex-wrap: wrap-reverse !important; flex-wrap: wrap-reverse !important;
@ -404,9 +365,4 @@ h1 + .post-meta {
margin-left: -0.5rem; margin-left: -0.5rem;
margin-right: -0.5rem; margin-right: -0.5rem;
} }
.preview-img[data-src] {
max-width: 100vw;
border-radius: 0;
}
} }

View file

@ -6,7 +6,7 @@ permalink: '/sw.js'
self.importScripts('{{ "/assets/js/data/swcache.js" | relative_url }}'); self.importScripts('{{ "/assets/js/data/swcache.js" | relative_url }}');
const cacheName = 'chirpy-{{ "now" | date: "%Y%m%d.%H%M%S" }}'; const cacheName = 'chirpy-{{ "now" | date: "%s" }}';
function verifyDomain(url) { function verifyDomain(url) {
for (const domain of allowedDomains) { for (const domain of allowedDomains) {

@ -1 +1 @@
Subproject commit 6737eab720e4cdd8330d32053053356f200d8819 Subproject commit 6e3fa734685f099195b02da912ffa25c04913e41

View file

@ -1,38 +1,41 @@
# Contributing Guidelines # Contributing Guidelines
:tada: _First of all, thank you for considering contributing to this project!_ :tada: _First of all, thank you for considering contributing to this project_ ! :tada:
There are many ways to contribute, from writing tutorials or blog posts, improving the documentation, submitting bug There are many ways to contribute, from writing tutorials or blog posts, improving the documentation, submitting bug
reports and feature requests or writing code which can be incorporated into Chirpy itself. reports and feature requests, or writing code that can be incorporated into the project. In order to make a good
experience for both contributors and maintainers, please start with the "[General Rules](#general-rules)"
before taking further action.
## In This Article ## Table of Contents
- [General Rules](#general-rules) - [General Rules](#general-rules)
- [Questions and Requests for Help](#questions-and-requests-for-help) - [Questions and Requests for Help](#questions-and-requests-for-help)
- [File a Bug Report](#file-a-bug-report) - [Reporting a Bug](#reporting-a-bug)
- [Suggest a New Feature](#suggest-a-new-feature) - [Suggesting a New Feature](#suggesting-a-new-feature)
- [Contributing Code and Documentation Changes](#contributing-code-and-documentation-changes) - [Contributing Code/Documentation](#contributing-codedocumentation)
- [Helpful Resources](#helpful-resources) - [Helpful Resources](#helpful-resources)
## General Rules ## General Rules
All contributions should be based on the following rules: All types of contributions (_pull requests_, _issues_, and _discussions_) should follow these rules:
- You should read through the [Wiki][wiki] to understand the project features and how to use it properly. This is to - You should read through the [Wiki][wiki] to understand the project features and how to use it properly. This is to
respect the time of the project's developers and respect the time of the project's developers and
maintainers, and to save their energy for other problems that really need to be resolved. maintainers and to save their energy for other problems that really need to be resolved.
- Use the [latest release version][latest-ver]. If your contribution involves code/documentation changes, update to the - Use the [latest release version][latest-ver]. If your contribution involves code/documentation changes, update to the
latest version of the default (`master`) branch. latest version of the default (`master`) branch.
- Avoid making duplicate contributions by searching for existing [Issues][issues] / [Discussioins][discus] / - Avoid making duplicate contributions by searching for existing [issues][issues] / [discussions][discus] /
[Pull Requests][pr], but don't leave any unhelpful comments such as "I have the same problem". Prefer using [pull requests][pr], but don't leave any unhelpful comments such as "I have the same problem". Prefer using
[reactions][gh-reactions] if you simply want to "+1" an existing issue. [reactions][gh-reactions] if you simply want to "+1" an existing issue.
- DO NOT email or tweet the - DO NOT email or tweet the
project developers and maintainers directly, everything about Chirpy should be left in GitHub. project developers and maintainers directly, everything about the project should be left on GitHub.
**Tips**: If you're new to open source, see "[How To Ask Questions The Smart Way][ext-reading]". **Tip**: If you are new to the open-source community, then please read through
"[How To Ask Questions The Smart Way][ext-reading]" before contributing.
## Questions and Requests for Help ## Questions and Requests for Help
@ -43,7 +46,7 @@ enthusiastic geeks who will positively answer your challenging questions.
If you can't get an answer in any of the above ways, then create a new [discussion][discus]. As long as it is not a If you can't get an answer in any of the above ways, then create a new [discussion][discus]. As long as it is not a
duplicate and [RTFM][rtfm] / [STFW][stfw] issue, we will respond as soon as possible. duplicate and [RTFM][rtfm] / [STFW][stfw] issue, we will respond as soon as possible.
## File a Bug Report ## Reporting a Bug
A great way to contribute to the project is to send a detailed issue when you encounter a problem. We always appreciate A great way to contribute to the project is to send a detailed issue when you encounter a problem. We always appreciate
a well-written, thorough bug report. a well-written, thorough bug report.
@ -58,34 +61,34 @@ You can learn about Jekyll and modern Web development to solve problems caused b
3. Make good use of your browser's incognito mode to troubleshoot if the problem is caused by caching. 3. Make good use of your browser's incognito mode to troubleshoot if the problem is caused by caching.
4. As a last option, you can create a new [Bug Report][new-issue] follow the template to describe the details. 4. As a last option, you can create a new [Bug Report][bug-report] following the template to describe the details.
If possible, providing a demo that reproduces the error will help us troubleshoot faster. If possible, providing a demo that reproduces the error will help us troubleshoot faster.
## Suggest a New Feature ## Suggesting a New Feature
Feature requests are welcome! While we will consider all requests, we cannot guarantee your request will be accepted.
We want to avoid chaos in the UI design, so we won't accept requests for changes like color schemes, font families,
typography, and so on. **Do not open a duplicate feature request.** Search for existing feature requests first. If you
find your feature (or one very similar) previously requested, comment on that issue.
Feature requests are welcome! While we will consider all requests, we cannot guarantee your request will be accepted.
We want to avoid chaos in the UI design and therefore do not accept requests for changes like color schemes,
fontfamilies, typography, and so on. We want to avoid [feature creep][feat-creep] and focus only on the core features.
If accepted, we cannot make any commitments regarding the timeline for implementation and release. However, you are If accepted, we cannot make any commitments regarding the timeline for implementation and release. However, you are
welcome to submit a pull request to help! welcome to submit a pull request to help!
## Contributing Code and Documentation Changes ## Contributing Code/Documentation
In short, you can follow these steps to complete the contribution. If your request is about an enhancement, it is recommended to first submit a
[Feature Request][feat-request] to discuss whether your idea fits the project.
See also: "[Suggesting a New Feature](#suggesting-a-new-feature)". Other than that, you can start the PR process.
1. Fork this project on GitHub and clone your repository locally. 1. Fork this project on GitHub and clone your repository locally.
2. Setting up the [development & test environments][dev-env]. 2. Setting up the [development & test environments][dev-env].
3. Create a new branch from the default branch and give it a descriptive name (e.g. `add-a-new-feat` or `fix-a-bug`). 3. Creating a new branch from the default branch and give it a descriptive name (e.g. `add-a-new-feat` or `fix-a-bug`).
When development is complete, create a [Conventional Commit][cc] with Git. When development is complete, create a [Conventional Commit][cc] with Git.
4. Create a new [Pull Request][gh-pr]. 4. Submitting a [Pull Request][gh-pr].
## Helpful Resources ## Helpful Resources
- [Code of conduct](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/CODE_OF_CONDUCT.md) - [Code of conduct](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/CODE_OF_CONDUCT.md)
- [Security policy](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/SECURITY.md) - [Security policy](https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/SECURITY.md)
- [How To Ask Questions The Smart Way][ext-reading]
[latest-ver]: https://github.com/cotes2020/jekyll-theme-chirpy/releases/latest [latest-ver]: https://github.com/cotes2020/jekyll-theme-chirpy/releases/latest
[wiki]: https://github.com/cotes2020/jekyll-theme-chirpy/wiki [wiki]: https://github.com/cotes2020/jekyll-theme-chirpy/wiki
@ -98,7 +101,9 @@ When development is complete, create a [Conventional Commit][cc] with Git.
[rtfm]: https://en.wikipedia.org/wiki/RTFM [rtfm]: https://en.wikipedia.org/wiki/RTFM
[stfw]: https://www.webster-dictionary.org/definition/STFW [stfw]: https://www.webster-dictionary.org/definition/STFW
[gh-reactions]: https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/ [gh-reactions]: https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/
[new-issue]: https://github.com/cotes2020/jekyll-theme-chirpy/issues/new/choose [bug-report]: https://github.com/cotes2020/jekyll-theme-chirpy/issues/new?assignees=&labels=&projects=&template=bug_report.yml
[feat-request]: https://github.com/cotes2020/jekyll-theme-chirpy/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.yml
[feat-creep]: https://en.wikipedia.org/wiki/Feature_creep
[dev-env]: https://github.com/cotes2020/jekyll-theme-chirpy/wiki/Development-&-Test-Environments [dev-env]: https://github.com/cotes2020/jekyll-theme-chirpy/wiki/Development-&-Test-Environments
[cc]: https://www.conventionalcommits.org/ [cc]: https://www.conventionalcommits.org/
[gh-pr]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests [gh-pr]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests

View file

@ -21,13 +21,13 @@
"fixlint": "npm run test -- --fix" "fixlint": "npm run test -- --fix"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.22.17", "@babel/core": "^7.23.0",
"@babel/plugin-proposal-class-properties": "^7.18.6", "@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/preset-env": "^7.22.15", "@babel/preset-env": "^7.22.20",
"@rollup/plugin-babel": "^6.0.3", "@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-terser": "^0.4.3", "@rollup/plugin-terser": "^0.4.3",
"rimraf": "^5.0.1", "rimraf": "^5.0.5",
"rollup": "^3.29.0", "rollup": "^3.29.4",
"rollup-plugin-license": "^3.1.0", "rollup-plugin-license": "^3.1.0",
"stylelint": "^15.10.3", "stylelint": "^15.10.3",
"stylelint-config-standard-scss": "^11.0.0" "stylelint-config-standard-scss": "^11.0.0"

View file

@ -25,6 +25,7 @@ PROD_BRANCH="production"
GEM_SPEC="jekyll-theme-chirpy.gemspec" GEM_SPEC="jekyll-theme-chirpy.gemspec"
NODE_CONFIG="package.json" NODE_CONFIG="package.json"
CHANGE_LOG="docs/CHANGELOG.md"
JS_DIST="assets/js/dist" JS_DIST="assets/js/dist"
BACKUP_PATH="$(mktemp -d)" BACKUP_PATH="$(mktemp -d)"
@ -103,15 +104,15 @@ check() {
# auto-generate a new version number to the file 'package.json' and # auto-generate a new version number to the file 'package.json' and
bump_node() { bump_node() {
if $opt_pre; then if $opt_pre; then
standard-version --prerelease rc standard-version -i "$CHANGE_LOG" -p rc
else else
standard-version standard-version -i "$CHANGE_LOG"
fi fi
# Change heading of Patch version to heading level 2 (a bug from `standard-version`) # Change heading of Patch version to heading level 2 (a bug from `standard-version`)
sed -i "s/^### \[/## \[/g" CHANGELOG.md sed -i "s/^### \[/## \[/g" "$CHANGE_LOG"
# Replace multiple empty lines with a single empty line # Replace multiple empty lines with a single empty line
sed -i "/^$/N;/^\n$/D" CHANGELOG.md sed -i "/^$/N;/^\n$/D" "$CHANGE_LOG"
} }
## Bump new version to gem config file ## Bump new version to gem config file