Commit Graph
328 Commits
Author SHA1 Message Date
ba9a5caa16 feat: add support for Mermaid diagrams in Markdown content (#1186)
* Add support for Mermaid diagrams in markdown content

This commit introduces native Mermaid diagram rendering to the theme.

Following Hugo’s official documentation, a new custom code block renderer
(`render-codeblock-mermaid.html`) was added under `layouts/_default/` to
detect Mermaid code blocks and inject the necessary script flag into the
page context.

Additionally, the `baseof.html` template now conditionally includes the
Mermaid JS module from the CDN when a page contains a Mermaid diagram:

  {{ if .Store.Get "hasMermaid" }}
    <script type="module">
      import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs';
      mermaid.initialize({ startOnLoad: true, theme: 'neutral' });
    </script>
  {{ end }}

This enables rendering of fenced code blocks using the `mermaid` language
in markdown files without requiring any external preprocessing.

* Create article/components/mermaid and fix script version

---------

Co-authored-by: Jimmy <jimmy@cai.im>
2025-12-22 13:40:33 +01:00
47db505228 feat: pagination improvements to maximize space utilization (#1165)
* Minor improvements to pagination functions

* Update pagination styles with enhanced UI/UX design

- Implemented full-width layout with flexible page numbers
- Added fixed-width arrow buttons for consistent navigation
- Enhanced hover and active states for better user interaction
- Improved responsive design with proper flex layout
- Added comprehensive styling for disabled and ellipsis states

* Simplify pagination logic and use SVG files to avoid repeated definition

* Remove change to jsconfig.json

* Remove comments and classes

---------

Co-authored-by: delize <4028612+delize@users.noreply.github.com>
Co-authored-by: Jimmy <jimmy@cai.im>
2025-12-22 00:21:02 +01:00
7df31001af fix(theme): Adjust Cusdis widget scrollbar and background to match Stack theme (#1204)
* fix: adjust cusdis scrollbar styling and background for stack theme

* feat: dynamically set cusdis background color

---------

Co-authored-by: Jimmy <jimmy@cai.im>
2025-12-21 20:55:09 +01:00
Jimmy 73ccacec4d release: 3.32.0 2025-11-01 21:15:56 +00:00
JimmyandGitHub 2612ca87dc feat: allow specify alt for link's image (#1198) 2025-11-01 22:14:52 +01:00
CelesteandGitHub e8fc315ead fix: decode special characters in the search bar on 404 pages (#1098)
An extremely simple fix to decode special characters
2025-11-01 22:01:24 +01:00
AMomentandGitHub dd3bb1ea13 feat: render math formula for the table of contents (#1137)
Add math formula render to table of contents

Add element (.widget--toc) to be rendered by KaTeX
2025-11-01 21:54:06 +01:00
Andreas DeiningerandGitHub 291fe5fd7e feat: remove deprecated Hugo templates and shortcode usage (#1150)
Adapt site to latest hugo version 0.147.1
2025-11-01 21:49:15 +01:00
AradielandGitHub 5a10223f4c fix: modify sidebar link active conditions (needs to be the same page URL) (#1153)
Sidebar link active conditions - needs to be the same page
2025-11-01 21:41:10 +01:00
powerfullzandGitHub c413980b89 fix(twikoo): certain Twikoo elements wouldn’t automatically switch colours in dark mode and update to Twikoo version 1.6.44 (#1163) 2025-11-01 21:35:09 +01:00
Christian Martínez de la RosaandGitHub 6d98e8463f fix: use localized title for categories taxonomy in archives page (#1158)
closes #1157
2025-11-01 21:30:37 +01:00
Terence EdenandGitHub f824d08f6f fix: semantic <time> by adding datetime attribute (#1184)
Fix semantic <time>

The HTML validator was throwing an error because there was no valid datetime attribute.
2025-11-01 20:53:37 +01:00
JimmyandGitHub 8cb1646198 style: remove unused count class in tag cloud (#1195) 2025-10-31 23:48:40 +01:00
Jimmy 9e96c6e975 release: 3.31.0 2025-09-10 10:14:29 +00:00
Gleb A.andGitHub 47832083d8 refactor(comments): use includes instead of indexOf to improve readability (#1128)
* fix(disqusjs): refactor local DisqusJS loading check for improved readability

* fix(gitalk): refactor local Gitalk loading check for improved readability
2025-05-21 12:52:47 +02:00
LparksiandGitHub d9acd77015 feat(comment/waline): add support for Waline's turnstileKey (#1140)
* fix: Added support for waline's turnstileKey

* style: remove extra space in waline.html
2025-05-21 12:31:22 +02:00
Bernat Borràs CivilandGitHub 06aa627d3c fix(article): date translation on compact mode (#1149)
* Fix translation

* Revert jsconfig
2025-05-21 12:25:11 +02:00
Jimmy Cai 9e6b7b22a9 release: 3.30.0 2025-01-23 22:55:27 +01:00
JimmyandGitHub f1ab6c6aba fix(giscus): no longer use $.Language.LanguageCode for the language of Giscus (#1118)
fix(giscus): rollback https://github.com/CaiJimmy/hugo-theme-stack/pull/1075

User can still customize the language used for Giscus using `.Site.Params.comments.giscus.lang` parameter.
2025-01-23 22:54:37 +01:00
fsj2009yxandGitHub 0991f61d49 fix(comment/waline): cannot read property ‘insertBefore’ of null (#1103)
* fix: resolve issue with comments not displaying due to KaTeX and Waline render order

* Fix the problem that comment data couldn't be pulled successfully and raise Error "Cannot read property ‘insertBefore’ of null""
2024-12-22 12:44:13 +01:00
Jimmy Cai 839fbd0ecb release: 3.29.0 2024-10-20 08:05:45 +00:00
Jimmy CaiandGitHub 5175ac5ae3 fix(giscus): fallback to en if no language code is set (#1084) 2024-10-20 10:04:59 +02:00
Jimmy CaiandGitHub 37f1541c20 feat: search box in 404 page (#1081) 2024-10-20 00:26:59 +02:00
Jimmy Cai f4eb5d3e99 release: 3.28.0 2024-10-19 21:32:49 +00:00
xiaoxiyaoandGitHub 788dd497b3 feat: add fingerprints to the JS file URL to utilize HTTP caching (#1076) 2024-10-19 21:14:35 +02:00
xiaoxiyaoandGitHub 8a7fb33163 feat(giscus): use current language as fallback for lang param and add loading param (#1075)
fix: giscus use current lang as default, and add missing `loading` params
2024-10-19 20:46:27 +02:00
Jimmy Cai 048a000f17 release: 3.27.0 2024-09-07 18:57:23 +02:00
powerfullzandGitHub fa760d70cb fix: use css.Sass instead of deprecated resources.ToCSS (#1054) 2024-09-07 18:42:07 +02:00
Syafa AdenaandGitHub bdcab89d86 chore: bump Twikoo front-end to latest released version 1.6.39 (#1021) 2024-09-07 18:14:57 +02:00
0558108e30 feat(comments): add support to Gitalk proxy parameter (#1012)
Co-authored-by: Jimmy Cai <hi@jimmycai.com>
2024-09-07 17:18:03 +02:00
Anthony SimmonandGitHub 12f31dfd8a fix: use Hugo's default RSS template value source for lastBuildDate (#1006)
Use Hugo's default RSS template value source for lastBuildDate
2024-09-07 14:22:17 +02:00
weeixandGitHub 374b25a60f fix(i18n): fix unlocalized article publish/lastUpdated date (#1050)
closes https://github.com/CaiJimmy/hugo-theme-stack/issues/1040
2024-09-07 13:48:09 +02:00
Jimmy Cai fddab05362 release: 3.26.0 2024-05-02 23:28:01 +02:00
Jimmy CaiandGitHub f3783856ad feat: add article.headingAnchor parameter and use CSS pseudo-element to display # symbol of heading anchor (#1016)
* feat: add `article.headingAnchor` parameter

* feat: use CSS pseudo-element to display `#` symbol of heading anchor

This prevents RSS feed readers and screen readers from seeing an extra `#`.

* Deactivate `article.headingAnchor` by default
2024-05-02 23:27:17 +02:00
Jimmy CaiandGitHub 130e2f6607 feat: display header anchor on hover (#999) 2024-03-30 23:22:18 +01:00
Jimmy Cai ce798a32a9 release: 3.25.0 2024-03-27 17:01:23 +01:00
Jimmy CaiandGitHub 609d43b088 fix: make KaTeX render all math inside document.body (#994)
Since it only accepts one element, I cannot pass `.article-content` and `#TableOfContent` to it. The official documentation uses `document.body` directly, so I guess that's fine.

closes https://github.com/CaiJimmy/hugo-theme-stack/issues/882
2024-03-27 16:38:30 +01:00
Jimmy CaiandGitHub 797949b37f fix: rename .social-menu to .menu-social to avoid being blocked by ad blockers (#993)
closes https://github.com/CaiJimmy/hugo-theme-stack/issues/924
2024-03-27 16:24:03 +01:00
Jimmy CaiandGitHub 539c39d69a feat: add anchor link to markdown heading (#992)
closes https://github.com/CaiJimmy/hugo-theme-stack/issues/935
2024-03-27 16:08:19 +01:00
andrewmoiseandGitHub b2157bdf78 docs: update some invalid documentation links (#983)
Update some documentation links (some were dead links)
2024-03-27 11:09:17 +01:00
Jimmy CaiandGitHub 23607527e4 fix: use page resource permalink in link image (#990)
closes https://github.com/CaiJimmy/hugo-theme-stack/issues/982
2024-03-27 10:58:22 +01:00
Jimmy Cai 54a8ace564 release 3.24.2 2024-03-17 20:41:27 +01:00
Andreas DeiningerandGitHub b3fbe78ca5 fix: deprecation warning for .Site.Author (#979)
Fix deprecation warning for .Site.Author, deprecated in Hugo 0.124.0
2024-03-17 20:40:56 +01:00
Jimmy CaiandGitHub 2cb5ba683b fix: remove \n character from meta description (#980) 2024-03-17 20:39:16 +01:00
Jimmy Cai 5a8607e4a8 release: 3.24.1 2024-03-12 14:52:03 +01:00
Andrew DoeringandGitHub eafcf894c8 fix: favicon does not load if baseurl includes a subfolder (#972)
Use relURL https://gohugo.io/functions/urls/relurl/
2024-03-12 14:50:49 +01:00
Jimmy CaiandGitHub 0b9f6c36ad fix(head): prevent Go template from escaping HTML entities in meta description (#973) 2024-03-12 14:45:59 +01:00
Jimmy Cai 04bf1956b9 release: 3.24.0 2024-03-10 22:57:26 +01:00
Jiahao LiandGitHub 6c7d42d45a fix(sidebar): menu-bottom-section not showing in mobile (#966)
* fix(sidebar): Bottom section not showing in mobile

* fix(sidebar): Align bottom section to bottom

* fix(sidebar): Gap missing in bottom section

* refactor(sidebar): Simplify styles

* refactor(sidebar): Remove useless padding-left

* refactor(sidebar): Remove useless margin-top

* refactor(sidebar): Combine duplicate flex-direction

* refactor(sidebar): Remove redundant width
2024-03-10 22:56:30 +01:00
Andreas DeiningerandGitHub 4948a3723e fix: .Site.LastChange deprecation (#968)
Fix the deprecation warning emitted from Hugo, and fix the typo in ` exampleSite/content/page/about/index.md`
2024-03-10 19:57:03 +01:00