1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2026-06-22 07:48:42 +00:00
Commit Graph

21 Commits

Author SHA1 Message Date
Cotes Chung 7496dd41fa feat(theme): persist user theme preferences (#2756)
- Migrate theme persistence from `sessionStorage` to `localStorage`
- Rename theme HTML attribute to `data-bs-theme` for Bootstrap compatibility
- Trim and compile CSS according to the chosen theme mode
2026-06-17 23:20:12 +08:00
Cotes Chung ceb2a41463 fix(giscus): synchronize theme state during lazy loading (#2742)
Previously, theme switch events were lost if triggered before the
Giscus iframe was fully loaded (e.g., when deferred by lazy loading
or before the client script executed). This resulted in Giscus
rendering with the outdated initial theme once it finally appeared
in the viewport.

This commit handles these edge cases by:
1. Updating the `data-theme` attribute on the Giscus script node
   if the iframe hasn't been created yet.
2. Modifying the `theme` query parameter in the iframe's `src` URL
   if it is currently in a pending/lazy-loading state.
2026-05-23 23:00:48 +08:00
Cotes Chung 65f960c31a perf: speed up page rendering and jekyll build process (#2034)
Close stale issues and PRs / stale (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Style Lint / stylelint (push) Has been cancelled
Lint Commit Messages / commitlint (push) Has been cancelled
Build and Deploy / build (push) Has been cancelled
Build and Deploy / deploy (push) Has been cancelled
- Ensure inline scripts execute after the DOM has fully loaded.
- Use Rollup to bundle the theme-mode and Mermaid scripts, reducing the number of Jekyll include snippets.
2024-11-16 22:49:55 +08:00
Cotes Chung 0709854dc8 fix: adapt the giscus localization parameter (#1810) 2024-06-16 22:25:41 +08:00
Cotes Chung 778ebdf250 chore: delete JS comments from HTML 2024-04-29 03:25:26 +08:00
Cotes Chung fe7afa379f perf: replace jQuery with Vanilla JS (#1681)
Also replaced `magnific-popup` with `GLightbox`
2024-04-17 06:10:01 +08:00
GetOutOfMyBakery 700fd5bad7 feat: add support for giscus strict title matching (#1614) 2024-03-18 19:08:05 +08:00
Cotes Chung e9c920641b perf(comments): lazy load giscus (#1254)
Enable the `giscus` lazy loading option to improve web performance.
2023-09-20 05:48:14 +08:00
Cotes Chung 13a3c3c906 perf(layout): improve margins for tail block (#1243)
Keeps the margin of the elements in the tail area consistent regardless of the number of siblings, or if a <script> is inserted.
2023-09-18 03:26:02 +08:00
Cotes Chung b34661efd7 fix: avoid utterances initialization failure (#1234)
This issue exists since Chirpy `v6.0.0`
2023-09-15 01:24:13 +08:00
Cotes Chung bb589e8d31 style: prettify utteranc code snippet 2023-09-15 01:13:20 +08:00
Cotes Chung 505e314a31 perf: refactor using semantic HTML (#1207)
Fixes #1196
2023-09-08 22:48:37 +08:00
Cotes Chung 9d97120197 perf(assets): reduce HTTP requests to CDN 2023-05-13 03:29:06 +08:00
Song-Zi Vong 6fec411c18 fix: mode-toggle leads to Disqus loading failure (#945) 2023-03-22 22:22:07 +08:00
Cotes Chung b0d5956f5a fix(comment): disqus doesn't follow theme mode switching 2022-11-22 19:05:19 +08:00
Petr Ruzicka 70662a0365 chore(giscus): add reactions-enabled option (#712) 2022-10-15 04:31:44 +08:00
Cotes Chung 0f6b170e24 Use constants to define resources for utterances
Self-host the JS for `utterances` is not necessary, because the list of comments cannot be loaded if the network is offline.
2022-02-12 05:47:48 +08:00
Cotes Chung 4df4f7f8db Add Giscus comments support (resolve #501) 2022-02-12 05:47:48 +08:00
Cotes Chung 3685685b28 Make the source of the static assets configurable
- Easy to switch between different CDN
- Allow self-host static assets
2022-02-10 04:12:35 +08:00
Cotes Chung f8f4dd889e Normalized attribute name in HTML
Add prefix `data-` for following attributes:
- `topbar-visible`
- `mode`
- `label-text`
- `title-succeed`
2022-01-13 00:23:08 +08:00
Cotes Chung d315bf57e7 Integrate utterances comments 2021-12-13 04:40:05 +08:00