* refactor: migrate i18n files from YAML to TOML format and simplify structure
* refactor: make translation file adjust to gohugoio/locales language code so date translation can work properly
* refactor: use hyphens instead of underscores for i18n, because that's how Hugo pick the translation file
* docs: update comments for i18n language availability and CJK language detection in hugo.toml.
* refactor: remove jsconfig.json
* chore: remove devcontainer config
* refactor: migrate Hugo configuration from `hugo.yaml` to dedicated `module.toml` and `params.toml` files, and update minimum Hugo version.
* refactor: migrate demo site configuration from `hugo.yaml` to `config/_default/*.toml`
* feat: enable local sidebar avatar for demo site and relocate its image to demo assets.
* feat: migrate demo site to Hugo Modules for theme management.
* fix: wrong config folder name
* refactor: centralize pagination logic into a new helper partial used for page titles and index display
* fix: list.html does not exclude hidden pages
* refactor: Simplify title generation logic
* chore: add +x to run.sh
* feat: dynamically generate background color for category links using hash
* feat: allow category styles to be overridden by term parameters
* refactor: remove default tag background and color variables
* fix(scss): limit `--zh-font-family` to only simplified Chinese
* feat(sampleSite): add test page for Japanese & Traditional Chinese
* Remove `--zh-font-family` variable
---------
Co-authored-by: Jimmy <jimmy@cai.im>
* 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>
* Use ResizeObserver to detect changes in the size of .article-content
This code is for handling changes in position caused by content rendered as part of post-processing, such as Mermaid diagrams
* Add debounced to resizeHandler
* Enhance text rendering with autospace properties
Added text autospace properties for better text rendering for CJK characters.
* Update text-autospace and text-spacing properties