Add the fancyindex_case_sensitive option which considers the case when
sorting by name if it is on (which it is by default to keep current
behavior) and does a case-insensitive name sort if it is off.
Closes#78Closes#124
Co-authored-by: Ryan Schmidt <git@ryandesign.com>
This is a backwards compatibility break, in that the `fancyindex_name_length` setting will now
prevent nginx from starting until removed. I do think though that most people will find the new
behavior preferable to that setting however.
There's two arguably unrelated CSS changes included in this pull request, so let me know if you
like one but not the other or vice versa I can split them up.
-----
We've introduced `table-layout: fixed;`. This is a performance optimization for browsers rendering
very large file lists.
The default mode (`table-layout: auto`) first needs to load the entire table, then calculates the
optimal column widths based on the contents of all cells in the table start to finish. This can be
a bit slow when directory listings contain tens of thousands of files or folders.
With `table-layout: fixed;` the width is determined based on the first row allowing the browser to
render to begin rendering the table immediately.
Technically, the widths of columns have changed slightly as a result of this, but we no longer need
to specify widths using style attributes, which makes it easier for custom CSS users to change the
widths.
.link was 55% wide, now 50%
.size was 20% wide, now 25%
.date was 25% wide, now 25%
-----
Rather than truncating string names server-side, we instead send the full name and tell the browser
to truncate file names with CSS. This has the advantage of always showing as much of the file name
as it can fit in a line. This has the benefit of avoiding line wraps on smaller screens (like
phones) and allowing people to resize their window larger to see more of the file name.
This reduces the code complexity server side and provides a optimal truncation on every device.
Make the configuration process load the local files specified with
'fancyindex_{header,footer} "foo" local', instead of loading them
on every request.
Additionally, change the syntax of the configuration directive to accept
an optional parameter indicating whether the header (or footer) is to be
loaded as a subrequest (default, for backwards compatibility) or a local
file (must be specified explicitly). This avoids the footgun of having
a local file which accidentally happens to match the subrequest that one
had the intention to do when configuring.
* fix nginx URL (.org not .net and HTTPS)
* fix protocol for die.net URL
* fix underline too short for fancyindex_show_path
* fix "module module" sentence
The fancyindex_directories_first directive allows one to enable or
disable grouping directories first before all files when sorting.
This is accomplished by changing the sort function from ngx_qsort (which
is the plain stdlib qsort under the hood) to ngx_sort which is a stable
insertion sort (per ngx_string.c).
We call ngx_sort with the standard sort_cmp_func (albeit modified to remove
grouping dirs), and then, if fancyindex_directories_first is set, call
ngx_sort again with ngx_http_fancyindex_cmp_entries_dirs_first which sorts
entries according to the directories first criterion.
Because a stable sorting function is used, the relative primary order is
preserved when we call ngx_sort again.
Change int (*sort_cmp_func) (const void*, const void*) to ngx_int_t
(*sort_cmp_func) (const void*, const void*) to satisfy ngx_sort.
Travis-CI better signifies the build status, as it tries building with
combinations of compilers, nginx versions, and dynamic vs. statically
linked modules.
This directive enables someone using a custom header to disable the output of the indexed directory by the module
Useful when you want to create links to previous directories via PHP for example
This patch adds a new configuration directive fancyindex_time_format, which
accepts a strftime()-style format string used to format the timestamps in the
generated listings. The accepted format specifiers are an useful subset of
those supported by strftime(), but the libc function is not used to make the
output of the module stable and locale-independent.
This fixes issue #23.
This adds a new "fancyindex_hide_symlinks" configuration flag, which will
filter out symbolic links from the generated file listings when enabled.
Feature suggested by Peter Wemm (https://github.com/DarkHelmet433)
Fixes issue #27
The fancyindex_footer and fancyindex_header settings need the standard Nginx
ngx_http_addition_module built into Nginx. Add a note to this effect in the
README.
Also, a warning is issued at configuration time if the addition module is not
enabled in the configuration.
Closes issue #26.
Adds a link to the nice theme designed by @TheInsomiac, which is a
great example of advanced theming using "fancyindex_header" and
"fancyindex_footer".
Closes issue #11
More exactly:
* In the requirements section, state that the module will work with
any version of Nginx newer than 0.7.x
* Updated URL to the Nginx wiki, using now wiki.nginx.org
* Specifying a custom CSS works, the README was contradicting the code.
FWIW, removed status markers from features in the file.
* Made the build instructions a bit more generic.
Adds a new "fancyindex_ignore string1 [string2 [... stringN]]" directive
which sets a lists of files which are not to be shown in generated listings.
If Nginx is built with PCRE support, strings are interpreted as regular
expressions, and files which match one of the regular expressions in this
list will not be sent in listings.
This allows for inserting a <link> tag in the generated listings pointing to
an additional CSS stylesheet, which will be applied by the browser after the
built-in rules. This allows for super-easy customization of the output look.
* Change old e-mail address to my new one.
* State that the module is unsupported in Nginx 0.6.x
* Remove text about the fancyindex_readme* directives
* Add some basic git ignores.
ngx_chain_t instead of always calling the output filter three times.
This should avoid possible blocking in Nginx code.
- Added warning about using external URLs in subrequest in readme file.
- Factorized out some variable declarations out to function header. Removed
a shadowed variable.
- Removed some debugging statements.