# 官方文档
## Nginx-Fancyindex-Theme
Theme "design material" for nginx-fancyindex module
![web](images/webview.png "Example of Nginx-Fancyindex-Theme view web")
![mobile](images/mobileview.png "Example of Nginx-Fancyindex-Theme view web")
use icon from https://feathericons.com/
## Installation
The fancyindex module can be found [here](https://github.com/aperezdc/ngx-fancyindex) (by @aperezdc).
On debian
apt-get install git nginx-extras
sample of configuration of nginx
```bash
server {
listen 80 default_server;
client_max_body_size 1G;
location / {
root /
;
fancyindex on;
fancyindex_localtime on;
fancyindex_name_length 255; # Maximum file name length in bytes, change as you like.
# theme
fancyindex_header "/fancyindex/header.html";
fancyindex_footer "/fancyindex/footer.html";
fancyindex_ignore "fancyindex";
auth_basic "Access restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
}
}
```
you can clone project an copy file in your root path nginx
git clone https://github.com/fraoustin/Nginx-Fancyindex-Theme.git
mkdir //fancyindex
cd Nginx-Fancyindex-Theme
cp -R * //fancyindex
you can change color of interface
cd //fancyindex/mdl
rm material.min.css
cp color/.min.css material.min.css
## TODO
optimize code
## THANK YOU
- [ViRb3](https://github.com/ViRb3)
- [amagri](https://github.com/amagri)
# 本人声明
[该主题的原出处](https://github.com/fraoustin/Nginx-Fancyindex-Theme)
本人[刘天洋d-CSDN博客](https://blog.csdn.net/thetender?spm=1000.2115.3001.5343)
该包为本人粗略汉化,由于本人技术能力有限,汉化可能不完整,因此需要配合nginx中的`sub_filter`使用
```bash
server {
listen 80;
server_name localhost;
charset utf-8; # 开启中文支持
sub_filter 'date_range' 'date_range'; # 好像是编码原因导致与下面Date冲突,所以采取这种方法解决
sub_filter 'Parent directory' '返回上级';
sub_filter 'File Name' '文件名称';
sub_filter 'File Size' '文件大小';
sub_filter 'Date' '创建日期';
sub_filter 'Jan' '1';
sub_filter 'Feb' '2';
sub_filter 'Mar' '3';
sub_filter 'Apr' '4';
sub_filter 'May' '5';
sub_filter 'Jun' '6';
sub_filter 'Jul' '7';
sub_filter 'Aug' '8';
sub_filter 'Sep' '9';
sub_filter 'Oct' '10';
sub_filter 'Nov' '11';
sub_filter 'Dec' '12';
sub_filter_once off;
}
```