mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-19 14:14:17 +00:00
Compare commits
57 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
795ff3f4c3 | ||
|
|
c41672b2e0 | ||
|
|
9cc62e703f | ||
|
|
19d6bafbe1 | ||
|
|
388c1511d6 | ||
|
|
8849afe5cf | ||
|
|
89b962557a | ||
|
|
5de0153df4 | ||
|
|
ed4d304cd2 | ||
|
|
48564bda8d | ||
|
|
b9d053b3cd | ||
|
|
cd258c92c3 | ||
|
|
6230d1d750 | ||
|
|
365abc6b3b | ||
|
|
79c65b3e44 | ||
|
|
6b34901d94 | ||
|
|
90693ff95e | ||
|
|
1a01c35e52 | ||
|
|
c335bc6ce7 | ||
|
|
f3ea7e9887 | ||
|
|
c13ec31163 | ||
|
|
bbbb66b489 | ||
|
|
74f16623c9 | ||
|
|
1127c43823 | ||
|
|
ea3a22e13c | ||
|
|
c0018b66f3 | ||
|
|
02e296ed75 | ||
|
|
4facf5b390 | ||
|
|
c5d11441bc | ||
|
|
96bdd7c1dd | ||
|
|
ba764c1380 | ||
|
|
c7cfde0930 | ||
|
|
13177979bb | ||
|
|
6a17a7d46c | ||
|
|
8c30b41e20 | ||
|
|
b2d1cb68db | ||
|
|
3589a6ee53 | ||
|
|
7efbed6a24 | ||
|
|
21d74f1183 | ||
|
|
d6d0098379 | ||
|
|
241bb4df78 | ||
|
|
82d8f2db98 | ||
|
|
9882244bd9 | ||
|
|
f243cbd858 | ||
|
|
d420b38329 | ||
|
|
ea2d238bd8 | ||
|
|
5234511a2f | ||
|
|
746a31e125 | ||
|
|
c45e031155 | ||
|
|
4a2b89d0b6 | ||
|
|
2a4fbf6a79 | ||
|
|
84ea68cab0 | ||
|
|
3ed5eb1ee0 | ||
|
|
60836af606 | ||
|
|
739345ac24 | ||
|
|
1a977a87a0 | ||
|
|
d1a5b57e4d |
2
.github/codeql/codeql-config.yml
vendored
Normal file
2
.github/codeql/codeql-config.yml
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
paths-ignore:
|
||||||
|
- "assets/js"
|
||||||
6
.github/dependabot.yml
vendored
6
.github/dependabot.yml
vendored
@@ -7,7 +7,7 @@ updates:
|
|||||||
bundler:
|
bundler:
|
||||||
dependency-type: "production"
|
dependency-type: "production"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "monthly"
|
interval: "weekly"
|
||||||
- package-ecosystem: "npm"
|
- package-ecosystem: "npm"
|
||||||
directory: "/"
|
directory: "/"
|
||||||
versioning-strategy: increase
|
versioning-strategy: increase
|
||||||
@@ -15,7 +15,7 @@ updates:
|
|||||||
npm:
|
npm:
|
||||||
dependency-type: "development"
|
dependency-type: "development"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "monthly"
|
interval: "weekly"
|
||||||
- package-ecosystem: "github-actions"
|
- package-ecosystem: "github-actions"
|
||||||
directory: "/"
|
directory: "/"
|
||||||
groups:
|
groups:
|
||||||
@@ -23,4 +23,4 @@ updates:
|
|||||||
update-types:
|
update-types:
|
||||||
- "major"
|
- "major"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "monthly"
|
interval: "weekly"
|
||||||
|
|||||||
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@@ -19,6 +19,10 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
ruby: ["3.0", "3.1", "3.2"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -28,7 +32,7 @@ jobs:
|
|||||||
- name: Setup Ruby
|
- name: Setup Ruby
|
||||||
uses: ruby/setup-ruby@v1
|
uses: ruby/setup-ruby@v1
|
||||||
with:
|
with:
|
||||||
ruby-version: 3
|
ruby-version: ${{ matrix.ruby }}
|
||||||
bundler-cache: true
|
bundler-cache: true
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
|
|||||||
13
.github/workflows/codeql.yml
vendored
13
.github/workflows/codeql.yml
vendored
@@ -2,11 +2,9 @@ name: "CodeQL"
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
paths: ["**.js"]
|
paths: ["_javascript/**/*.js"]
|
||||||
pull_request:
|
pull_request:
|
||||||
paths: ["**.js"]
|
paths: ["_javascript/**/*.js"]
|
||||||
schedule:
|
|
||||||
- cron: "0 0 * * 5"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
analyze:
|
analyze:
|
||||||
@@ -29,16 +27,17 @@ jobs:
|
|||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v2
|
uses: github/codeql-action/init@v3
|
||||||
with:
|
with:
|
||||||
languages: "${{ matrix.language }}"
|
languages: "${{ matrix.language }}"
|
||||||
|
config-file: .github/codeql/codeql-config.yml
|
||||||
|
|
||||||
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
|
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
|
||||||
# If this step fails, then you should remove it and run the build manually (see below)
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
- name: Autobuild
|
- name: Autobuild
|
||||||
uses: github/codeql-action/autobuild@v2
|
uses: github/codeql-action/autobuild@v3
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v2
|
uses: github/codeql-action/analyze@v3
|
||||||
with:
|
with:
|
||||||
category: "/language:${{ matrix.language }}"
|
category: "/language:${{ matrix.language }}"
|
||||||
|
|||||||
8
.github/workflows/pages-deploy.yml.hook
vendored
8
.github/workflows/pages-deploy.yml.hook
vendored
@@ -37,12 +37,12 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup Pages
|
- name: Setup Pages
|
||||||
id: pages
|
id: pages
|
||||||
uses: actions/configure-pages@v3
|
uses: actions/configure-pages@v4
|
||||||
|
|
||||||
- name: Setup Ruby
|
- name: Setup Ruby
|
||||||
uses: ruby/setup-ruby@v1
|
uses: ruby/setup-ruby@v1
|
||||||
with:
|
with:
|
||||||
ruby-version: 3
|
ruby-version: 3.2
|
||||||
bundler-cache: true
|
bundler-cache: true
|
||||||
|
|
||||||
- name: Build site
|
- name: Build site
|
||||||
@@ -57,7 +57,7 @@ jobs:
|
|||||||
\-\-ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"
|
\-\-ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"
|
||||||
|
|
||||||
- name: Upload site artifact
|
- name: Upload site artifact
|
||||||
uses: actions/upload-pages-artifact@v1
|
uses: actions/upload-pages-artifact@v3
|
||||||
with:
|
with:
|
||||||
path: "_site${{ steps.pages.outputs.base_path }}"
|
path: "_site${{ steps.pages.outputs.base_path }}"
|
||||||
|
|
||||||
@@ -70,4 +70,4 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Deploy to GitHub Pages
|
- name: Deploy to GitHub Pages
|
||||||
id: deployment
|
id: deployment
|
||||||
uses: actions/deploy-pages@v2
|
uses: actions/deploy-pages@v4
|
||||||
|
|||||||
32
.github/workflows/stale.yml
vendored
32
.github/workflows/stale.yml
vendored
@@ -8,23 +8,25 @@ permissions:
|
|||||||
issues: write
|
issues: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
|
|
||||||
|
env:
|
||||||
|
STALE_LABEL: stale
|
||||||
|
EXEMPT_LABELS: "pending,planning,in progress"
|
||||||
|
MESSAGE: >
|
||||||
|
This conversation has been automatically marked as stale because it has not had recent activity.
|
||||||
|
It will be closed if no further activity occurs.
|
||||||
|
Thank you for your contributions.
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
stale:
|
stale:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/stale@v8
|
- uses: actions/stale@v9
|
||||||
with:
|
with:
|
||||||
days-before-stale: 30
|
# 60 days before marking issues/PRs stale
|
||||||
days-before-close: 1
|
days-before-close: -1 # does not close automatically
|
||||||
stale-issue-label: stale
|
stale-issue-label: ${{ env.STALE_LABEL }}
|
||||||
exempt-issue-labels: pending
|
exempt-issue-labels: ${{ env.EXEMPT_LABELS }}
|
||||||
stale-issue-message: >
|
stale-issue-message: ${{ env.MESSAGE }}
|
||||||
This issue has been automatically marked as stale because it has not had recent activity.
|
stale-pr-label: ${{ env.STALE_LABEL }}
|
||||||
It will be closed if no further activity occurs.
|
exempt-pr-labels: ${{ env.EXEMPT_LABELS }}
|
||||||
Thank you for your contributions.
|
stale-pr-message: ${{ env.MESSAGE }}
|
||||||
stale-pr-label: stale
|
|
||||||
exempt-pr-labels: pending
|
|
||||||
stale-pr-message: >
|
|
||||||
This PR has been automatically marked as stale because it has not had recent activity.
|
|
||||||
It will be closed if no further activity occurs.
|
|
||||||
Thank you for your contributions.
|
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -16,7 +16,6 @@ package-lock.json
|
|||||||
|
|
||||||
# IDE configurations
|
# IDE configurations
|
||||||
.idea
|
.idea
|
||||||
.vscode
|
|
||||||
|
|
||||||
# Misc
|
# Misc
|
||||||
assets/js/dist
|
assets/js/dist
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
. "$(dirname "$0")/_/husky.sh"
|
. "$(dirname "$0")/_/husky.sh"
|
||||||
|
|
||||||
npx --no -- commitlint -x $(npm root -g)/@commitlint/config-conventional --edit
|
npx --no -- commitlint --edit ${1}
|
||||||
|
|||||||
12
.vscode/extensions.json
vendored
Normal file
12
.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"recommendations": [
|
||||||
|
// Liquid tags auto-complete
|
||||||
|
"killalau.vscode-liquid-snippets",
|
||||||
|
// Liquid syntax highlighting and formatting
|
||||||
|
"Shopify.theme-check-vscode",
|
||||||
|
// Common formatter
|
||||||
|
"esbenp.prettier-vscode",
|
||||||
|
"foxundermoon.shell-format",
|
||||||
|
"stylelint.vscode-stylelint"
|
||||||
|
]
|
||||||
|
}
|
||||||
24
.vscode/settings.json
vendored
Normal file
24
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
// Prettier
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"prettier.trailingComma": "none",
|
||||||
|
// Shopify Liquid
|
||||||
|
"files.associations": {
|
||||||
|
"*.html": "liquid"
|
||||||
|
},
|
||||||
|
// Formatter
|
||||||
|
"[html][liquid]": {
|
||||||
|
"editor.defaultFormatter": "Shopify.theme-check-vscode"
|
||||||
|
},
|
||||||
|
"[shellscript]": {
|
||||||
|
"editor.defaultFormatter": "foxundermoon.shell-format"
|
||||||
|
},
|
||||||
|
// Disable vscode built-in stylelint
|
||||||
|
"css.validate": false,
|
||||||
|
"scss.validate": false,
|
||||||
|
"less.validate": false,
|
||||||
|
// Stylint extension settings
|
||||||
|
"stylelint.snippet": ["css", "less", "postcss", "scss"],
|
||||||
|
"stylelint.validate": ["css", "less", "postcss", "scss"]
|
||||||
|
}
|
||||||
35
README.md
35
README.md
@@ -10,7 +10,7 @@
|
|||||||
[][license]
|
[][license]
|
||||||
[](https://996.icu)
|
[](https://996.icu)
|
||||||
|
|
||||||
[**Live Demo →**][demo]
|
[**Live Demo** →][demo]
|
||||||
|
|
||||||
[][demo]
|
[][demo]
|
||||||
|
|
||||||
@@ -18,10 +18,6 @@
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>Click to expand/close details</summary>
|
|
||||||
|
|
||||||
|
|
||||||
- Dark / Light Theme Mode
|
- Dark / Light Theme Mode
|
||||||
- Localized UI language
|
- Localized UI language
|
||||||
- Pinned Posts on Home Page
|
- Pinned Posts on Home Page
|
||||||
@@ -38,11 +34,9 @@
|
|||||||
- Built-in Search
|
- Built-in Search
|
||||||
- Atom Feeds
|
- Atom Feeds
|
||||||
- PWA
|
- PWA
|
||||||
- Google Analytics
|
- Google Analytics / GoatCounter
|
||||||
- SEO & Performance Optimization
|
- SEO & Performance Optimization
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
To learn how to use, develop, and upgrade the project, please refer to the [Wiki][wiki].
|
To learn how to use, develop, and upgrade the project, please refer to the [Wiki][wiki].
|
||||||
@@ -55,22 +49,18 @@ For details, see the "[Contributing Guidelines][contribute-guide]".
|
|||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
This project was built primarily with the [Jekyll][jekyllrb] ecosystem,
|
### Contributors
|
||||||
[Bootstrap][bootstrap], [Font Awesome][icons], and some other [wonderful tools][lib].
|
|
||||||
The avatar and favicon design from [Clipart Max][image].
|
|
||||||
|
|
||||||
Many thanks to the [contributors][contributors] who participated in the development
|
Thanks to [all the contributors][contributors] involved in the development of the project!
|
||||||
and to the folks who reported bugs or shared ideas.
|
|
||||||
|
|
||||||
Last but not least, thanks to [JetBrains][jetbrains] for providing the _Open Source License_.
|
[][contributors]
|
||||||
|
<sub> —— Made with [contrib.rocks](https://contrib.rocks)</sub>
|
||||||
|
|
||||||
## Sponsoring
|
### Third-Party Assets
|
||||||
|
|
||||||
If you like this project or have built something through it, please consider sponsoring it, and your support would be greatly appreciated.
|
This project is built on the [Jekyll][jekyllrb] ecosystem and some [great libraries][lib], and is developed using [VS Code][vscode] as well as tools provided by [JetBrains][jetbrains] under a non-commercial open-source software license.
|
||||||
|
|
||||||
[][ko-fi]
|
The avatar and favicon for the project's website are from [ClipartMAX][clipartmax].
|
||||||
[][donation]
|
|
||||||
[][donation]
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
@@ -81,14 +71,11 @@ This project is published under [MIT License][license].
|
|||||||
[codacy]: https://app.codacy.com/gh/cotes2020/jekyll-theme-chirpy/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade
|
[codacy]: https://app.codacy.com/gh/cotes2020/jekyll-theme-chirpy/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade
|
||||||
[license]: https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE
|
[license]: https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE
|
||||||
[jekyllrb]: https://jekyllrb.com/
|
[jekyllrb]: https://jekyllrb.com/
|
||||||
[bootstrap]: https://getbootstrap.com/
|
[clipartmax]: https://www.clipartmax.com/middle/m2i8b1m2K9Z5m2K9_ant-clipart-childrens-ant-cute/
|
||||||
[icons]: https://fontawesome.com/
|
|
||||||
[image]: https://www.clipartmax.com/middle/m2i8b1m2K9Z5m2K9_ant-clipart-childrens-ant-cute/
|
|
||||||
[demo]: https://cotes2020.github.io/chirpy-demo/
|
[demo]: https://cotes2020.github.io/chirpy-demo/
|
||||||
[wiki]: https://github.com/cotes2020/jekyll-theme-chirpy/wiki
|
[wiki]: https://github.com/cotes2020/jekyll-theme-chirpy/wiki
|
||||||
[contribute-guide]: https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/CONTRIBUTING.md
|
[contribute-guide]: https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/docs/CONTRIBUTING.md
|
||||||
[contributors]: https://github.com/cotes2020/jekyll-theme-chirpy/graphs/contributors
|
[contributors]: https://github.com/cotes2020/jekyll-theme-chirpy/graphs/contributors
|
||||||
[lib]: https://github.com/cotes2020/chirpy-static-assets
|
[lib]: https://github.com/cotes2020/chirpy-static-assets
|
||||||
|
[vscode]: https://code.visualstudio.com/
|
||||||
[jetbrains]: https://www.jetbrains.com/?from=jekyll-theme-chirpy
|
[jetbrains]: https://www.jetbrains.com/?from=jekyll-theme-chirpy
|
||||||
[ko-fi]: https://ko-fi.com/coteschung/
|
|
||||||
[donation]: https://sponsor.cotes.page/
|
|
||||||
|
|||||||
20
_config.yml
20
_config.yml
@@ -52,6 +52,9 @@ google_site_verification: # fill in to your verification string
|
|||||||
google_analytics:
|
google_analytics:
|
||||||
id: # fill in your Google Analytics ID
|
id: # fill in your Google Analytics ID
|
||||||
|
|
||||||
|
goatcounter:
|
||||||
|
id: # fill in your Goatcounter ID
|
||||||
|
|
||||||
# Prefer color scheme setting.
|
# Prefer color scheme setting.
|
||||||
#
|
#
|
||||||
# Note: Keep empty will follow the system prefer color by default,
|
# Note: Keep empty will follow the system prefer color by default,
|
||||||
@@ -75,6 +78,10 @@ img_cdn: "https://chirpy-img.netlify.app"
|
|||||||
# the avatar on sidebar, support local or CORS resources
|
# the avatar on sidebar, support local or CORS resources
|
||||||
avatar: "/commons/avatar.jpg"
|
avatar: "/commons/avatar.jpg"
|
||||||
|
|
||||||
|
# The URL of the site-wide social preview image used in SEO `og:image` meta tag.
|
||||||
|
# It can be overridden by a customized `page.image` in front matter.
|
||||||
|
social_preview_image: # string, local or CORS resources
|
||||||
|
|
||||||
# boolean type, the global switch for TOC in posts.
|
# boolean type, the global switch for TOC in posts.
|
||||||
toc: true
|
toc: true
|
||||||
|
|
||||||
@@ -107,7 +114,14 @@ assets:
|
|||||||
env: # [development | production]
|
env: # [development | production]
|
||||||
|
|
||||||
pwa:
|
pwa:
|
||||||
enabled: true # the option for PWA feature
|
enabled: true # the option for PWA feature (installable)
|
||||||
|
cache:
|
||||||
|
enabled: true # the option for PWA offline cache
|
||||||
|
# Paths defined here will be excluded from the PWA cache.
|
||||||
|
# Usually its value is the `baseurl` of another website that
|
||||||
|
# shares the same domain name as the current website.
|
||||||
|
deny_paths:
|
||||||
|
# - "/example" # URLs match `<SITE_URL>/example/*` will not be cached by the PWA
|
||||||
|
|
||||||
paginate: 10
|
paginate: 10
|
||||||
|
|
||||||
@@ -153,10 +167,6 @@ defaults:
|
|||||||
values:
|
values:
|
||||||
layout: page
|
layout: page
|
||||||
permalink: /:title/
|
permalink: /:title/
|
||||||
- scope:
|
|
||||||
path: assets/img/favicons
|
|
||||||
values:
|
|
||||||
swcache: true
|
|
||||||
- scope:
|
- scope:
|
||||||
path: assets/js/dist
|
path: assets/js/dist
|
||||||
values:
|
values:
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ cdns:
|
|||||||
- url: https://fonts.googleapis.com
|
- url: https://fonts.googleapis.com
|
||||||
# jsDelivr CDN
|
# jsDelivr CDN
|
||||||
- url: https://cdn.jsdelivr.net
|
- url: https://cdn.jsdelivr.net
|
||||||
|
# polyfill.io for math
|
||||||
|
- url: https://polyfill.io
|
||||||
|
|
||||||
# fonts
|
# fonts
|
||||||
|
|
||||||
@@ -23,17 +25,17 @@ bootstrap:
|
|||||||
js: https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/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.3/dist/tocbot.min.css
|
css: https://cdn.jsdelivr.net/npm/tocbot@4.25.0/dist/tocbot.min.css
|
||||||
js: https://cdn.jsdelivr.net/npm/tocbot@4.21.3/dist/tocbot.min.js
|
js: https://cdn.jsdelivr.net/npm/tocbot@4.25.0/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.5.1/css/all.min.css
|
||||||
|
|
||||||
search:
|
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.6.0/dist/mermaid.min.js
|
js: https://cdn.jsdelivr.net/npm/mermaid@10.8.0/dist/mermaid.min.js
|
||||||
|
|
||||||
dayjs:
|
dayjs:
|
||||||
js:
|
js:
|
||||||
|
|||||||
10
_includes/embed/bilibili.html
Normal file
10
_includes/embed/bilibili.html
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<iframe
|
||||||
|
class="embed-video bilibili"
|
||||||
|
loading="lazy"
|
||||||
|
src="https://player.bilibili.com/player.html?bvid={{ include.id }}"
|
||||||
|
scrolling="no"
|
||||||
|
border="0"
|
||||||
|
frameborder="no"
|
||||||
|
framespacing="0"
|
||||||
|
allowfullscreen="true"
|
||||||
|
></iframe>
|
||||||
@@ -8,7 +8,9 @@
|
|||||||
<link rel="apple-touch-icon" sizes="180x180" href="{{ favicon_path }}/apple-touch-icon.png">
|
<link rel="apple-touch-icon" sizes="180x180" href="{{ favicon_path }}/apple-touch-icon.png">
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="{{ favicon_path }}/favicon-32x32.png">
|
<link rel="icon" type="image/png" sizes="32x32" href="{{ favicon_path }}/favicon-32x32.png">
|
||||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ favicon_path }}/favicon-16x16.png">
|
<link rel="icon" type="image/png" sizes="16x16" href="{{ favicon_path }}/favicon-16x16.png">
|
||||||
|
{% if site.pwa.enabled %}
|
||||||
<link rel="manifest" href="{{ favicon_path }}/site.webmanifest">
|
<link rel="manifest" href="{{ favicon_path }}/site.webmanifest">
|
||||||
|
{% endif %}
|
||||||
<link rel="shortcut icon" href="{{ favicon_path }}/favicon.ico">
|
<link rel="shortcut icon" href="{{ favicon_path }}/favicon.ico">
|
||||||
<meta name="apple-mobile-web-app-title" content="{{ site.title }}">
|
<meta name="apple-mobile-web-app-title" content="{{ site.title }}">
|
||||||
<meta name="application-name" content="{{ site.title }}">
|
<meta name="application-name" content="{{ site.title }}">
|
||||||
|
|||||||
@@ -8,9 +8,15 @@
|
|||||||
"
|
"
|
||||||
>
|
>
|
||||||
<p>
|
<p>
|
||||||
{{ '©' }}
|
{{- '©' }}
|
||||||
<time>{{ 'now' | date: '%Y' }}</time>
|
<time>{{ 'now' | date: '%Y' }}</time>
|
||||||
|
|
||||||
|
{% if site.social.links %}
|
||||||
<a href="{{ site.social.links[0] }}">{{ site.social.name }}</a>.
|
<a href="{{ site.social.links[0] }}">{{ site.social.name }}</a>.
|
||||||
|
{% else %}
|
||||||
|
<em class="fst-normal">{{ site.social.name }}</em>.
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if site.data.locales[include.lang].copyright.brief %}
|
{% if site.data.locales[include.lang].copyright.brief %}
|
||||||
<span
|
<span
|
||||||
data-bs-toggle="tooltip"
|
data-bs-toggle="tooltip"
|
||||||
|
|||||||
8
_includes/goatcounter.html
Normal file
8
_includes/goatcounter.html
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<!-- GoatCounter -->
|
||||||
|
|
||||||
|
<script
|
||||||
|
data-goatcounter="https://{{ site.goatcounter.id }}.goatcounter.com/count"
|
||||||
|
async
|
||||||
|
src="https://gc.zgo.at/count.js"
|
||||||
|
></script>
|
||||||
|
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
<!-- The Head -->
|
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#f7f7f7">
|
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#f7f7f7">
|
||||||
@@ -11,29 +9,43 @@
|
|||||||
content="width=device-width, user-scalable=no initial-scale=1, shrink-to-fit=no, viewport-fit=cover"
|
content="width=device-width, user-scalable=no initial-scale=1, shrink-to-fit=no, viewport-fit=cover"
|
||||||
>
|
>
|
||||||
|
|
||||||
{% capture seo_tags %}
|
{%- capture seo_tags -%}
|
||||||
{% seo title=false %}
|
{% seo title=false %}
|
||||||
{% endcapture %}
|
{%- endcapture -%}
|
||||||
|
|
||||||
|
<!-- Setup Open Graph image -->
|
||||||
|
|
||||||
{% if page.image %}
|
{% if page.image %}
|
||||||
{% assign img = page.image.path | default: page.image %}
|
{% assign src = page.image.path | default: page.image %}
|
||||||
|
|
||||||
{% unless img contains '://' %}
|
{% unless src contains '://' %}
|
||||||
{% assign img_path = page.img_path | append: '/' | append: img | replace: '//', '/' %}
|
{%- capture img_url -%}
|
||||||
{% capture target %}"{{ img | absolute_url }}"{% endcapture %}
|
{% include img-url.html src=src img_path=page.img_path absolute=true %}
|
||||||
|
|
||||||
{% if site.img_cdn contains '//' %}
|
|
||||||
<!-- it's a cross-origin URL -->
|
|
||||||
{% capture replacement %}"{{ site.img_cdn }}{{ img_path }}"{% endcapture %}
|
|
||||||
{% else %}
|
|
||||||
<!-- it's a local file path -->
|
|
||||||
{%- capture replacement -%}
|
|
||||||
"{{ site.img_cdn | append: '/' | append: img_path | replace: '//', '/' | absolute_url }}"
|
|
||||||
{%- endcapture -%}
|
{%- endcapture -%}
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% assign seo_tags = seo_tags | replace: target, replacement %}
|
{%- capture old_url -%}{{ src | absolute_url }}{%- endcapture -%}
|
||||||
|
{%- capture new_url -%}{{ img_url }}{%- endcapture -%}
|
||||||
|
|
||||||
|
{% assign seo_tags = seo_tags | replace: old_url, new_url %}
|
||||||
{% endunless %}
|
{% endunless %}
|
||||||
|
|
||||||
|
{% elsif site.social_preview_image %}
|
||||||
|
{%- capture img_url -%}
|
||||||
|
{% include img-url.html src=site.social_preview_image absolute=true %}
|
||||||
|
{%- endcapture -%}
|
||||||
|
|
||||||
|
{%- capture og_image -%}
|
||||||
|
<meta property="og:image" content="{{ img_url }}" />
|
||||||
|
{%- endcapture -%}
|
||||||
|
|
||||||
|
{%- capture twitter_image -%}
|
||||||
|
<meta property="twitter:card" content="summary_large_image" />
|
||||||
|
<meta property="twitter:image" content="{{ img_url }}" />
|
||||||
|
{%- endcapture -%}
|
||||||
|
|
||||||
|
{% assign old_meta_clip = '<meta name="twitter:card" content="summary" />' %}
|
||||||
|
{% assign new_meta_clip = og_image | append: twitter_image %}
|
||||||
|
{% assign seo_tags = seo_tags | replace: old_meta_clip, new_meta_clip %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{{ seo_tags }}
|
{{ seo_tags }}
|
||||||
|
|||||||
39
_includes/img-url.html
Normal file
39
_includes/img-url.html
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
{%- comment -%}
|
||||||
|
Generate image final URL based on `site.img_cdn`, `page.img_path`
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
src - required, basic image path
|
||||||
|
img_path - optional, relative path of image
|
||||||
|
absolute - optional, boolean, if true, generate absolute URL
|
||||||
|
|
||||||
|
Return:
|
||||||
|
image URL
|
||||||
|
{%- endcomment -%}
|
||||||
|
|
||||||
|
{% assign url = include.src %}
|
||||||
|
|
||||||
|
{%- if url -%}
|
||||||
|
{% unless url contains ':' %}
|
||||||
|
{%- comment -%} CND URL {%- endcomment -%}
|
||||||
|
{% assign prefix = site.img_cdn | default: '' %}
|
||||||
|
|
||||||
|
{%- comment -%} Add page image path prefix {%- endcomment -%}
|
||||||
|
{% assign url = include.img_path | default: '' | append: '/' | append: url %}
|
||||||
|
|
||||||
|
{% assign url = prefix
|
||||||
|
| append: '/'
|
||||||
|
| append: url
|
||||||
|
| replace: '///', '/'
|
||||||
|
| replace: '//', '/'
|
||||||
|
| replace: ':', ':/'
|
||||||
|
%}
|
||||||
|
|
||||||
|
{% if include.absolute %}
|
||||||
|
{% assign url = site.url | append: site.baseurl | append: url %}
|
||||||
|
{% else %}
|
||||||
|
{% assign url = site.baseurl | append: url %}
|
||||||
|
{% endif %}
|
||||||
|
{% endunless %}
|
||||||
|
{%- endif -%}
|
||||||
|
|
||||||
|
{{- url -}}
|
||||||
@@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
<!-- layout specified -->
|
<!-- layout specified -->
|
||||||
|
|
||||||
|
{% assign js_dist = '/assets/js/dist/' %}
|
||||||
|
|
||||||
{% 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]['lazy-polyfill'].js %}
|
{% assign urls = urls | append: ',' | append: site.data.origin[type]['lazy-polyfill'].js %}
|
||||||
|
|
||||||
@@ -65,7 +67,7 @@
|
|||||||
{% assign js = 'commons' %}
|
{% assign js = 'commons' %}
|
||||||
{% endcase %}
|
{% endcase %}
|
||||||
|
|
||||||
{% capture script %}/assets/js/dist/{{ js }}.min.js{% endcapture %}
|
{% capture script %}{{ js_dist }}{{ js }}.min.js{% endcapture %}
|
||||||
<script defer src="{{ script | relative_url }}"></script>
|
<script defer src="{{ script | relative_url }}"></script>
|
||||||
|
|
||||||
{% if page.math %}
|
{% if page.math %}
|
||||||
@@ -83,7 +85,9 @@
|
|||||||
displayMath: [
|
displayMath: [
|
||||||
['$$', '$$'],
|
['$$', '$$'],
|
||||||
['\\[', '\\]']
|
['\\[', '\\]']
|
||||||
]
|
],
|
||||||
|
/* equation numbering */
|
||||||
|
tags: 'ams'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -94,13 +98,16 @@
|
|||||||
{% if jekyll.environment == 'production' %}
|
{% if jekyll.environment == 'production' %}
|
||||||
<!-- PWA -->
|
<!-- PWA -->
|
||||||
{% if site.pwa.enabled %}
|
{% if site.pwa.enabled %}
|
||||||
<script defer src="{{ '/app.js' | relative_url }}"></script>
|
<script defer src="{{ 'app.min.js' | prepend: js_dist | relative_url }}"></script>
|
||||||
{% else %}
|
|
||||||
<script defer src="{{ '/unregister.js' | relative_url }}"></script>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<!-- GA -->
|
<!-- GA -->
|
||||||
{% if site.google_analytics.id != empty and site.google_analytics.id %}
|
{% if site.google_analytics.id != empty and site.google_analytics.id %}
|
||||||
{% include google-analytics.html %}
|
{% include google-analytics.html %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- GoatCounter -->
|
||||||
|
{% if site.goatcounter.id != empty and site.goatcounter.id %}
|
||||||
|
{% include goatcounter.html %}
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -48,23 +48,6 @@
|
|||||||
{% assign _img_content = null %}
|
{% assign _img_content = null %}
|
||||||
{% assign _img_snippets = _content | split: IMG_TAG %}
|
{% assign _img_snippets = _content | split: IMG_TAG %}
|
||||||
|
|
||||||
<!-- CDN URL -->
|
|
||||||
{% if site.img_cdn %}
|
|
||||||
{% if site.img_cdn contains '//' %}
|
|
||||||
{% assign _path_prefix = site.img_cdn %}
|
|
||||||
{% else %}
|
|
||||||
{% assign _path_prefix = site.img_cdn | relative_url %}
|
|
||||||
{% endif %}
|
|
||||||
{% else %}
|
|
||||||
{% assign _path_prefix = site.baseurl %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<!-- Add image path -->
|
|
||||||
{% if page.img_path %}
|
|
||||||
{% assign _path = page.img_path | append: '/' | replace: '//', '/' %}
|
|
||||||
{% assign _path_prefix = _path_prefix | append: _path %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% for _img_snippet in _img_snippets %}
|
{% for _img_snippet in _img_snippets %}
|
||||||
{% if forloop.first %}
|
{% if forloop.first %}
|
||||||
{% assign _img_content = _img_snippet %}
|
{% assign _img_content = _img_snippet %}
|
||||||
@@ -113,6 +96,12 @@
|
|||||||
{% assign _final_src = null %}
|
{% assign _final_src = null %}
|
||||||
{% assign _lazyload = true %}
|
{% assign _lazyload = true %}
|
||||||
|
|
||||||
|
{%- capture _img_url -%}
|
||||||
|
{% include img-url.html src=_src img_path=page.img_path %}
|
||||||
|
{%- endcapture -%}
|
||||||
|
|
||||||
|
{% assign _path_prefix = _img_url | remove: _src %}
|
||||||
|
|
||||||
{% unless _src contains '//' %}
|
{% unless _src contains '//' %}
|
||||||
{% assign _final_src = _path_prefix | append: _src %}
|
{% assign _final_src = _path_prefix | append: _src %}
|
||||||
{% assign _src_alt = 'src="' | append: _path_prefix %}
|
{% assign _src_alt = 'src="' | append: _path_prefix %}
|
||||||
|
|||||||
@@ -3,18 +3,12 @@
|
|||||||
<aside aria-label="Sidebar" id="sidebar" class="d-flex flex-column align-items-end">
|
<aside aria-label="Sidebar" id="sidebar" class="d-flex flex-column align-items-end">
|
||||||
<header class="profile-wrapper">
|
<header class="profile-wrapper">
|
||||||
<a href="{{ '/' | relative_url }}" id="avatar" class="rounded-circle">
|
<a href="{{ '/' | relative_url }}" id="avatar" class="rounded-circle">
|
||||||
{% if site.avatar != empty and site.avatar %}
|
{%- if site.avatar != empty and site.avatar -%}
|
||||||
{% capture avatar_url %}
|
{%- capture avatar_url -%}
|
||||||
{% if site.avatar contains '://' %}
|
{% include img-url.html src=site.avatar %}
|
||||||
{{ site.avatar }}
|
{%- endcapture -%}
|
||||||
{% elsif site.img_cdn != empty and site.img_cdn %}
|
<img src="{{- avatar_url -}}" width="112" height="112" alt="avatar" onerror="this.style.display='none'">
|
||||||
{{ site.avatar | prepend: site.img_cdn }}
|
{%- endif -%}
|
||||||
{% else %}
|
|
||||||
{{ site.avatar | relative_url }}
|
|
||||||
{% endif %}
|
|
||||||
{% endcapture %}
|
|
||||||
<img src="{{ avatar_url | strip }}" width="112" height="112" alt="avatar" onerror="this.style.display='none'">
|
|
||||||
{% endif %}
|
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<h1 class="site-title">
|
<h1 class="site-title">
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
{% if forloop.first %}
|
{% if forloop.first %}
|
||||||
<span>
|
<span>
|
||||||
<a href="{{ '/' | relative_url }}">
|
<a href="{{ '/' | relative_url }}">
|
||||||
{{ site.data.locales[include.lang].tabs.home | capitalize }}
|
{{- site.data.locales[include.lang].tabs.home | capitalize -}}
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
@@ -30,8 +30,8 @@
|
|||||||
|
|
||||||
{% elsif page.layout == 'category' or page.layout == 'tag' %}
|
{% elsif page.layout == 'category' or page.layout == 'tag' %}
|
||||||
<span>
|
<span>
|
||||||
<a href="{{ item | relative_url }}">
|
<a href="{{ item | append: '/' | relative_url }}">
|
||||||
{{ site.data.locales[include.lang].tabs[item] | default: page.title }}
|
{{- site.data.locales[include.lang].tabs[item] | default: page.title -}}
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -1,16 +1,17 @@
|
|||||||
<!-- Get the last 5 posts from lastmod list. -->
|
<!-- Get 5 last posted/updated posts -->
|
||||||
|
|
||||||
{% assign MAX_SIZE = 5 %}
|
{% assign MAX_SIZE = 5 %}
|
||||||
|
|
||||||
{% assign all_list = '' | split: '' %}
|
{% assign all_list = '' | split: '' %}
|
||||||
|
|
||||||
{% for post in site.posts %}
|
{% for post in site.posts %}
|
||||||
{% if post.last_modified_at and post.last_modified_at != post.date %}
|
{% assign datetime = post.last_modified_at | default: post.date %}
|
||||||
|
|
||||||
{% capture elem %}
|
{% capture elem %}
|
||||||
{{- post.last_modified_at | date: "%Y%m%d%H%M%S" -}}::{{- forloop.index0 -}}
|
{{- datetime | date: "%Y%m%d%H%M%S" -}}::{{- forloop.index0 -}}
|
||||||
{% endcapture %}
|
{% endcapture %}
|
||||||
|
|
||||||
{% assign all_list = all_list | push: elem %}
|
{% assign all_list = all_list | push: elem %}
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% assign all_list = all_list | sort | reverse %}
|
{% assign all_list = all_list | sort | reverse %}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export function toc() {
|
export function toc() {
|
||||||
if (document.querySelector('main h2')) {
|
if (document.querySelector('main h2, main h3')) {
|
||||||
// see: https://github.com/tscanlin/tocbot#usage
|
// see: https://github.com/tscanlin/tocbot#usage
|
||||||
tocbot.init({
|
tocbot.init({
|
||||||
tocSelector: '#toc',
|
tocSelector: '#toc',
|
||||||
|
|||||||
@@ -61,7 +61,11 @@ tail_includes:
|
|||||||
<em>
|
<em>
|
||||||
{% if authors %}
|
{% if authors %}
|
||||||
{% for author in authors %}
|
{% for author in authors %}
|
||||||
|
{% if site.data.authors[author].url -%}
|
||||||
<a href="{{ site.data.authors[author].url }}">{{ site.data.authors[author].name }}</a>
|
<a href="{{ site.data.authors[author].url }}">{{ site.data.authors[author].name }}</a>
|
||||||
|
{%- else -%}
|
||||||
|
{{ site.data.authors[author].name }}
|
||||||
|
{%- endif %}
|
||||||
{% unless forloop.last %}{{ '</em>, <em>' }}{% endunless %}
|
{% unless forloop.last %}{{ '</em>, <em>' }}{% endunless %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|||||||
@@ -134,7 +134,14 @@ fi;
|
|||||||
|
|
||||||
The mathematics powered by [**MathJax**](https://www.mathjax.org/):
|
The mathematics powered by [**MathJax**](https://www.mathjax.org/):
|
||||||
|
|
||||||
$$ \sum_{n=1}^\infty 1/n^2 = \frac{\pi^2}{6} $$
|
$$
|
||||||
|
\begin{equation}
|
||||||
|
\sum_{n=1}^\infty 1/n^2 = \frac{\pi^2}{6}
|
||||||
|
\label{eq:series}
|
||||||
|
\end{equation}
|
||||||
|
$$
|
||||||
|
|
||||||
|
We can reference the equation as \eqref{eq:series}.
|
||||||
|
|
||||||
When $a \ne 0$, there are two solutions to $ax^2 + bx + c = 0$ and they are
|
When $a \ne 0$, there are two solutions to $ax^2 + bx + c = 0$ and they are
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ authors: [<author1_id>, <author2_id>] # for multiple entries
|
|||||||
---
|
---
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
Having said that, the key `author` can also identify multiple entries.
|
Having said that, the key `author` can also identify multiple entries.
|
||||||
|
|
||||||
> The benefit of reading the author information from the file `_data/authors.yml`{: .filepath } is that the page will have the meta tag `twitter:creator`, which enriches the [Twitter Cards](https://developer.twitter.com/en/docs/twitter-for-websites/cards/guides/getting-started#card-and-content-attribution) and is good for SEO.
|
> The benefit of reading the author information from the file `_data/authors.yml`{: .filepath } is that the page will have the meta tag `twitter:creator`, which enriches the [Twitter Cards](https://developer.twitter.com/en/docs/twitter-for-websites/cards/guides/getting-started#card-and-content-attribution) and is good for SEO.
|
||||||
@@ -110,6 +109,8 @@ math: true
|
|||||||
After enabling the mathematical feature, you can add math equations with the following syntax:
|
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 `$$`
|
- **Block math** should be added with `$$ math $$` with **mandatory** blank lines before and after `$$`
|
||||||
|
- **Inserting equation numbering** should be added with `$$\begin{equation} math \end{equation}$$`
|
||||||
|
- **Referencing equation numbering** should be done with `\label{eq:label_name}` in the equation block and `\eqref{eq:label_name}` inline with text (see example below)
|
||||||
- **Inline math** (in lines) should be added with `$$ math $$` without any blank line before or 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 $$`
|
- **Inline math** (in lists) should be added with `\$$ math $$`
|
||||||
|
|
||||||
@@ -120,6 +121,17 @@ $$
|
|||||||
LaTeX_math_expression
|
LaTeX_math_expression
|
||||||
$$
|
$$
|
||||||
|
|
||||||
|
<!-- Equation numbering, keep all blank lines -->
|
||||||
|
|
||||||
|
$$
|
||||||
|
\begin{equation}
|
||||||
|
LaTeX_math_expression
|
||||||
|
\label{eq:label_name}
|
||||||
|
\end{equation}
|
||||||
|
$$
|
||||||
|
|
||||||
|
Can be referenced as \eqref{eq:label_name}.
|
||||||
|
|
||||||
<!-- Inline math in lines, NO blank lines -->
|
<!-- Inline math in lines, NO blank lines -->
|
||||||
|
|
||||||
"Lorem ipsum dolor sit amet, $$ LaTeX_math_expression $$ consectetur adipiscing elit."
|
"Lorem ipsum dolor sit amet, $$ LaTeX_math_expression $$ consectetur adipiscing elit."
|
||||||
@@ -243,7 +255,7 @@ For instance, when using images:
|
|||||||
The parsing result will automatically add the CDN prefix `https://cdn.com` before the image path:
|
The parsing result will automatically add the CDN prefix `https://cdn.com` before the image path:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<img src="https://cdn.com/path/to/flower.png" alt="The flower">
|
<img src="https://cdn.com/path/to/flower.png" alt="The flower" />
|
||||||
```
|
```
|
||||||
{: .nolineno }
|
{: .nolineno }
|
||||||
|
|
||||||
@@ -267,7 +279,7 @@ And then, the image source of Markdown can write the file name directly:
|
|||||||
The output will be:
|
The output will be:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<img src="/img/path/flower.png" alt="The flower">
|
<img src="/img/path/flower.png" alt="The flower" />
|
||||||
```
|
```
|
||||||
{: .nolineno }
|
{: .nolineno }
|
||||||
|
|
||||||
@@ -420,16 +432,16 @@ You can embed a video with the following syntax:
|
|||||||
```liquid
|
```liquid
|
||||||
{% include embed/{Platform}.html id='{ID}' %}
|
{% include embed/{Platform}.html id='{ID}' %}
|
||||||
```
|
```
|
||||||
|
|
||||||
Where `Platform` is the lowercase of the platform name, and `ID` is the video ID.
|
Where `Platform` is the lowercase of the platform name, and `ID` is the video ID.
|
||||||
|
|
||||||
The following table shows how to get the two parameters we need in a given video URL, and you can also know the currently supported video platforms.
|
The following table shows how to get the two parameters we need in a given video URL, and you can also know the currently supported video platforms.
|
||||||
|
|
||||||
| Video URL | Platform | ID |
|
| Video URL | Platform | ID |
|
||||||
|----------------------------------------------------------------------------------------------------|-----------|:--------------|
|
| -------------------------------------------------------------------------------------------------- | ---------- | :------------- |
|
||||||
| [https://www.**youtube**.com/watch?v=**H-B46URT4mg**](https://www.youtube.com/watch?v=H-B46URT4mg) | `youtube` | `H-B46URT4mg` |
|
| [https://www.**youtube**.com/watch?v=**H-B46URT4mg**](https://www.youtube.com/watch?v=H-B46URT4mg) | `youtube` | `H-B46URT4mg` |
|
||||||
| [https://www.**twitch**.tv/videos/**1634779211**](https://www.twitch.tv/videos/1634779211) | `twitch` | `1634779211` |
|
| [https://www.**twitch**.tv/videos/**1634779211**](https://www.twitch.tv/videos/1634779211) | `twitch` | `1634779211` |
|
||||||
|
| [https://www.**bilibili**.com/video/**BV1Q44y1B7Wf**](https://www.bilibili.com/video/BV1Q44y1B7Wf) | `bilibili` | `BV1Q44y1B7Wf` |
|
||||||
|
|
||||||
|
|
||||||
## Learn More
|
## Learn More
|
||||||
|
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ Now you can choose _ONE_ of the following methods to deploy your Jekyll site.
|
|||||||
There are a few things to get ready for.
|
There are a few things to get ready for.
|
||||||
|
|
||||||
- If you're on the GitHub Free plan, keep your site repository public.
|
- If you're on the GitHub Free plan, keep your site repository public.
|
||||||
- If you have committed `Gemfile.lock`{: .filepath} to the repository, and your local machine is not running Linux, go the the root of your site and update the platform list of the lock-file:
|
- If you have committed `Gemfile.lock`{: .filepath} to the repository, and your local machine is not running Linux, go to the root of your site and update the platform list of the lock-file:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ bundle lock --add-platform x86_64-linux
|
$ bundle lock --add-platform x86_64-linux
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
/*
|
/* The common styles */
|
||||||
The common styles
|
|
||||||
*/
|
|
||||||
|
|
||||||
html {
|
html {
|
||||||
@media (prefers-color-scheme: light) {
|
@media (prefers-color-scheme: light) {
|
||||||
@@ -86,6 +84,10 @@ blockquote {
|
|||||||
padding-left: 1rem;
|
padding-left: 1rem;
|
||||||
color: var(--blockquote-text-color);
|
color: var(--blockquote-text-color);
|
||||||
|
|
||||||
|
> p:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
&[class^='prompt-'] {
|
&[class^='prompt-'] {
|
||||||
border-left: 0;
|
border-left: 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -103,10 +105,6 @@ blockquote {
|
|||||||
text-rendering: auto;
|
text-rendering: auto;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
}
|
}
|
||||||
|
|
||||||
> p:last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@include prompt('tip', '\f0eb', 'regular');
|
@include prompt('tip', '\f0eb', 'regular');
|
||||||
@@ -146,6 +144,10 @@ footer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
em {
|
||||||
|
@extend %text-highlight;
|
||||||
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
@@ -309,6 +311,7 @@ sup {
|
|||||||
.preview-img {
|
.preview-img {
|
||||||
aspect-ratio: 40 / 21;
|
aspect-ratio: 40 / 21;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
@extend %rounded;
|
@extend %rounded;
|
||||||
@@ -550,7 +553,8 @@ main {
|
|||||||
|
|
||||||
@extend %rounded;
|
@extend %rounded;
|
||||||
|
|
||||||
&.youtube {
|
&.youtube,
|
||||||
|
&.bilibili {
|
||||||
aspect-ratio: 16 / 9;
|
aspect-ratio: 16 / 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -639,12 +643,12 @@ main {
|
|||||||
|
|
||||||
.left {
|
.left {
|
||||||
float: left;
|
float: left;
|
||||||
margin: 0.75rem 1rem 1rem 0 !important;
|
margin: 0.75rem 1rem 1rem 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.right {
|
.right {
|
||||||
float: right;
|
float: right;
|
||||||
margin: 0.75rem 0 1rem 1rem !important;
|
margin: 0.75rem 0 1rem 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --- Overriding --- */
|
/* --- Overriding --- */
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
---
|
|
||||||
layout: compress
|
|
||||||
# The list to be cached by PWA
|
|
||||||
---
|
|
||||||
|
|
||||||
const resource = [
|
|
||||||
/* --- CSS --- */
|
|
||||||
'{{ "/assets/css/:THEME.css" | replace: ':THEME', site.theme | relative_url }}',
|
|
||||||
|
|
||||||
/* --- PWA --- */
|
|
||||||
'{{ "/app.js" | relative_url }}',
|
|
||||||
'{{ "/sw.js" | relative_url }}',
|
|
||||||
|
|
||||||
/* --- HTML --- */
|
|
||||||
'{{ "/index.html" | relative_url }}',
|
|
||||||
'{{ "/404.html" | relative_url }}',
|
|
||||||
|
|
||||||
{% for tab in site.tabs %}
|
|
||||||
'{{ tab.url | relative_url }}',
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
/* --- Favicons & compressed JS --- */
|
|
||||||
{% assign cache_list = site.static_files | where: 'swcache', true %}
|
|
||||||
{% for file in cache_list %}
|
|
||||||
'{{ file.path | relative_url }}'{%- unless forloop.last -%},{%- endunless -%}
|
|
||||||
{% endfor %}
|
|
||||||
];
|
|
||||||
|
|
||||||
/* The request url with below domain will be cached */
|
|
||||||
const allowedDomains = [
|
|
||||||
{% if site.google_analytics.id != empty and site.google_analytics.id %}
|
|
||||||
'www.googletagmanager.com',
|
|
||||||
'www.google-analytics.com',
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
'{{ site.url | split: "//" | last }}',
|
|
||||||
|
|
||||||
{% if site.img_cdn contains '//' and site.img_cdn %}
|
|
||||||
'{{ site.img_cdn | split: '//' | last | split: '/' | first }}',
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
'fonts.gstatic.com',
|
|
||||||
'fonts.googleapis.com',
|
|
||||||
'cdn.jsdelivr.net',
|
|
||||||
'polyfill.io'
|
|
||||||
];
|
|
||||||
|
|
||||||
/* Requests that include the following path will be banned */
|
|
||||||
const denyUrls = [];
|
|
||||||
51
assets/js/data/swconf.js
Normal file
51
assets/js/data/swconf.js
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
---
|
||||||
|
layout: compress
|
||||||
|
permalink: '/:path/swconf.js'
|
||||||
|
# Note that this file will be fetched by the ServiceWorker, so it will not be cached.
|
||||||
|
---
|
||||||
|
|
||||||
|
const swconf = {
|
||||||
|
{% if site.pwa.cache.enabled %}
|
||||||
|
cacheName: 'chirpy-{{ "now" | date: "%s" }}',
|
||||||
|
|
||||||
|
{%- comment -%} Resources added to the cache during PWA installation. {%- endcomment -%}
|
||||||
|
resources: [
|
||||||
|
'{{ "/assets/css/:THEME.css" | replace: ':THEME', site.theme | relative_url }}',
|
||||||
|
'{{ "/" | relative_url }}',
|
||||||
|
{% for tab in site.tabs %}
|
||||||
|
'{{- tab.url | relative_url -}}',
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% assign cache_list = site.static_files | where: 'swcache', true %}
|
||||||
|
{% for file in cache_list %}
|
||||||
|
'{{ file.path | relative_url }}'{%- unless forloop.last -%},{%- endunless -%}
|
||||||
|
{% endfor %}
|
||||||
|
],
|
||||||
|
|
||||||
|
{%- comment -%} The request url with below domain will be cached. {%- endcomment -%}
|
||||||
|
allowHosts: [
|
||||||
|
{% if site.img_cdn and site.img_cdn contains '//' %}
|
||||||
|
'{{ site.img_cdn | split: '//' | last | split: '/' | first }}',
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{%- unless site.assets.self_host.enabled -%}
|
||||||
|
{% for cdn in site.data.origin["cors"].cdns %}
|
||||||
|
'{{ cdn.url | split: "//" | last }}'
|
||||||
|
{%- unless forloop.last -%},{%- endunless -%}
|
||||||
|
{% endfor %}
|
||||||
|
{% endunless %}
|
||||||
|
],
|
||||||
|
|
||||||
|
{%- comment -%} The request url with below path will not be cached. {%- endcomment -%}
|
||||||
|
denyPaths: [
|
||||||
|
{% for path in site.pwa.cache.deny_paths %}
|
||||||
|
{% unless path == empty %}
|
||||||
|
'{{ path | relative_url }}'{%- unless forloop.last -%},{%- endunless -%}
|
||||||
|
{% endunless %}
|
||||||
|
{% endfor %}
|
||||||
|
],
|
||||||
|
purge: false
|
||||||
|
{% else %}
|
||||||
|
purge: true
|
||||||
|
{% endif %}
|
||||||
|
};
|
||||||
@@ -1,17 +1,18 @@
|
|||||||
---
|
---
|
||||||
layout: compress
|
layout: compress
|
||||||
permalink: '/app.js'
|
permalink: /assets/js/dist/:basename.min.js
|
||||||
---
|
---
|
||||||
|
|
||||||
|
if ('serviceWorker' in navigator) {
|
||||||
|
const isEnabled = '{{ site.pwa.enabled }}' === 'true';
|
||||||
|
|
||||||
|
if (isEnabled) {
|
||||||
|
const swUrl = '{{ '/sw.min.js' | relative_url }}';
|
||||||
const $notification = $('#notification');
|
const $notification = $('#notification');
|
||||||
const $btnRefresh = $('#notification .toast-body>button');
|
const $btnRefresh = $('#notification .toast-body>button');
|
||||||
|
|
||||||
if ('serviceWorker' in navigator) {
|
navigator.serviceWorker.register(swUrl).then((registration) => {
|
||||||
/* Registering Service Worker */
|
{% comment %}In case the user ignores the notification{% endcomment %}
|
||||||
navigator.serviceWorker.register('{{ "/sw.js" | relative_url }}')
|
|
||||||
.then(registration => {
|
|
||||||
|
|
||||||
/* in case the user ignores the notification */
|
|
||||||
if (registration.waiting) {
|
if (registration.waiting) {
|
||||||
$notification.toast('show');
|
$notification.toast('show');
|
||||||
}
|
}
|
||||||
@@ -26,7 +27,7 @@ if ('serviceWorker' in navigator) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$btnRefresh.click(() => {
|
$btnRefresh.on('click', () => {
|
||||||
if (registration.waiting) {
|
if (registration.waiting) {
|
||||||
registration.waiting.postMessage('SKIP_WAITING');
|
registration.waiting.postMessage('SKIP_WAITING');
|
||||||
}
|
}
|
||||||
@@ -36,12 +37,18 @@ if ('serviceWorker' in navigator) {
|
|||||||
|
|
||||||
let refreshing = false;
|
let refreshing = false;
|
||||||
|
|
||||||
/* Detect controller change and refresh all the opened tabs */
|
{% comment %}Detect controller change and refresh all the opened tabs{% endcomment %}
|
||||||
navigator.serviceWorker.addEventListener('controllerchange', () => {
|
navigator.serviceWorker.addEventListener('controllerchange', () => {
|
||||||
if (!refreshing) {
|
if (!refreshing) {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
refreshing = true;
|
refreshing = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
navigator.serviceWorker.getRegistrations().then(function (registrations) {
|
||||||
|
for (let registration of registrations) {
|
||||||
|
registration.unregister();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,37 +1,51 @@
|
|||||||
---
|
---
|
||||||
layout: compress
|
layout: compress
|
||||||
permalink: '/sw.js'
|
permalink: /:basename.min.js
|
||||||
# PWA service worker
|
# PWA service worker
|
||||||
---
|
---
|
||||||
|
|
||||||
self.importScripts('{{ "/assets/js/data/swcache.js" | relative_url }}');
|
const swconfUrl = '{{ '/assets/js/data/swconf.js' | relative_url }}';
|
||||||
|
|
||||||
const cacheName = 'chirpy-{{ "now" | date: "%s" }}';
|
importScripts(swconfUrl);
|
||||||
|
const purge = swconf.purge;
|
||||||
|
|
||||||
function verifyDomain(url) {
|
function verifyHost(url) {
|
||||||
for (const domain of allowedDomains) {
|
for (const host of swconf.allowHosts) {
|
||||||
const regex = RegExp(`^http(s)?:\/\/${domain}\/`);
|
const regex = RegExp(`^http(s)?://${host}/`);
|
||||||
if (regex.test(url)) {
|
if (regex.test(url)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isExcluded(url) {
|
function verifyUrl(url) {
|
||||||
for (const item of denyUrls) {
|
if (!verifyHost(url)) {
|
||||||
if (url === item) {
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const requestPath = new URL(url).pathname;
|
||||||
|
|
||||||
|
for (const path of swconf.denyPaths) {
|
||||||
|
if (requestPath.startsWith(path)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return false;
|
if (!purge) {
|
||||||
|
swconf.allowHosts.push(location.host);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.addEventListener('install', (event) => {
|
self.addEventListener('install', (event) => {
|
||||||
|
if (purge) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
event.waitUntil(
|
event.waitUntil(
|
||||||
caches.open(cacheName).then((cache) => {
|
caches.open(swconf.cacheName).then((cache) => {
|
||||||
return cache.addAll(resource);
|
return cache.addAll(swconf.resources);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -41,8 +55,12 @@ self.addEventListener('activate', (event) => {
|
|||||||
caches.keys().then((keyList) => {
|
caches.keys().then((keyList) => {
|
||||||
return Promise.all(
|
return Promise.all(
|
||||||
keyList.map((key) => {
|
keyList.map((key) => {
|
||||||
if (key !== cacheName) {
|
if (purge) {
|
||||||
return caches.delete(key);
|
return caches.delete(key);
|
||||||
|
} else {
|
||||||
|
if (key !== swconf.cacheName) {
|
||||||
|
return caches.delete(key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@@ -66,22 +84,16 @@ self.addEventListener('fetch', (event) => {
|
|||||||
return fetch(event.request).then((response) => {
|
return fetch(event.request).then((response) => {
|
||||||
const url = event.request.url;
|
const url = event.request.url;
|
||||||
|
|
||||||
if (
|
if (purge || event.request.method !== 'GET' || !verifyUrl(url)) {
|
||||||
event.request.method !== 'GET' ||
|
|
||||||
!verifyDomain(url) ||
|
|
||||||
isExcluded(url)
|
|
||||||
) {
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* see: <https://developers.google.com/web/fundamentals/primers/service-workers#cache_and_return_requests> */
|
{% comment %}See: <https://developers.google.com/web/fundamentals/primers/service-workers#cache_and_return_requests>{% endcomment %}
|
||||||
let responseToCache = response.clone();
|
let responseToCache = response.clone();
|
||||||
|
|
||||||
caches.open(cacheName).then((cache) => {
|
caches.open(swconf.cacheName).then((cache) => {
|
||||||
/* console.log('[sw] Caching new resource: ' + event.request.url); */
|
|
||||||
cache.put(event.request, responseToCache);
|
cache.put(event.request, responseToCache);
|
||||||
});
|
});
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
---
|
|
||||||
layout: compress
|
|
||||||
permalink: '/unregister.js'
|
|
||||||
---
|
|
||||||
|
|
||||||
if ('serviceWorker' in navigator) {
|
|
||||||
navigator.serviceWorker.getRegistrations().then((registrations) => {
|
|
||||||
for (let reg of registrations) {
|
|
||||||
reg.unregister();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
Submodule assets/lib updated: 97d95fdb5e...7bc0d86b6a
@@ -2,6 +2,70 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||||
|
|
||||||
|
## [6.5.2](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v6.5.1...v6.5.2) (2024-02-29)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* correct the base URL parameter name ([#1576](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1576)) ([19d6baf](https://github.com/cotes2020/jekyll-theme-chirpy/commit/19d6bafbe1a60614e0d63b961bc73c342a9f6f33)), closes [#1553](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1553)
|
||||||
|
|
||||||
|
## [6.5.1](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v6.5.0...v6.5.1) (2024-02-26)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* correct the generation of relative resource paths ([#1553](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1553)) ([89b9625](https://github.com/cotes2020/jekyll-theme-chirpy/commit/89b962557a56ccc13eba3c9c20b4270ee9d30042))
|
||||||
|
|
||||||
|
## [6.5.0](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v6.4.2...v6.5.0) (2024-02-14)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add `pwa.cache.*` option to precisely control caching ([#1501](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1501)) ([1127c43](https://github.com/cotes2020/jekyll-theme-chirpy/commit/1127c43823aac4db7fd80d5bb706ae7b1e129dc6))
|
||||||
|
* add analytics support for GoatCounter ([#1526](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1526)) ([90693ff](https://github.com/cotes2020/jekyll-theme-chirpy/commit/90693ff95e72ca4b5135a7b454a6ab521b995b3e))
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* correct the Twitter Card in social share preview ([#1498](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1498)) ([74f1662](https://github.com/cotes2020/jekyll-theme-chirpy/commit/74f16623c9c4877ef36ac52e8b69c19d1d9a82ba))
|
||||||
|
* missing "/" at the end of URLs for categories and tags in breadcrumb ([#1495](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1495)) ([02e296e](https://github.com/cotes2020/jekyll-theme-chirpy/commit/02e296ed75b7906b2d112c67f9054f5d71919de9))
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
* allow no social links to be configured ([#1494](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1494)) ([4facf5b](https://github.com/cotes2020/jekyll-theme-chirpy/commit/4facf5b390eeba612ca439f3354c5d2d881aac56))
|
||||||
|
* allow TOC to start at heading 3 ([#1512](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1512)) ([bbbb66b](https://github.com/cotes2020/jekyll-theme-chirpy/commit/bbbb66b489a3bf2b878947336fe894e8ea2ae3f5))
|
||||||
|
* enable equation numbering in MathJax ([#1520](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1520)) ([c13ec31](https://github.com/cotes2020/jekyll-theme-chirpy/commit/c13ec311636d5e057c6895e353e1c1a4e570f582))
|
||||||
|
|
||||||
|
## [6.4.2](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v6.4.1...v6.4.2) (2024-01-13)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* resume the `blockquote` display type ([#1480](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1480)) ([c7cfde0](https://github.com/cotes2020/jekyll-theme-chirpy/commit/c7cfde093020c73ca9a1b83437eb600379e05918)), closes [#1449](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1449)
|
||||||
|
|
||||||
|
## [6.4.1](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v6.4.0...v6.4.1) (2024-01-10)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* `og:image` URL is incorrect ([#1468](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1468)) ([b2d1cb6](https://github.com/cotes2020/jekyll-theme-chirpy/commit/b2d1cb68db659270aac537d2aa8d4b806fa6991d)), closes [#1463](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1463)
|
||||||
|
|
||||||
|
## [6.4.0](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v6.3.1...v6.4.0) (2024-01-10)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add bilibili embed video support ([#1406](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1406)) ([4a2b89d](https://github.com/cotes2020/jekyll-theme-chirpy/commit/4a2b89d0b698d672486349131a89025fa47afcb6))
|
||||||
|
* add site-wide social preview image settings ([#1463](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1463)) ([241bb4d](https://github.com/cotes2020/jekyll-theme-chirpy/commit/241bb4df7878cff7f82014df660874a1dcddba76))
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* image float breaks quotes and prompts ([#1449](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1449)) ([ea2d238](https://github.com/cotes2020/jekyll-theme-chirpy/commit/ea2d238bd8adc018256862e05a5092311c87a671)), closes [#1441](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1441)
|
||||||
|
* url-less authors should not have empty links ([#1410](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1410)) ([2a4fbf6](https://github.com/cotes2020/jekyll-theme-chirpy/commit/2a4fbf6a7925da610a75c498116da7cf9ba857d7)), closes [#1403](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1403)
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
* include the latest posts in the "Recently Updated" list ([#1456](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1456)) ([82d8f2d](https://github.com/cotes2020/jekyll-theme-chirpy/commit/82d8f2db984711f334f55b6af5098ec16770e824))
|
||||||
|
|
||||||
|
## [6.3.1](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v6.3.0...v6.3.1) (2023-11-12)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **home:** responsive gap at the bottom of preview image ([1a977a8](https://github.com/cotes2020/jekyll-theme-chirpy/commit/1a977a87a0da1cff35d0896cf9265c31034841a6))
|
||||||
|
|
||||||
## [6.3.0](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v6.2.3...v6.3.0) (2023-11-10)
|
## [6.3.0](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v6.2.3...v6.3.0) (2023-11-10)
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Gem::Specification.new do |spec|
|
Gem::Specification.new do |spec|
|
||||||
spec.name = "jekyll-theme-chirpy"
|
spec.name = "jekyll-theme-chirpy"
|
||||||
spec.version = "6.3.0"
|
spec.version = "6.5.2"
|
||||||
spec.authors = ["Cotes Chung"]
|
spec.authors = ["Cotes Chung"]
|
||||||
spec.email = ["cotes.chung@gmail.com"]
|
spec.email = ["cotes.chung@gmail.com"]
|
||||||
|
|
||||||
|
|||||||
18
package.json
18
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "jekyll-theme-chirpy",
|
"name": "jekyll-theme-chirpy",
|
||||||
"version": "6.3.0",
|
"version": "6.5.2",
|
||||||
"description": "A minimal, responsive, and feature-rich Jekyll theme for technical writing.",
|
"description": "A minimal, responsive, and feature-rich Jekyll theme for technical writing.",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -21,16 +21,19 @@
|
|||||||
"fixlint": "npm run test -- --fix"
|
"fixlint": "npm run test -- --fix"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.23.2",
|
"@babel/core": "^7.23.9",
|
||||||
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
||||||
"@babel/preset-env": "^7.23.2",
|
"@babel/preset-env": "^7.23.9",
|
||||||
|
"@commitlint/cli": "^18.6.1",
|
||||||
|
"@commitlint/config-conventional": "^18.6.2",
|
||||||
"@rollup/plugin-babel": "^6.0.4",
|
"@rollup/plugin-babel": "^6.0.4",
|
||||||
"@rollup/plugin-terser": "^0.4.4",
|
"@rollup/plugin-terser": "^0.4.4",
|
||||||
|
"husky": "^9.0.11",
|
||||||
"rimraf": "^5.0.5",
|
"rimraf": "^5.0.5",
|
||||||
"rollup": "^4.3.0",
|
"rollup": "^4.10.0",
|
||||||
"rollup-plugin-license": "^3.2.0",
|
"rollup-plugin-license": "^3.2.0",
|
||||||
"stylelint": "^15.11.0",
|
"stylelint": "^16.2.1",
|
||||||
"stylelint-config-standard-scss": "^11.1.0"
|
"stylelint-config-standard-scss": "^13.0.0"
|
||||||
},
|
},
|
||||||
"prettier": {
|
"prettier": {
|
||||||
"trailingComma": "none"
|
"trailingComma": "none"
|
||||||
@@ -41,6 +44,9 @@
|
|||||||
"not dead"
|
"not dead"
|
||||||
],
|
],
|
||||||
"commitlint": {
|
"commitlint": {
|
||||||
|
"extends": [
|
||||||
|
"@commitlint/config-conventional"
|
||||||
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"body-max-line-length": [
|
"body-max-line-length": [
|
||||||
0,
|
0,
|
||||||
|
|||||||
@@ -3,21 +3,21 @@ import terser from '@rollup/plugin-terser';
|
|||||||
import license from 'rollup-plugin-license';
|
import license from 'rollup-plugin-license';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
const JS_SRC = '_javascript';
|
const SRC_DEFAULT = '_javascript';
|
||||||
const JS_DIST = 'assets/js/dist';
|
const DIST_DEFAULT = 'assets/js/dist';
|
||||||
const isProd = process.env.NODE_ENV === 'production';
|
const isProd = process.env.NODE_ENV === 'production';
|
||||||
|
|
||||||
function build(filename) {
|
function build(filename) {
|
||||||
return {
|
return {
|
||||||
input: [`${JS_SRC}/${filename}.js`],
|
input: [`${SRC_DEFAULT}/${filename}.js`],
|
||||||
output: {
|
output: {
|
||||||
file: `${JS_DIST}/${filename}.min.js`,
|
file: `${DIST_DEFAULT}/${filename}.min.js`,
|
||||||
format: 'iife',
|
format: 'iife',
|
||||||
name: 'Chirpy',
|
name: 'Chirpy',
|
||||||
sourcemap: !isProd
|
sourcemap: !isProd
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
include: `${JS_SRC}/**`
|
include: `${SRC_DEFAULT}/**`
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
babel({
|
babel({
|
||||||
@@ -28,7 +28,7 @@ function build(filename) {
|
|||||||
license({
|
license({
|
||||||
banner: {
|
banner: {
|
||||||
commentStyle: 'ignored',
|
commentStyle: 'ignored',
|
||||||
content: { file: path.join(__dirname, JS_SRC, '_copyright') }
|
content: { file: path.join(__dirname, SRC_DEFAULT, '_copyright') }
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
isProd && terser()
|
isProd && terser()
|
||||||
|
|||||||
@@ -70,12 +70,14 @@ _check_git() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
$opt_pre || (
|
||||||
if [[ $working_branch != "$DEFAULT_BRANCH" &&
|
if [[ $working_branch != "$DEFAULT_BRANCH" &&
|
||||||
$working_branch != hotfix/* &&
|
$working_branch != hotfix/* &&
|
||||||
$working_branch != "$PROD_BRANCH" ]]; then
|
$working_branch != "$PROD_BRANCH" ]]; then
|
||||||
echo "> Abort: Please run on the default, release or patch branch."
|
echo "> Abort: Please run on the default, release or patch branch."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
_check_src() {
|
_check_src() {
|
||||||
@@ -149,14 +151,16 @@ branch() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
## Build a gem package
|
## Build a Gem package
|
||||||
build_gem() {
|
build_gem() {
|
||||||
|
git checkout "$PROD_BRANCH"
|
||||||
|
|
||||||
# Remove unnecessary theme settings
|
# Remove unnecessary theme settings
|
||||||
sed -i "s/^img_cdn:.*/img_cdn:/;s/^avatar:.*/avatar:/" _config.yml
|
sed -i "s/^img_cdn:.*/img_cdn:/;s/^avatar:.*/avatar:/" _config.yml
|
||||||
rm -f ./*.gem
|
rm -f ./*.gem
|
||||||
|
|
||||||
npm run build
|
npm run build
|
||||||
git add "$JS_DIST" -f # add JS dist to gem
|
git add "$JS_DIST" -f # add JS distribution files to gem
|
||||||
gem build "$GEM_SPEC"
|
gem build "$GEM_SPEC"
|
||||||
cp "$JS_DIST"/* "$BACKUP_PATH"
|
cp "$JS_DIST"/* "$BACKUP_PATH"
|
||||||
|
|
||||||
@@ -166,6 +170,9 @@ build_gem() {
|
|||||||
|
|
||||||
# restore the dist files for future development
|
# restore the dist files for future development
|
||||||
mkdir -p "$JS_DIST" && cp "$BACKUP_PATH"/* "$JS_DIST"
|
mkdir -p "$JS_DIST" && cp "$BACKUP_PATH"/* "$JS_DIST"
|
||||||
|
|
||||||
|
# back to the default branch
|
||||||
|
git checkout "$DEFAULT_BRANCH"
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
|||||||
Reference in New Issue
Block a user