1.7 KiB
1.7 KiB
2026-07-18 工作日志
1. 诊断:部分 .zip 文件不显示
- 现象:
Nginx-Fancyindex-Theme.zip不显示,ServerStack.zip正常显示。 - 根因:
fancyindex.conf第 8 行fancyindex_ignore "theme";本意是隐藏/theme/资源目录, 但fancyindex_ignore在 PCRE 下是不区分大小写 + 未锚定的子串正则(ngx_http_fancyindex_module.c用NGX_REGEX_CASELESS编译,且按裸文件名匹配、无^$锚点),因此也命中了文件名含Theme的 zip。 - 建议修复(尚未改动配置):改为
fancyindex_ignore "^theme$";精确匹配目录名,避免误伤含 theme 的文件。
2. 修改:列标题改为 File Name / File Size / Date
- nginx 的
ngx-fancyindex模块自行生成table#list的<thead>,主题无法用静态 HTML 改表头文字; 且styles.css的thead th { text-transform: uppercase }会把标题强制大写。 - 方案:在
theme/header.html的 IIFE 中新增renameHeaders(),于onReady()调用, 用 JS 改写table#list与table.results的<th>文本为['File Name','File Size','Date',''],并通过内联th.style.textTransform='none'覆盖大写(内联优先级高于外部 CDN 样式,无需改 CSS 文件)。 - 同步更新
theme-preview.html的静态 thead 与脚本,保持预览一致。 - 注:
header.html:1仍引用外部https://repo.52or.com/fancyindex/styles.css?v=3,本地theme/css/styles.css不一定线上生效;JS 内联方案不受此影响。 - 回退:用户要求"回退到上一个版本",已将
theme/header.html与theme-preview.html中本次的列标题改动全部撤销,恢复为Name / Size / Last modified。主题文件当前回到改动前状态。