nginx-autoindex-js
nginx-autoindex-js copied to clipboard
Prefix of filepath not appended in row item
Hi,
I'm trying your indexer and it works great, there is only a quirck when:
- Index html location: http://{host}/i
- JSON autoindex + files location: http://{host}/p
The folders are correctly loaded and navigate fine only the url href is not correctly written:
- Current: /dir1/{file}
- Should be prefixed with
/p/: `/p/dir1/{file}
I hardcoded the prefix now myself when row.type != "directory" here:
https://github.com/kstep/nginx-autoindex-js/blob/master/index.html#L58
{{:: row.type == 'directory' ? '#' : '/p/' }}
I think the prefix could be loaded from the config.json file even when full host is set.
... or in a better way :
https://github.com/kstep/nginx-autoindex-js/blob/master/index.html#L58
{{:: row.type == 'directory' ? '#' : index.config.base_index_url }}