Commit Graph

559 Commits

Author SHA1 Message Date
Cell a96ba665ac refactor(assets)!: rewrite content encryption with AES-256-GCM and PBKDF2 (#806)
* refactor(assets)!: rewrite content encryption with AES-256-GCM and PBKDF2

- Remove legacy Base64 obfuscation layer (content-encryption.html)
- Replace <cipher-text> with <template> for inert content storage
- Single-layer AES-256-GCM encryption via post-build script
- PBKDF2 key derivation (100k iterations) for encryption
- PBKDF2-protected password verification (data-verify-salt)
- Depth-tracking parser for nested shortcode support
- Dev mode: plaintext content used directly without encryption
- Remove crypto-js and xxhash-wasm vendored dependencies

* feat(post-encrypt): prepare package for npm publishing

- Add bin entry, build script, and dist output for npx usage
- Replace @hugo-fixit/shared with standalone implementations
- Add CLI shebang for direct execution
- Add package README with usage documentation
- Remove FIXIT_ENCRYPT_INPUT env var (redundant with --input)
- Add encryption detection warning in assets.html
- Remove Post-build Encryption sections from READMEs

* chore: integrate post-encrypt into build pipeline and use consola

- Replace console with consola for post-encrypt logging
- Improve verification messages (no templates, count, etc.)
- Simplify build scripts: encrypt runs as part of main build
- Update encryption detection warning to use npx command

* feat(assets): add encryption dev warning admonition

- Add danger admonition in single.html for full-page encryption (dev mode only)
- Add encryption detection warning in assets.html console
- Improve post-encrypt verification messages with template count

* feat(assets): improve encryption i18n, cache security, and error handling

- Add encryptionWarning and encryptionCommand i18n keys for all 16 languages
- Store PBKDF2 verification hash in localStorage cache for better security
- Show decryption errors via flashTooltip instead of console only
- Add FixItDecryptor type definitions in global.ts
- Move encryption detection to init/detection-encryption.html with batched warning
- Remove redundant per-page warning from assets.html

* feat(assets): redesign fixit-decryptor UI with card layout

- Page-level: card form with lock icon header, password input with key icon, primary-colored unlock button, circular re-encrypt button
- Shortcode-level: connected input+button design (search bar style) with focus ring sync
- Remove loading spinner, use display:none/flex toggle via .initialized class
- Move lock icon styling to UnoCSS (text-primary text-xl)
- Initialize CellTooltip on re-encrypt button
- Fix JSDoc @param warnings in global.ts

* refactor(assets): unify TOC template and decryptor animations

- TOC always rendered in `<template data-toc>`, containers populated by initToc()
- Moved TOC scroll/resize handling from events.ts to toc.ts (syncTocLayout, syncTocActiveState)
- Removed EventsModule toc dependency, updated public-api.ts constructor
- Removed visibility:hidden from #toc-auto
- Decryptor: form always visible, @starting-style for fade-in on init
- Decryptor: content expand/collapse animation using height + opacity
- Removed encrypted-hidden from TOC elements in single.html

* refactor(assets): add target to fixit:decrypted event and simplify handlers

- Add { target: Element } payload to fixit:decrypted in event-bus.ts
- Remove $content closure from fixit-decryptor init(), use detail.target
- Update content.ts and toc.ts to use detail.target from event

* fix(assets): use eventBus for TOC scroll/resize listeners and eliminate redundant template parsing

- Replace raw window scroll/resize listeners in TocModule with eventBus
  subscriptions (fixit:scroll/fixit:resize), reusing EventsModule's
  throttle and debounce instead of duplicating un-throttled handlers.
- Refactor hasUnencryptedTemplate in post-encrypt to accept the already-
  computed matches array, avoiding a redundant findEncryptionTemplates
  call on the same HTML content.
- Remove crypto-js and xxhash-wasm from README credits.

* style(assets): soften decryptor button background and add form hover shadow

* build(workflow): add post-encrypt step to build script
2026-07-05 23:26:11 +08:00
Cell 52ab989c96 feat(styles): add new utility classes for info, primary, success, and warning backgrounds and text colors 2026-07-03 16:47:37 +08:00
Cell fb0c00e274 refactor(assets): simplify breakpoints and update UnoCSS CLI config
- Refactor SCSS breakpoints to flat min-width values (680/960/1200/1440)
  with _bp-max helper deriving ranges from adjacent breakpoints
- Add 'xs': null to breakpoints map, remove special-case handling
- Update responsive image sizes to match exact breakpoint max values
- Add print:hidden to UnoCSS safelist as replacement for d-none-print
- Move UnoCSS CLI config to cli.entry in uno.config.ts
- Rename css:build → unocss, css:dev → unocss:watch
- Update documentation (CLAUDE.md, CONTRIBUTING.md, copilot-instructions.md)
2026-06-27 16:28:31 +08:00
Cell 8af8e806d7 feat(assets): integrate UnoCSS for utility classes and presetIcons (#795)
* refactor(assets): integrate UnoCSS for utility classes

- Add UnoCSS with presetWind3 as pre-built CSS (assets/css/unocss.css)
- Add uno.config.ts with theme breakpoints, colors, safelist, and blocklist
- Replace SCSS utility classes with UnoCSS atomic classes:
  - d-none → hidden
  - d-none-desktop → sm:hidden
  - d-none-mobile → max-sm:hidden
  - order-* (safelist)
  - variant-numeric → tabular-nums lining-nums
- Rename .blur to .is-blur to avoid UnoCSS conflict
- Add @unocss-skip comments for SVG path elements to prevent false positives
- Remove redundant _utilities.scss ($orders map) and simplify _common.scss
- Update documentation (CLAUDE.md, CONTRIBUTING.md, copilot-instructions.md)

* refactor(assets): replace 404/offline SCSS with UnoCSS atomic classes

- Replace _404.scss styles with atomic classes on template elements
- Replace _offline.scss styles with atomic classes on template elements
- Keep selectors (id/class) as user customization hooks
- Delete assets/scss/pages/_404.scss and _offline.scss

* refactor(assets): simplify SCSS with UnoCSS atomic classes

- Replace _bilibili.scss with atomic classes (relative, aspect-video, inset-0)
- Replace _version.scss with atomic classes (whitespace-nowrap, align-text-bottom)
- Replace _noscript-warning.scss with atomic classes (bg-danger, fixed, z-200)
- Add semantic z-index shortcuts (z-hide, z-auto, z-base, z-loading, z-sticky, z-fixed)
- Add h1-h6 to UnoCSS blocklist to prevent false positives
- Use Source path for UnoCSS CSS loading to enable Hugo minify

* chore(assets): minor SCSS and template cleanup

* fix(assets): add secondary color to UnoCSS theme config

text-secondary was broken because the secondary color mapping was missing.

* feat(assets): add UnoCSS presetIcons support and z-index shortcuts

- Add presetIcons preset with empty collections (ready for custom icon sets)
- Add @iconify/json and @iconify/utils devDependencies
- Add semantic z-index shortcuts (z-hide, z-auto, z-base, z-loading, z-sticky, z-fixed)
- Add secondary color to UnoCSS theme config

* refactor(assets): replace SVG icons with UnoCSS presetIcons

- Add Lucide and Octicons icon collections to presetIcons config
- Replace arrow-up/down and enter-key SVGs with Lucide icons
- Replace alert icons (info, light-bulb, report, alert, stop) with Octicons
- Delete replaced SVG files from assets/images/icons/
- Keep custom SVGs (csdn, plume, rootme)

* refactor(layouts): redesign 404 and offline pages with UnoCSS

- Replace translate-y-[30vh] with self-stretch flex centering below header
- Remove arbitrary values (text-[3.6rem], text-[1.8rem], etc.)
- Restore @page print styles in _common.scss
- Simplify offline page layout (icon + title + text)
- Fix hardcoded #57606a → text-secondary
2026-06-27 06:27:12 +08:00
Cell 09e08d0772 refactor!: migrate theme assets from css to scss and centralize deprecation detection (#735)
**Breaking changes**:

1. Legacy custom style/script files are no longer loaded automatically.
2. Users must migrate custom files to:
   - `custom.scss`
   - `override.scss`
   - `_variables.scss`
   - `assets/js/custom.js`

**Migration guide**:

1. Move `assets/css/_custom.scss` to `assets/scss/custom.scss`.
2. Move `assets/css/_override.scss` to `assets/scss/override.scss`.
3. Keep variables in `assets/scss/_variables.scss`.
4. Move `assets/js/_custom.js` to `assets/js/custom.js`.
5. Rebuild site and verify no deprecation warnings remain.
2026-04-19 13:34:01 +08:00
Cell b406a569f8 refactor(css): rename functions from 'fixit-' to 'fi-' for consistency 2026-04-19 05:07:15 +08:00
Cell 9ada69ed71 feat(task-lists): add support for "Important Checked" task (#734) 2026-04-19 05:00:09 +08:00
Cell 3dd16e691f refactor(styles): replace mixin user-select with direct property assignment 2026-04-13 15:00:30 +08:00
Cell 5f100a6cca feat(link): add link_guard front matter and support for friend links 2026-04-12 13:29:05 +08:00
0x5c0f 75ee1624bd feat(link): add external link guard feature support (#729)
* feat(external-link-guard): add native redirect mode and improve external-link guard UX

* fix(external-link-guard): remove redirect_url and clarify scope/new_tab_policy docs

* i18n(external-link-guard): localize guard texts across non-English locales

* feat(config)!: migrate `site.Params.externalIcon` to `site.Params.link.external_icon`

* refactor: implement regular and card link rendering

* feat(link-guard): implement link redirection page with copy and confirm functionality

* revert

* feat: implement link guard dialog for external links

---------

Co-authored-by: Cell <1024@lruihao.cn>
2026-04-11 14:37:31 +08:00
Cell e527289140 feat(buttons): replace role="button" with button elements for improved accessibility 2026-04-07 14:06:06 +08:00
Cell 66dc7bc5af fix(toc): update max-height calculation for TOC content to use variable 2026-04-07 11:32:12 +08:00
Cell 29ece68332 feat(accessibility): enhance accessibility features across components and improve focus management (#725) 2026-04-03 18:00:17 +08:00
Cell b172fd416d refactor: replace media queries with mixin for responsive design consistency 2026-04-02 21:53:47 +08:00
Cell 741ef191bf feat(task-list): add task list utility mixins and enhance rendering logic 2026-03-30 16:48:55 +08:00
Cell 164a699701 refactor(UI/UX)!: refactor styles for theme support and enhance visual consistency (#722)
* refactor(styles): unify theme properties and update color variables across stylesheets

* Implement theme mode support with light-dark color adjustments across stylesheets

- Added color-scheme support in _root.scss for light and dark modes.
- Replaced theme property mixins with light-dark function in various widget styles including _cell-tooltip.scss, _cookieconsent.scss, _fixed-button.scss, and others.
- Updated alert styles in _alert.scss to use light-dark for border and text colors.
- Refactored code syntax highlighting in _code.scss and _code-syntax/_index.scss to utilize light-dark for background gradients.
- Enhanced search input styles in _search.scss to adapt to theme mode.
- Modified theme switching logic in color-scheme.js and theme.js to support new theme mode structure.
- Adjusted APlayer and Valine styles to accommodate dark mode using new theme variables.

* feat(shortcode): add auto-dark shortcode for dark mode adaptation

* refactor(styles): update theme colors and improve box-shadow properties for better visual consistency

* feat(header): add scroll-state container queries and enhance header shadow effects

* feat(styles): enhance scroll behavior with overscroll-behavior adjustments for better UX

* feat(styles): update code&table styles and colors for improved visual consistency

* feat(styles): update color variables and improve font styling for better visual hierarchy
2026-03-30 16:48:55 +08:00
Cell 11954d833f feat(header): refactored the blur effect to backdrop-filter and added a configuration switch (#721)
- Removed the old blur mixin based on filter: blur, and replaced it with backdrop-filter for a more modern frosted glass effect

- Added the `params.header.blur` configuration option, allowing users to enable/disable the header blur effect

- Refactored the masking interaction of the mobile menu and search, applying the blur class to the masking element instead of the body

- Updated the header animation class name to distinguish it from custom animations and avoid conflicts with Animate.css

- Adjusted responsive breakpoints, changing `xs` to `sm` to improve mobile display

- Optimized the header background color and the background color of the fixed buttons
2026-03-30 16:48:55 +08:00
Cell cfa9bef6ac refactor(layout): refactor single page layout and partials categorization 2026-03-30 16:48:55 +08:00
Cell d9e45154ff fix(code): repeated initialization of the code tab in the encryption page 2026-03-21 00:03:07 +08:00
Cell b09555981b feat(code): add toggle code block functionality and enhance code tabs (#719)
* feat(markup): add toggle code block functionality with multiple format support

* fix(assets): improve filename generation for code downloads

* feat(code): add `before_tabs` attribute support for tabbed code blocks

* feat(code): implement visibility control for first tab content in code blocks
2026-03-20 17:26:28 +08:00
Cell 96b4b4512c fix(assets): code header sticky error in mobile device (#716) 2026-03-20 11:10:43 +08:00
Cell de38644d75 fix(assets): tab underline error position 2026-03-19 15:19:41 +08:00
Cell ccf17c6444 fix(assets): enhance tablist-wrapper styles 2026-03-19 12:47:17 +08:00
Cell 9bac69b2ec fix: update print handling and improve file tree interactions 2026-03-19 11:42:15 +08:00
Cell d51dfd35e8 refactor(responsive): enhance responsive styles and add media mixin support (#715)
* feat(responsive): add responsive breakpoints and mixin for media queries

* refactor: print styles and add media query support

* refactor(responsive): enhance responsive styles across various components
2026-03-18 11:22:51 +08:00
Cell 8534cddc7c chore(i): some some general updates 2026-03-13 11:18:21 +08:00
Cell 02ac3f5259 feat(code): add shadow effect for code blocks (#713) 2026-03-12 17:28:15 +08:00
Cell c8d028aa0e feat(tabs): enhance tab styles and improve active code tab handling (#712)
* feat(tabs): enhance tab styles with sliding indicators and hover effects

* feat(tabs): improve active code tab handling and initialization logic
2026-03-12 11:41:52 +08:00
Cell f2c112e402 feat(code): add tabbed codeblocks support (#710) 2026-03-10 17:33:28 +08:00
Cell 8bf2fea735 fix(typeit): restore cursor color variable definition for proper styling 2026-03-08 18:07:16 +08:00
Cell fda650ad58 feat(MathJax): add dark mode adaptation for MathJax rendering 2026-03-08 02:17:14 +08:00
Cell d97e69ad0a feat(tooltip): add cell-tooltip integration for footnote references a… (#709)
* feat(tooltip): add cell-tooltip integration for footnote references and initialize tooltips

* fix(code-header): add data-ct-tooltip attribute to action buttons for better accessibility
2026-03-06 19:25:35 +08:00
Cell 423a7ddbf7 fix(CSS): restore the definition of the $global-font-secondary-color variable; third-party components may reference it 2026-03-04 16:02:10 +08:00
Cell 69d8e67c24 feat(code): add fullscreen functionality for code blocks (#707) 2026-03-03 16:15:01 +08:00
Cell 6196cd5edf feat(code): add download button for code blocks and related functionality (#706) 2026-03-02 17:34:57 +08:00
Cell 83a658ba25 fix(i): adjust background color and border color for fixed button 2026-03-02 14:56:09 +08:00
Cell c3ac728f04 feat(task-lists): update checked task item styles 2026-03-02 11:32:58 +08:00
Cell 93d0b52cd7 feat(UI): adjust border and separator colors to improve visual hierarchy 2026-02-28 20:11:20 +08:00
Cell 2199c7f125 fix(task-lists): regular expression matching for task list items containing extra spaces 2026-02-28 18:00:01 +08:00
Cell 3926cc0220 refactor: reorganize CSS structure and standardize CSS variable usage for improved maintainability (#690)
* refactor: CSS variables to use fixit-var for consistency across styles

* refactor: reorganize CSS structure and consolidate imports for improved maintainability

* refactor: unify CSS variable usage and improve structure across stylesheets

* refactor: standardize CSS variable usage for layout

* refactor: standardize CSS variable usage for archive and special pages

* refactor: standardize CSS variable usage for single page

* refactor: standardize CSS variable usage for widgets

* refactor(css): refactors the border-radius mixin and adds the .rounded-full utility class

* refactor: standardize z-index usage across components

* refactor(css): removes deprecated compatibility mixins and replaces them with native CSS properties

* feat: unify color variable naming and update theme color values

- Rename `global-font-secondary-color` to `global-placeholder-color` for more accurate description of its purpose
- Update multiple style references to use the new `secondary` theme color variable
- Update theme color mapping to the new color values ​​for improved visual consistency
- Fixed the use of search box placeholder colors and removed hard-coded transparency values
- Added color preview test documentation for easier verification of color rendering
- Cleaned up some duplicate dark mode styles and replaced them with unified CSS variables

* refactor: remove the `hr-background-color` variable and uses `global-border-color` uniformly

* feat(CSE): add dark theme style to Google CSE search box and results container

* fix(task-lists): fixed styling and rendering issues with nested task lists
2026-02-28 17:24:10 +08:00
Cell 9e946c6316 fix(i): missing widget styles 2026-01-30 12:23:48 +08:00
Cell e23a50d755 refactor(assets): refactors the SCSS file structure and adds styles for new components. 2026-01-23 16:07:55 +08:00
Cell 5036111d11 fix(toc): update height to use 100dvh for better responsiveness (#688)
* fix(toc): update height to use 100dvh for better responsiveness

* fix(toc): adjust backdrop color and add blur effect for improved visibility
2026-01-17 14:27:58 +08:00
Cell 8367c13ebd fix(i): make change for FontAwesome v7
https://docs.fontawesome.com/upgrade/whats-changed/
2026-01-17 00:39:12 +08:00
Cell b4008081d7 feat(file-tree): enhance shortcode with name param and deprecated fullRootName param
// ignore-for-release
2026-01-14 18:18:26 +08:00
Cell fdfd772100 feat(File Tree): add file-tree shortcode support (#685)
* feat(File Tree): add `file-tree` shortcode support

* feat(file-tree): add ignoreList parameter to file-tree shortcode

* feat(file-tree): enhance file-tree shortcode with ignoreList and folderSlash options

* feat(file-tree): enhance file-tree shortcode to support data mode

* feat(file-tree): enhance file-tree shortcode to support file mode

* feat(file-tree): improve content parsing in file-tree shortcode

* feat(file-tree): improve root path validation and error handling in filesystem mode

* test(file-tree): add unit tests for `file-tree` shortcode

* feat(file-tree): add file-tree code block rendering support

* refactor(file-tree): extract filesystem scanning to get-file-tree partial

Move directory traversal and root path validation to a separate partial function,
consolidating all filesystem-related logic in one place. This simplifies the
shortcode implementation and ensures a unified data format for rendering.

* docs(readme): extend code fence and shortcode support for file tree in documentation

* feat(file-tree): add fullRootName parameter for root path display in file tree

* feat(file-tree): add language parameter to get-file-tree function

* feat(file-tree): add highlightList parameter for file-tree shortcode

* perf(file-tree): add level param for get-file-tree function to descend only level directories deep
2026-01-14 16:01:22 +08:00
Cell 0c1d074890 chore(deps): bump fontawesome version to 7.1.0 2026-01-09 22:15:15 +08:00
Cell b29368c3e6 fix(admonition): adjust styles for title-only and content-only admonitions
// ignore-for-release
2026-01-09 14:32:28 +08:00
Cell 8b5315a141 chore: add .stash to ignore list
// ignore-for-release
2026-01-08 17:31:45 +08:00
Cell c257b9b10f feat(admonition): add support for content-only alerts without titles (#683)
* feat(admonition): add support for content-only alerts without titles

* fix(admonition): improve title-only alert handling and styling
2026-01-08 16:13:09 +08:00