* 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>
* 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>
* fix: adjust cusdis scrollbar styling and background for stack theme
* feat: dynamically set cusdis background color
---------
Co-authored-by: Jimmy <jimmy@cai.im>
* fix(disqusjs): refactor local DisqusJS loading check for improved readability
* fix(gitalk): refactor local Gitalk loading check for improved readability
* 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""
* 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
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