183 Commits

Author SHA1 Message Date
Cell 47b7c969f1 feat(layouts): add post disclaimer/declaration feature (#832)
Add a lightweight disclaimer notice at the beginning of articles to
indicate content origin (AI-generated, repost, original, custom).

- Add params.disclaimer config with enable, type, content options
- Support 4 types: ai, repost, original, custom
- Add custom SVG icons for ai/repost/original types
- Add i18n translations for 20 languages
- Add shimmer animation effect with RTL and reduce-motion support
2026-08-24 17:51:58 +08:00
Cell 5f1e79f49c feat(i18n): add RTL support for Arabic, Persian and Urdu (#831)
* feat(i18n): add RTL support and Arabic/Persian translations

- Add `dir` attribute to `<html>` via `.Site.Language.Direction`
- Convert physical CSS properties to logical properties across ~30 SCSS files
- Add `[dir="rtl"]` overrides for elements that need physical direction (code blocks, translate, icons)
- Add `logical-direction.html` template function for config value normalization
- Add RTL-aware deprecation warnings for old "left"/"right" config values
- Rename github corner, TOC position, reading progress config values from "left"/"right" to "start"/"end"
- Add Arabic (ar.toml) and Persian (fa.toml) i18n translation files
- Update multilingual documentation with RTL language configuration guide

* feat(shortcodes): add RTL support for tabs and refactor border-radius mixin

- Rename tabs placement values from "left"/"right" to "start"/"end" with deprecation warnings
- Convert all physical directional properties in tabs SCSS to logical properties
- Add RTL overrides for translate and box-shadow in tabs
- Add "start"/"end" support to border-radius mixin using CSS logical properties
- Refactor fixit-decryptor to use border-radius(start/end) mixin

* feat(assets): add RTL support for toc-dialog slide animation

The mobile toc-dialog always slid in from the right (100vw). In RTL
mode it should slide from the left (-100vw), matching the
border-inline-start/margin-inline-end anchoring.

* feat(assets): add RTL support for post-tag comma separator

* refactor(assets): extract RTL styles into dedicated _rtl.scss

* feat(assets): add RTL support for theme-switch and directional icons

* feat(i18n): add RTL support and improve i18n

- Add RTL typography corrections for Arabic-script languages (:lang(ar/fa/ur))
- Remove fa-list-ol from RTL flip list (numbers get mirrored)
- Add Urdu translation file (i18n/ur.toml)
- Rename noMoretTranslations to noTranslations and simplify all translations
- Update json-viewer-element from 1.0.4 to 1.0.6
- Add RTL test posts (index.en.md, index.ar.md)
- Fix layout partials for RTL support

See https://fixit.lruihao.cn/docs/content-management/introduction/#rtl-language-support
2026-08-24 00:22:34 +08:00
Cell 8b6806bbf3 fix(layouts): hide end_flag when post content is encrypted 2026-08-19 12:41:05 +08:00
Cell e0940bd4d3 fix(layouts): resolve accessibility and SEO issues from AI crawler support (#830) 2026-08-17 12:47:50 +08:00
Cell bfee4041d6 refactor(encrypt): rename post-encrypt to encrypt
- Rename package from @hugo-fixit/post-encrypt to @hugo-fixit/encrypt
- Rename bin from post-encrypt to fixit-encrypt
- Update all i18n translations (16 files) to use npx @hugo-fixit/encrypt
- Update CI workflow, publish script, code comments, and docs
- Rewrite README with performance benchmarks and other implementations
2026-07-19 13:15:57 +08:00
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 658f03d1e5 refactor(params)!: flatten [params.page] to [params], snake_case keys, more page-level params support (#805)
* refactor(params)!: snake_case config + eliminate params.page + use .Param

BREAKING CHANGE: All params keys renamed from camelCase to snake_case,
[params.page] section eliminated (moved to [params] level), and users
must update their hugo.toml and front matter accordingly.

Key changes:
- All camelCase config keys → snake_case (e.g., defaultTheme → default_theme)
- [params.page] flat keys and sub-sections moved to [params] level
- Removed function/params.html (manual merge), replaced with Hugo .Param
- New function/param.html partial for page-level section params with
  shorthand boolean support and site defaults merging
- New function/camel-case.html for string conversion
- snake2camel.html renamed to camel-case-keys.html
- New function/get-cover.html for cover image resolution
- Deprecation warnings in detection-deprecated.html for old config keys
- Front matter only params (subtitle, featured_image, password, repost,
  weight, message) use .Params.xxx instead of .Param
- Page-level sections use param.html partial
- Simplified patch.html (siteTime only) and init/index.html

Refs: camel-case-keys.html#29 (planned v1.0 breaking change)

* refactor(params)!: move params.link to page-level, simplify link guard

- Move [params.link] and [params.link.guard] to page-level section
- link.html: .Page optional, use param.html when available for
  page-level override, fall back to site config without .Page
- Remove $guardConfig variable, use $config.guard directly
- Remove unnecessary .Page from callers that don't need page override
- friends.html: use param.html for link guard instead of link_guard

* refactor(params)!: move image/codeblock/json_viewer/filetree to page-level

- Move [params.image], [params.codeblock], [params.json_viewer],
  [params.filetree] to page-level sub-sections
- Templates use param.html for merged config (page override + site defaults)
- image.html: .Page optional, falls back to site config without .Page
- Add v1- prefix to all deprecation warnidf IDs
- Fix camelCase key access in image.html (blackList, cacheRemote)
- Fix Hugo-lowered camelCase keys in code-block-wrapper.html
- Add deprecation warnings for codeblock camelCase Markdown attributes
- Add deprecation warnings for file-tree camelCase Markdown attributes
- Update render-codeblock-toggle.html for snake_case attribute names

* style: standardize @param comment style across all HTML templates

- PascalCase types: {string} → {String}, {boolean} → {Boolean},
  {int} → {Int}, {map} → {Map}, {array} → {Array}
- Add missing ` - ` separator between param name and description
- Remove extra alignment spaces between type and param name

* refactor(params)!: move params.mermaid to page-level, extract gen/ templates

- Move [params.mermaid] to page-level sub-sections
- Mermaid config injected into window.config (per-page override support)
- mermaid.ts reads config from window.config.mermaid instead of parameter
- Create _partials/gen/ directory for JS content generators
- Move mermaid-bootstrap.html from plugin/ to gen/
- Extract window.config JS generation into gen/config.html
- mermaid.html uses param.html for wrapper config

* refactor(params)!: consolidate link_to_* into params.post_link section

- Move link_to_markdown/source/edit/report/vscode into [params.post_link]
- Rename keys: markdown, source, edit, report (bool), editor (string)
- editor defaults to "vscode", supports "trae" etc. via protocol template
- footer.html uses .Param "post_link" for all link toggles
- Remove link_to_* from deprecated keys list

* fix: add fallback for deprecated camelCase attributes and expand deprecation warnings

- render-codeblock-file-tree.html: folderSlash attribute fallback
- render-codeblock-toggle.html: lineNosToggler/lineWrapToggler fallback + warnings
- code-block-wrapper.html: maxShownLines/wrapperClass fallback
- detection-deprecated.html: add nested key warnings for 13 sections
  (header, breadcrumb, navigation, watermark, busuanzi, image, mermaid,
  codeblock, filetree, math.katex, math.mathjax.options, post_summary, footer)
- detection-deprecated.html: add link_guard front matter deprecation warning

* fix(mermaid): fix rendering in hidden tab panels and neutral layer scheduling

- isRenderContextActive: check tab-panel visibility via getBoundingClientRect
  instead of panel.hidden (tab-container uses slot-based hiding, not hidden attr)
- bindTabContainerChanged: render neutral layers when switching tabs so
  print/fallback scenarios work correctly
2026-07-01 22:27:08 +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 a696f3b1bd refactor(search): refactor search module and upgrade autocomplete library (#787) 2026-06-17 01:45:50 +08:00
Cell f76b6a1f1c feat: migrate layouts/_partials/layouts to layouts/_partials/base 2026-05-20 10:16:46 +08:00
0x5c0f 4ffd531d63 feat(search): add pagefind search engine support (#738)
* feat(search): add native pagefind support

* chore: code review and change

---------

Co-authored-by: Cell <1024@lruihao.cn>
2026-05-19 16:19:39 +08:00
Cell a4fcc5ed59 feat(toc): add close button to TOC dialog and improve close functionality 2026-05-17 15:03:18 +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
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 29ece68332 feat(accessibility): enhance accessibility features across components and improve focus management (#725) 2026-04-03 18:00:17 +08:00
Cell cfa9bef6ac refactor(layout): refactor single page layout and partials categorization 2026-03-30 16:48:55 +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 a79213969f feat: add option to show last modified time in post layout (#678) 2026-01-04 12:45:49 +08:00
Cell 2c2b25d8fc refactor: move the expiration reminder outside the content (#677) 2026-01-04 11:38:36 +08:00
Cell fcbd8938c2 feat(post-chat-ai): add podcast support and enhance post summary configuration 2026-01-03 16:59:22 +08:00
Cell 8ffb9a9563 fix: update TOC handling logic to use showToc flag 2025-12-25 17:16:07 +08:00
Cell 0978234bf6 fix: update image processing configurations for improved performance and quality 2025-12-23 14:45:17 +08:00
Cell 3f14576073 feat: add blacklist option for image optimisation and adapt Hugo 0.153.0+ (#666)
* feat: add blacklist option for image optimisation and enhance shortcode parameters

To ensure compatibility with Hugo 0.153.0, converting GIFs to WebP is prohibited. (gohugoio/hugo#14282)

* feat: enhance image plugin with Matches parameter for better resource handling and improve featured image rendering
2025-12-21 23:42:15 +08:00
Cell 6d00e42b03 feat(i): update TOC dialog logic to use 'hasToc' instead of 'enableTocDialog' 2025-11-28 14:38:26 +08:00
Cell aad75044e9 feat: implement TOC drawer feature (#657)
* feat: add toc drawer button

* feat: add TOC dialog functionality and related styles

* feat: change back-to-top button with scroll progress indicator

* feat: update color-scheme handling in theme switcher

* fix: code review for checking mistakes and optimization

* fix: the issue where the TOC was still clickable even when it was hidden.
2025-11-18 12:35:34 +08:00
Cell 3e8bdfd8f9 ♻️ Refactor: global/site/page scope state management (#610)
*  Perf: adjust global/site scope state management

*  Perf: adjust page scope state management
2025-07-03 12:48:32 +08:00
Cell d41e53bba4 Feat: add related content list in aside (#591) 2025-04-25 17:15:58 +08:00
Cell 8212d6fd02 ♻️ Refactor: image rendering aaa~again (#575) 2025-03-07 12:18:40 +08:00
Cell 30a67c4b52 Feat: open more custom blocks for posts page 2024-12-27 15:38:12 +08:00
Cell aa1709fbdd Feat: always show collection list and navigation 2024-11-15 14:24:08 +08:00
Cell 95436c11ac Feat: add HTML&MD render for single subtitle 2024-10-04 01:40:54 +08:00
Cell 58cfa55e65 🐛 Fix: toc data patch 2024-10-02 13:04:00 +08:00
Cell 9c440df3d0 Feat: add param.capitalizeTitles, default is true 2024-10-02 01:54:19 +08:00
Cell 9e9bc9effd Feat(ignore): add data-adapters attribute
It is helpful to identify whether the content originated from a content adapters.
2024-10-01 18:10:48 +08:00
Cell b44555d403 🐛 Fix: don's show emtpy toc 2024-10-01 16:12:26 +08:00
Cell 456db3851b 🚚 Feat: supersede markup.tableOfContents settings with params.page.toc 2024-09-27 17:10:17 +08:00
Cell b7ed9cac69 ♻️ Refactor: refactor content encryption 2024-08-29 10:24:16 +08:00
Cell e7dd4c838c Chore: unified content encryption function 2024-08-26 11:22:45 +08:00
Cell 91f3c7c3cf 🐛 Fix: fix fixit-encryptor shortcode duplicate binding events 2024-08-26 10:58:34 +08:00
Cell 466bb7b7e9 🔒 Perf: use xxHash instead of md5 to calculate the hash value of a password
Update min hugo version to 0.129.0 for using xxHash function
2024-08-25 13:48:28 +08:00
Cell 3ffef8acb0 ♻️ Refactor: refactor the feed and search features (#490)
* 🔍 Refactor: add JSON feed support and refactor output formats build in FixIt

Close #475

* 🚚 Feat: migrate index templates to layouts/_default folder and home.[name].html

* 📝 Style(ignore): fix typo

* 🚚 Chore: migrate index templates to default home templates

* 🚚 Chore: migrate section templates to layouts/section folder

*  Feat: add JSON feed support for section pages (#475)

* 🚧 Feat: add common template for JSON feed (#475)

* 🚧 Feat: add JSON feed support for section and term list pages

* 🚀 Chore: fix git stage error in update-version script

*  Perf: add front matter hiddenFromFeed for JSON feed (#475)

* 🔍 Feat: add tags attribute for JSON feed (#475)

* ♻️ Refactor: refactor RSS feed templates

Close #488

* 🚧 WIP: rename json-feed.html to json.html

* 🚧 Feat: revert single.md

*  Perf: enhance JSON feed 1.1 compatibility

* ♻️ Refactor: refactor post author map getting

*  WIP: add featured image support in feed

* 📝 Docs: update README and screenshot

* 🔧 Chore: update changelog template

* 🚧 WIP: add feed scoped config for section and list

* 🔥 Feat: migrate JSON feed to hugo-fixit/hugo-json-feed

Close hugo-fixit/hugo-json-feed#1

* 🚚 Feat: remove front matter hiddenFromRss and rssFullText,  add  front matter hiddenFromFeed
2024-08-24 17:30:31 +08:00
Cell c0942a92b9 Feat: open more custom blocks (#479)
- custom-comment
- custom-post__footer:before
- custom-post__footer:after
2024-08-03 12:20:29 +08:00
Cell 72a77c2fc5 Perf(ignore): disable busuanzi in dev environment 2024-07-28 23:09:16 +08:00
Cell 7c67b90acf ♻️ Refactor: deprecate params.ibruce in favor of params.busuanzi powered by Vercount
Resolve #472
Close EvanNotFound/vercount#10
2024-07-28 13:34:53 +08:00
Cell affaea7ecb 🐛 Fix: password runecount calc error 2024-07-22 15:40:29 +08:00
Cell a985b0e789 🔥 Feat: remove params.customFilePath 2024-05-22 11:45:14 +08:00
Cell eb0acca980 Feat: add unified custom template entry file layouts/partials/custom.html 2024-05-09 15:44:57 +08:00
Cell 020a8fdbcc Feat: add titleIcon font matter (#421) 2024-05-06 16:32:33 +08:00
Cell ba4b506b2f Feat: use strings.Title for post title and other titles (#421)
Closes #421
2024-05-06 16:00:29 +08:00
Cell 2ea592b4a3 🐛 Fix: use function to get params replace of .Scatch (#420) 2024-02-23 20:50:52 +08:00