Commit Graph
35 Commits
Author SHA1 Message Date
JimmyandGitHub 2be5b48324 feat(list): ability to show article tags on homepage (#1270)
* feat(list): ability to show article tags on homepage

closes https://github.com/CaiJimmy/hugo-theme-stack/issues/880

* Disable showTags by default
2026-02-19 17:45:09 +01:00
bc1b55e60a fix: improve Mermaid diagram implementation (#1214)
* fix: improve Mermaid diagram implementation (#1213)

This commit addresses multiple issues with Mermaid diagram rendering
and adds significant improvements to the user experience.

- Fix `<br/>` tags rendering as literal text instead of line breaks
- Fix flash of raw mermaid code before diagram renders
- Fix Gantt chart rendering issues in dark mode
- Fix diagrams briefly showing during theme switch re-render
- Fix expand modal showing diagram left-aligned before centering

- Add fullscreen expand modal with pan/zoom functionality
- Add toolbar with zoom controls (zoom in/out, reset, fit to screen)
- Add keyboard support (Escape to close modal)
- Add per-diagram transparent background via `%%transparent%%` directive
- Add comprehensive configuration options:
  - `look`: classic or handDrawn (sketch style)
  - `lightTheme`/`darkTheme`: theme selection per mode
  - `lightThemeVariables`/`darkThemeVariables`: custom theme colors
  - `securityLevel`, `htmlLabels`, `maxTextSize`, `maxEdges`
  - `fontSize`, `fontFamily`, `curve`, `logLevel`

- Switch from ESM to UMD bundle for faster initial load (~1s vs 2s+)
- Lazy-load panzoom library only when expand modal is opened
- Pre-render alternate theme during idle time for instant theme switching
- Cache rendered diagrams to avoid re-rendering on theme toggle

- Move all inline CSS to article.scss using SCSS nesting
- Extract helper functions for better maintainability
- Use data attributes and event delegation for cleaner handlers
- Reduce mermaid.html from 411 to 177 lines (57% reduction)

- Add comprehensive mermaid-diagrams example post with all diagram types
- Document all configuration options in hugo.yaml

* refactor: extract mermaid inline JS to TypeScript module

Move ~155 lines of inline JavaScript from mermaid.html partial into
assets/ts/mermaid.ts. The partial shrinks from 179 to 36 lines and now
only contains modal HTML markup and Hugo Pipes build/import logic.

- Deduplicate initWithTheme() and renderOffscreen() helpers
- Enable minification via Hugo Pipes js.Build in production
- Remove user-configurable mermaid version from params.toml

---------

Co-authored-by: delize <4028612+delize@users.noreply.github.com>
2026-02-17 17:55:03 +01:00
JimmyandGitHub a069e975aa style: remove extra margin in article description (#1242) 2026-01-26 13:52:10 +01:00
JimmyandGitHub 12daa8c9fc feat: dynamically generate background color for category links (#1225)
* 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
2026-01-25 17:35:40 +01:00
Jimmy CaiandGitHub fcd56dd21c fix: article category overflow (#1055)
closes https://github.com/CaiJimmy/hugo-theme-stack/issues/1045
2024-09-07 13:25:26 +02:00
Jacob ZhongandGitHub be4fd55095 feat(article): font enhancement (#767)
Change font settings
2023-09-03 15:32:44 +02:00
Jimmy CaiandGitHub 4e2e90da4c fix: page translation links overflow (#861)
closes https://github.com/CaiJimmy/hugo-theme-stack/issues/788
2023-08-15 12:46:29 +02:00
Jimmy CaiandGitHub b03390d237 Revert "Merge branch 'canary' into master" (#712)
Revert "Merge branch 'canary' into master (#711)"

This reverts commit 8a597a5c9c.
2022-10-29 17:14:19 +02:00
Jimmy CaiandGitHub 8a597a5c9c Merge branch 'canary' into master (#711)
* refactor(i18n): simplify the structure of the translation file

* chore: prepare repository for v4.0.0-alpha

* chore: modify go.mod to v4

* refactor: migrate theme configuration to TOML

* fix: exampleSite not using correct theme

* feat: add favicon from assets folder

* refactor: drop linear grandient background feature

remove node-vibrant from dependencies

* feat: use Hugo's code block render hook to implement code copy button

Now it can have i18n support

* refactor: delete color.ts

* refactor: delete Emoji support post from example site

* refactor: drop support for `hidden` field in front matter

* feat: upgrade to PhotoSwipe v5

* chore: bump the required hugo version to 0.100.0

* refactor: remove PhotoSwipe from external.yaml

* fix: extra margin in search result

* fix: incorrect markdown heading level in example site

* refactor: remove some usages of `default` in template

No longer needed thanks to Hugo's configuration merge

* fix: one line codeblock style in firefox

closes https://github.com/CaiJimmy/hugo-theme-stack/issues/564

* feat: add style to new codeblock

* feat: i18n support for codeblock copy text

* fix(menu): jitter when closing menu

It's caused by flexbox gap property, which can't animate

* fix(search): long text overflows under the Search icon

closes https://github.com/CaiJimmy/hugo-theme-stack/issues/515
2022-10-29 17:02:24 +02:00
Jimmy CaiandGitHub d806226ec8 fix: article-details gap 2022-03-03 22:39:04 +00:00
Jimmy CaiandGitHub 8abaa444c1 refactor: add flexbox gap to .article-details 2022-03-03 22:36:17 +00:00
Jimmy CaiandGitHub 04cdbcfedf refactor: Use flexbox gap (#520) 2022-03-03 23:11:19 +01:00
Jimmy CaiandGitHub b3b8fa73ef feat(article): add link to translated content (#511) 2022-02-27 09:48:57 +01:00
dcfc7b5589 feat(article): reading time (#204)
* add reading time feature

* Revert change in jsconfig.json

* feat: add article.readingTime param, and improve style

* Revert change in jsconfig.json x2

* Remove reading time in compact layout

It doesn't look right to me for now

* feat: add i18n support to reading time string

* Hide footer.article-time when there's not content

Co-authored-by: Jimmy Cai <github@jimmycai.com>
2021-07-23 18:37:30 +02:00
Jimmy CaiandGitHub 495a3b0289 refactor: rewrite grid system & style changes (#231)
* refactor(WIP): add new SCSS mixin `respond`

Theme's stylesheet mixes the use of max-width and min-width for responsive design, and it's horrible.

* refactor: update variable.scss to use @mixin respond

* refactor(grid): adjust sidebar max-width

* refactor(partials/article.scss): use `@include respond`

* refactor(layout/article.scss): delete unused SCSS and migrate to `@include respond`

* Adjust left sidebar max-width on xl screen

* fix: right sidebar not sticky

* refactor(breakpoint): simplify `@mixin respond`

* refactor(breakpoints): improve warning message

* fix(breakpoint): return only the requested breakpoint

* fix: add missing padding to .article-details
2021-06-20 12:53:10 +02:00
Jimmy CaiandGitHub f2955aac27 refactor(article): improve category tag style (#94) 2020-12-25 09:59:02 +01:00
Jimmy CaiandGitHub de79b8a470 fix(list): add missing object-fit property to compact list (#87) 2020-12-24 10:43:09 +01:00
Jimmy Cai b027cbf5aa Merge branch 'master' into template-search 2020-10-04 16:05:02 +02:00
Jimmy Cai 1749a9168f feat: style adjustment 2020-10-04 15:58:32 +02:00
Jimmy Cai e5f96c8762 feat: add search template 2020-09-26 11:40:33 +02:00
Jimmy Cai 5a7c9b6783 feat(article): style improvement 2020-09-25 11:07:49 +02:00
Jimmy Cai 96897be941 feat(article list): article clickable and equal height 2020-09-24 23:59:00 +02:00
Jimmy Cai 02f2badffc refactor(scss): rename --content-padding to --card-padding
closes https://github.com/CaiJimmy/hugo-theme-stack/issues/16
2020-09-20 19:03:41 +02:00
Jimmy Cai 9e42d8cd35 refactor(scss): remove helper/shadow. Expose shadow style in CSS variables 2020-09-09 16:14:30 +02:00
Jimmy Cai 199517d988 feat: add hover effect to article list card, tag cloud and archive list 2020-09-07 17:28:22 +02:00
Jimmy Cai 2ab49f97ee feat: add default/list
fix warning: found no layout file for "HTML" for kind "section": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
2020-09-06 14:18:38 +02:00
Jimmy Cai 6cdb4b05ad feat(article): change article-title font size 2020-09-05 01:09:46 +02:00
Jimmy Cai bbe7e4b73d feat(style): improve typography styles 2020-09-03 23:32:28 +02:00
Jimmy Cai af487e0f3f feat(style): remove timeago.js, and improve article-time style 2020-09-03 11:47:55 +02:00
Jimmy Cai 4bf9d82961 feat: style improvement 2020-09-03 11:42:01 +02:00
Jimmy Cai 4e9a6f1421 refactor(scss): add --section-separation and --small-card-padding variables 2020-08-24 20:28:17 +02:00
Jimmy Cai dedb859ecc refactor(article): --content-side-padding -> --content-padding 2020-08-24 12:26:27 +02:00
Jimmy Cai 36f53f592b refactor(article): use var(--content-side-padding) in more places 2020-08-24 12:17:43 +02:00
Jimmy Cai da3589d068 fix(article): specify color of .article-title 2020-08-23 11:34:23 +02:00
Jimmy Cai c698d944e6 🎉 Initial commit 2020-08-22 13:20:08 +02:00