851 B
851 B
项目长期记忆:Nginx-Fancyindex-Theme
部署约定
- 主题资源放在 nginx
root下的theme/:/theme/header.html、/theme/footer.html、/theme/css/styles.css。 - 依赖第三方
ngx-fancyindex模块;未编译则fancyindex指令报错。 fancyindex_ignore "theme"仅隐藏列表显示,不阻止对/theme/...的直接访问。
已知坑
- 搜索结果显示需手动构建表格行:不可依赖抓取到的
tr.outerHTML直接插入新表格,否则会出现列缺失、链接错误、只显示文件名等问题。应提取{ name, full, isDir, size, date }结构化数据后重新渲染 4 列表格(Name / Size / Last modified / 空)。 header.html中 CSS 链接、目录路径清理、搜索递归均用前端 JS 实现,修改后刷新页面即可生效,无需 reload nginx。