19 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 5322a15ceb docs(layouts): add header comments to undocumented partials
Add `{{/* ... */}}` header comments to 25 partials that had no documentation,
enabling `pnpm gen:docs` to generate their reference docs. Also fix
base/head/index.html leading blank line that prevented parser matching.

Groups covered: base/, feed/, function/, home/, init/, plugin/, single/, store/, (root).
2026-07-23 12:56:40 +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 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
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 cfa9bef6ac refactor(layout): refactor single page layout and partials categorization 2026-03-30 16:48:55 +08:00
Cell fe7105a38a fix: optimize TOC initialization with a timeout and clean up button spacing in decryptor 2026-03-08 17:57:41 +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 2c2b25d8fc refactor: move the expiration reminder outside the content (#677) 2026-01-04 11:38:36 +08:00
Cell 0978234bf6 fix: update image processing configurations for improved performance and quality 2025-12-23 14:45:17 +08:00
Cell e04bb611dc Feat: enhance Mermaid configuration and fix initialization bug (#617)
* 🐛 Fix: Mermaid initialization conflict error

*  Feat: enhance Mermaid configuration with security level, look, and font family options
2025-08-14 15:29:23 +08:00
Cell ba6cc4ed8e 🚚 Feat(i): rename load-mathjax.js to mathjax.js 2025-08-14 09:53:09 +08:00
Cell 59bea1e518 ♻️ Refactor: update CSS variable prefixes to use rootPrefix for consistency 2025-08-13 12:58:59 +08:00
Cell fe351c7e38 Feat: add shortTitle front matter param for breadcrumb and collection navigation titles to use 2025-08-05 12:14:23 +08:00
Cell 9293ee27f3 💥 BREAKING CHANGE: rename directory layouts/_partials/scratch to layouts/_partials/store 2025-07-03 17:31:22 +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 0ce74d82f8 ♻️ Refactor: mathematical formula render (#609)
*  Feat: add support for math passthrough render hook

*  Feat: enable copy-tex extension for KaTeX server-side render

*  Feat: enhance mathematical rendering support with KaTeX and MathJax configurations

*  Feat: add KaTeX error handling and custom macros map config

*  Feat: add MathJax client-side rendering as an alternative math engine

*  Feat: update MathJax CDN configuration and enhance asset loading parameters

* 🔥 Feat: remove unused KaTeX math rendering scripts and update KaTex

*  Feat: make \KaTeX command work in MathJax

*  Feat: update KaTeX CDN links for Twikoo integration

*  Perf: Math in content encryption

* 🐛 Fix: update class name from 'fi-row' to 'fi-raw' in raw.html shortcode

* 🐛 Fix: correct MathJax math delimiters in load-mathjax.js

*  Feat: enhance MathJax configuration with additional tex parameters and update asset handling

* 🐛 Fix: adjust KaTeX display overflow behavior
2025-06-30 12:58:48 +08:00
Cell a5614505bc ♻️ Refactor: add underscore to partials and shortcodes directory names (#608) 2025-06-19 12:29:30 +08:00