mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-20 06:33:25 +00:00
Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e41d874b3 | ||
|
|
774ee93d78 | ||
|
|
8a4d0bc4ee | ||
|
|
1b93f6db9b | ||
|
|
32051dad03 | ||
|
|
c174f62f26 | ||
|
|
e741aa43cf | ||
|
|
e0c3fafa47 | ||
|
|
1b4e318dc1 | ||
|
|
2f00d41861 | ||
|
|
0360c9e90b | ||
|
|
d87c2de675 | ||
|
|
f55cc31dbd | ||
|
|
7630356a94 | ||
|
|
6c112c641a | ||
|
|
976e1a184b | ||
|
|
7ea3545ba3 | ||
|
|
8280adb901 | ||
|
|
4180992272 | ||
|
|
a16aa7d41e | ||
|
|
8e55e4dcb2 | ||
|
|
b4019f3517 | ||
|
|
2966fc174d |
@@ -212,8 +212,9 @@ exclude:
|
|||||||
- tools
|
- tools
|
||||||
- README.md
|
- README.md
|
||||||
- LICENSE
|
- LICENSE
|
||||||
- "*.config.js"
|
- purgecss.js
|
||||||
- package*.json
|
- rollup.config.js
|
||||||
|
- "package*.json"
|
||||||
|
|
||||||
jekyll-archives:
|
jekyll-archives:
|
||||||
enabled: [categories, tags]
|
enabled: [categories, tags]
|
||||||
|
|||||||
@@ -99,9 +99,7 @@
|
|||||||
|
|
||||||
<!-- Scripts -->
|
<!-- Scripts -->
|
||||||
|
|
||||||
{% unless site.theme_mode %}
|
<script src="{{ '/assets/js/dist/theme.min.js' | relative_url }}"></script>
|
||||||
<script src="{{ '/assets/js/dist/theme.min.js' | relative_url }}"></script>
|
|
||||||
{% endunless %}
|
|
||||||
|
|
||||||
{% include js-selector.html lang=lang %}
|
{% include js-selector.html lang=lang %}
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,21 @@
|
|||||||
<!-- Display GoatCounter pageviews -->
|
<!-- Display GoatCounter pageviews -->
|
||||||
<script>
|
<script>
|
||||||
let pv = document.getElementById('pageviews');
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
const pv = document.getElementById('pageviews');
|
||||||
|
|
||||||
if (pv !== null) {
|
if (pv !== null) {
|
||||||
const uri = location.pathname.replace(/\/$/, '');
|
const uri = location.pathname.replace(/\/$/, '');
|
||||||
const url = `https://{{ site.analytics.goatcounter.id }}.goatcounter.com/counter/${encodeURIComponent(uri)}.json`;
|
const url = `https://{{ site.analytics.goatcounter.id }}.goatcounter.com/counter/${encodeURIComponent(uri)}.json`;
|
||||||
|
|
||||||
fetch(url)
|
fetch(url)
|
||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
const count = data.count.replace(/\s/g, '');
|
const count = data.count.replace(/\s/g, '');
|
||||||
pv.innerText = new Intl.NumberFormat().format(count);
|
pv.innerText = new Intl.NumberFormat().format(count);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
pv.innerText = '1';
|
pv.innerText = '1';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
{% if enable_toc %}
|
{% if enable_toc %}
|
||||||
<div class="toc-border-cover z-3"></div>
|
<div class="toc-border-cover z-3"></div>
|
||||||
<section id="toc-wrapper" class="position-sticky ps-0 pe-4">
|
<section id="toc-wrapper" class="invisible position-sticky ps-0 pe-4 pb-4">
|
||||||
<h2 class="panel-heading ps-3 pb-2 mb-0">{{- site.data.locales[include.lang].panel.toc -}}</h2>
|
<h2 class="panel-heading ps-3 pb-2 mb-0">{{- site.data.locales[include.lang].panel.toc -}}</h2>
|
||||||
<nav id="toc"></nav>
|
<nav id="toc"></nav>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ function refreshTheme(event) {
|
|||||||
const mermaidList = document.getElementsByClassName(MERMAID);
|
const mermaidList = document.getElementsByClassName(MERMAID);
|
||||||
|
|
||||||
[...mermaidList].forEach((elem) => {
|
[...mermaidList].forEach((elem) => {
|
||||||
const svgCode = elem.previousSibling.children.item(0).innerHTML;
|
const svgCode = elem.previousSibling.children.item(0).textContent;
|
||||||
elem.textContent = svgCode;
|
elem.textContent = svgCode;
|
||||||
elem.removeAttribute('data-processed');
|
elem.removeAttribute('data-processed');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ function init() {
|
|||||||
mobile.init();
|
mobile.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const $tocWrapper = document.getElementById('toc-wrapper');
|
||||||
|
$tocWrapper.classList.remove('invisible');
|
||||||
|
|
||||||
desktopMode.onchange = refresh;
|
desktopMode.onchange = refresh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ export class TocDesktop {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static init() {
|
static init() {
|
||||||
if (document.getElementById('toc-wrapper')) {
|
tocbot.init(this.options);
|
||||||
tocbot.init(this.options);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ toc: false
|
|||||||
|
|
||||||
## Comments
|
## Comments
|
||||||
|
|
||||||
The global switch of comments is defined by variable `comments.active` in the file `_config.yml`{: .filepath}. After selecting a comment system for this variable, comments will be turned on for all posts.
|
The global setting for comments is defined by the `comments.provider` option in the `_config.yml`{: .filepath} file. Once a comment system is selected for this variable, comments will be enabled for all posts.
|
||||||
|
|
||||||
If you want to close the comment for a specific post, add the following to the **Front Matter** of the post:
|
If you want to close the comment for a specific post, add the following to the **Front Matter** of the post:
|
||||||
|
|
||||||
|
|||||||
@@ -220,28 +220,22 @@ header {
|
|||||||
@-webkit-keyframes fade-up {
|
@-webkit-keyframes fade-up {
|
||||||
from {
|
from {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
position: relative;
|
margin-top: 4rem;
|
||||||
top: 2rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
to {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
position: relative;
|
|
||||||
top: 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes fade-up {
|
@keyframes fade-up {
|
||||||
from {
|
from {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
position: relative;
|
margin-top: 4rem;
|
||||||
top: 2rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
to {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
position: relative;
|
|
||||||
top: 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -250,6 +244,7 @@ header {
|
|||||||
%top-cover {
|
%top-cover {
|
||||||
content: '';
|
content: '';
|
||||||
display: block;
|
display: block;
|
||||||
|
position: -webkit-sticky;
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -260,13 +255,16 @@ header {
|
|||||||
#toc-wrapper {
|
#toc-wrapper {
|
||||||
top: 0;
|
top: 0;
|
||||||
transition: top 0.2s ease-in-out;
|
transition: top 0.2s ease-in-out;
|
||||||
-webkit-animation: fade-up 0.8s;
|
|
||||||
animation: fade-up 0.8s;
|
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
max-height: calc(100vh - 2rem);
|
max-height: 100vh;
|
||||||
scrollbar-width: none;
|
scrollbar-width: none;
|
||||||
margin-top: 2rem;
|
margin-top: 2rem;
|
||||||
|
|
||||||
|
&:not(.invisible) {
|
||||||
|
-webkit-animation: fade-up 0.8s;
|
||||||
|
animation: fade-up 0.8s;
|
||||||
|
}
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
font-size: 0.85rem;
|
font-size: 0.85rem;
|
||||||
@@ -274,16 +272,8 @@ header {
|
|||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
|
|
||||||
li {
|
li {
|
||||||
&:not(:last-child) {
|
|
||||||
margin: 0.4rem 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:first-child {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
a {
|
||||||
padding: 0.2rem 0 0.2rem 1.25rem;
|
padding: 0.4rem 0 0.4rem 1.25rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -336,7 +326,7 @@ header {
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
width: 15%;
|
width: 15%;
|
||||||
height: 3.25rem;
|
height: 2.25rem;
|
||||||
margin-left: -1px;
|
margin-left: -1px;
|
||||||
background: linear-gradient(transparent, var(--main-bg) 70%);
|
background: linear-gradient(transparent, var(--main-bg) 70%);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,35 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [7.2.4](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v7.2.3...v7.2.4) (2024-12-21)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* toc not visible when switching from mobile to desktop mode ([#2139](https://github.com/cotes2020/jekyll-theme-chirpy/issues/2139)) ([32051da](https://github.com/cotes2020/jekyll-theme-chirpy/commit/32051dad03cb8f60fa4206969377b9674f9a3f0c))
|
||||||
|
* **ui:** left borderline of TOC is notched ([#2140](https://github.com/cotes2020/jekyll-theme-chirpy/issues/2140)) ([8a4d0bc](https://github.com/cotes2020/jekyll-theme-chirpy/commit/8a4d0bc4ee9e142a11401cad80bc9605878f121d))
|
||||||
|
|
||||||
|
## [7.2.3](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v7.2.2...v7.2.3) (2024-12-15)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* refreshing mermaid theme may fail ([#2113](https://github.com/cotes2020/jekyll-theme-chirpy/issues/2113)) ([2f00d41](https://github.com/cotes2020/jekyll-theme-chirpy/commit/2f00d41861f1b06c2ff7fa4e67e14e647c3c34b0))
|
||||||
|
* **ui:** gap between TOC entries is inconsistent ([#2119](https://github.com/cotes2020/jekyll-theme-chirpy/issues/2119)) ([1b4e318](https://github.com/cotes2020/jekyll-theme-chirpy/commit/1b4e318dc1cd57da812e11bf69ebb06083c213fc))
|
||||||
|
* **ui:** slow script loading hides TOC fade-up effect in desktop ([#2120](https://github.com/cotes2020/jekyll-theme-chirpy/issues/2120)) ([e0c3faf](https://github.com/cotes2020/jekyll-theme-chirpy/commit/e0c3fafa470eb12bd04ffdf198018bc28b6de20d))
|
||||||
|
|
||||||
|
## [7.2.2](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v7.2.1...v7.2.2) (2024-12-06)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* js files in subdirectories are excluded from the site output ([#2101](https://github.com/cotes2020/jekyll-theme-chirpy/issues/2101)) ([f55cc31](https://github.com/cotes2020/jekyll-theme-chirpy/commit/f55cc31dbd0e7455328c80c7ef38186ad8e54099))
|
||||||
|
|
||||||
|
## [7.2.1](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v7.2.0...v7.2.1) (2024-12-05)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **build:** exclude `purgecss.js` from output files ([#2090](https://github.com/cotes2020/jekyll-theme-chirpy/issues/2090)) ([976e1a1](https://github.com/cotes2020/jekyll-theme-chirpy/commit/976e1a184b3dbe08991e8a50db4d5d7f8a0b7090))
|
||||||
|
* correct the import condition for theme script ([#2075](https://github.com/cotes2020/jekyll-theme-chirpy/issues/2075)) ([a16aa7d](https://github.com/cotes2020/jekyll-theme-chirpy/commit/a16aa7d41e3c3cb28649bfa1361e8bcb91b9ca47))
|
||||||
|
* ensure pageviews are fetched after DOM is loaded ([#2071](https://github.com/cotes2020/jekyll-theme-chirpy/issues/2071)) ([b4019f3](https://github.com/cotes2020/jekyll-theme-chirpy/commit/b4019f3517e4a3284df51567d29938cb12bf3acc))
|
||||||
|
* **toc:** resume fade up animation in desktop mode ([#2085](https://github.com/cotes2020/jekyll-theme-chirpy/issues/2085)) ([8280adb](https://github.com/cotes2020/jekyll-theme-chirpy/commit/8280adb901b9d15cc1bc18009553aae8746121d8))
|
||||||
|
|
||||||
## [7.2.0](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v7.1.1...v7.2.0) (2024-11-28)
|
## [7.2.0](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v7.1.1...v7.2.0) (2024-11-28)
|
||||||
|
|
||||||
### 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 = "7.2.0"
|
spec.version = "7.2.4"
|
||||||
spec.authors = ["Cotes Chung"]
|
spec.authors = ["Cotes Chung"]
|
||||||
spec.email = ["cotes.chung@gmail.com"]
|
spec.email = ["cotes.chung@gmail.com"]
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "jekyll-theme-chirpy",
|
"name": "jekyll-theme-chirpy",
|
||||||
"version": "7.2.0",
|
"version": "7.2.4",
|
||||||
"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",
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ const DIST = 'assets/js/dist';
|
|||||||
const banner = `/*!
|
const banner = `/*!
|
||||||
* ${pkg.name} v${pkg.version} | © ${pkg.since} ${pkg.author} | ${pkg.license} Licensed | ${pkg.homepage}
|
* ${pkg.name} v${pkg.version} | © ${pkg.since} ${pkg.author} | ${pkg.license} Licensed | ${pkg.homepage}
|
||||||
*/`;
|
*/`;
|
||||||
|
|
||||||
const frontmatter = `---\npermalink: /:basename\n---\n`;
|
const frontmatter = `---\npermalink: /:basename\n---\n`;
|
||||||
|
|
||||||
const isProd = process.env.BUILD === 'production';
|
const isProd = process.env.BUILD === 'production';
|
||||||
|
|
||||||
|
let hasWatched = false;
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
fs.rmSync(DIST, { recursive: true, force: true });
|
fs.rmSync(DIST, { recursive: true, force: true });
|
||||||
console.log(`> Directory "${DIST}" has been cleaned.`);
|
console.log(`> Directory "${DIST}" has been cleaned.`);
|
||||||
@@ -39,6 +39,11 @@ function build(
|
|||||||
{ src = SRC_DEFAULT, jekyll = false, outputName = null } = {}
|
{ src = SRC_DEFAULT, jekyll = false, outputName = null } = {}
|
||||||
) {
|
) {
|
||||||
const input = `${src}/${filename}.js`;
|
const input = `${src}/${filename}.js`;
|
||||||
|
const shouldWatch = hasWatched ? false : true;
|
||||||
|
|
||||||
|
if (!hasWatched) {
|
||||||
|
hasWatched = true;
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
input,
|
input,
|
||||||
@@ -49,9 +54,7 @@ function build(
|
|||||||
banner,
|
banner,
|
||||||
sourcemap: !isProd && !jekyll
|
sourcemap: !isProd && !jekyll
|
||||||
},
|
},
|
||||||
watch: {
|
...(shouldWatch && { watch: { include: `${SRC_DEFAULT}/**/*.js` } }),
|
||||||
include: input
|
|
||||||
},
|
|
||||||
plugins: [
|
plugins: [
|
||||||
babel({
|
babel({
|
||||||
babelHelpers: 'bundled',
|
babelHelpers: 'bundled',
|
||||||
|
|||||||
Reference in New Issue
Block a user