* 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""
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
* fix(partials): ensure params always exist
If the `params` key is not defined in the config file, accessing `params` results in a `nil pointer evaluating interface {}` error because `params` does not exist.
This can be fixed by ensuring that params is always a map.
* style(widgets): `default` no pipes required
* fix: title does not show pagination data
This is caused by partialCached. It turns out that the `.RelPermalink` is the same for all pages generated by the paginator, so they will show the same title as the first page.
closes https://github.com/CaiJimmy/hugo-theme-stack/issues/941
* doc(exampleSite): set paginate to 3 to force pagination