mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-18 21:53:26 +00:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0360c9e90b | ||
|
|
d87c2de675 | ||
|
|
f55cc31dbd | ||
|
|
7630356a94 | ||
|
|
6c112c641a | ||
|
|
976e1a184b | ||
|
|
7ea3545ba3 | ||
|
|
8280adb901 | ||
|
|
4180992272 | ||
|
|
a16aa7d41e | ||
|
|
8e55e4dcb2 | ||
|
|
b4019f3517 | ||
|
|
2966fc174d |
@@ -212,8 +212,9 @@ exclude:
|
||||
- tools
|
||||
- README.md
|
||||
- LICENSE
|
||||
- "*.config.js"
|
||||
- package*.json
|
||||
- purgecss.js
|
||||
- rollup.config.js
|
||||
- "package*.json"
|
||||
|
||||
jekyll-archives:
|
||||
enabled: [categories, tags]
|
||||
|
||||
@@ -99,9 +99,7 @@
|
||||
|
||||
<!-- Scripts -->
|
||||
|
||||
{% unless site.theme_mode %}
|
||||
<script src="{{ '/assets/js/dist/theme.min.js' | relative_url }}"></script>
|
||||
{% endunless %}
|
||||
<script src="{{ '/assets/js/dist/theme.min.js' | relative_url }}"></script>
|
||||
|
||||
{% include js-selector.html lang=lang %}
|
||||
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
<!-- Display GoatCounter pageviews -->
|
||||
<script>
|
||||
let pv = document.getElementById('pageviews');
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const pv = document.getElementById('pageviews');
|
||||
|
||||
if (pv !== null) {
|
||||
const uri = location.pathname.replace(/\/$/, '');
|
||||
const url = `https://{{ site.analytics.goatcounter.id }}.goatcounter.com/counter/${encodeURIComponent(uri)}.json`;
|
||||
if (pv !== null) {
|
||||
const uri = location.pathname.replace(/\/$/, '');
|
||||
const url = `https://{{ site.analytics.goatcounter.id }}.goatcounter.com/counter/${encodeURIComponent(uri)}.json`;
|
||||
|
||||
fetch(url)
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
const count = data.count.replace(/\s/g, '');
|
||||
pv.innerText = new Intl.NumberFormat().format(count);
|
||||
})
|
||||
.catch((error) => {
|
||||
pv.innerText = '1';
|
||||
});
|
||||
}
|
||||
fetch(url)
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
const count = data.count.replace(/\s/g, '');
|
||||
pv.innerText = new Intl.NumberFormat().format(count);
|
||||
})
|
||||
.catch((error) => {
|
||||
pv.innerText = '1';
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
{% if enable_toc %}
|
||||
<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>
|
||||
<nav id="toc"></nav>
|
||||
</section>
|
||||
|
||||
@@ -15,8 +15,11 @@ export class TocDesktop {
|
||||
}
|
||||
|
||||
static init() {
|
||||
if (document.getElementById('toc-wrapper')) {
|
||||
const $tocWrapper = document.getElementById('toc-wrapper');
|
||||
|
||||
if ($tocWrapper) {
|
||||
tocbot.init(this.options);
|
||||
$tocWrapper.classList.remove('invisible');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,14 +234,11 @@ header {
|
||||
@keyframes fade-up {
|
||||
from {
|
||||
opacity: 0;
|
||||
position: relative;
|
||||
top: 2rem;
|
||||
margin-top: 4rem;
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
position: relative;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,7 +260,7 @@ header {
|
||||
-webkit-animation: fade-up 0.8s;
|
||||
animation: fade-up 0.8s;
|
||||
overflow-y: auto;
|
||||
max-height: calc(100vh - 2rem);
|
||||
max-height: 100vh;
|
||||
scrollbar-width: none;
|
||||
margin-top: 2rem;
|
||||
|
||||
@@ -336,7 +333,7 @@ header {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 15%;
|
||||
height: 3.25rem;
|
||||
height: 2.25rem;
|
||||
margin-left: -1px;
|
||||
background: linear-gradient(transparent, var(--main-bg) 70%);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,20 @@
|
||||
# Changelog
|
||||
|
||||
## [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)
|
||||
|
||||
### Features
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Gem::Specification.new do |spec|
|
||||
spec.name = "jekyll-theme-chirpy"
|
||||
spec.version = "7.2.0"
|
||||
spec.version = "7.2.2"
|
||||
spec.authors = ["Cotes Chung"]
|
||||
spec.email = ["cotes.chung@gmail.com"]
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "jekyll-theme-chirpy",
|
||||
"version": "7.2.0",
|
||||
"version": "7.2.2",
|
||||
"description": "A minimal, responsive, and feature-rich Jekyll theme for technical writing.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -11,11 +11,11 @@ const DIST = 'assets/js/dist';
|
||||
const banner = `/*!
|
||||
* ${pkg.name} v${pkg.version} | © ${pkg.since} ${pkg.author} | ${pkg.license} Licensed | ${pkg.homepage}
|
||||
*/`;
|
||||
|
||||
const frontmatter = `---\npermalink: /:basename\n---\n`;
|
||||
|
||||
const isProd = process.env.BUILD === 'production';
|
||||
|
||||
let hasWatched = false;
|
||||
|
||||
function cleanup() {
|
||||
fs.rmSync(DIST, { recursive: true, force: true });
|
||||
console.log(`> Directory "${DIST}" has been cleaned.`);
|
||||
@@ -39,6 +39,11 @@ function build(
|
||||
{ src = SRC_DEFAULT, jekyll = false, outputName = null } = {}
|
||||
) {
|
||||
const input = `${src}/${filename}.js`;
|
||||
const shouldWatch = hasWatched ? false : true;
|
||||
|
||||
if (!hasWatched) {
|
||||
hasWatched = true;
|
||||
}
|
||||
|
||||
return {
|
||||
input,
|
||||
@@ -49,9 +54,7 @@ function build(
|
||||
banner,
|
||||
sourcemap: !isProd && !jekyll
|
||||
},
|
||||
watch: {
|
||||
include: input
|
||||
},
|
||||
...(shouldWatch && { watch: { include: `${SRC_DEFAULT}/**/*.js` } }),
|
||||
plugins: [
|
||||
babel({
|
||||
babelHelpers: 'bundled',
|
||||
|
||||
Reference in New Issue
Block a user