Commit graph

53 commits

Author SHA1 Message Date
Mamadou Lamine NIANG
a634077b5f Add case-insensitive name sorting support
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 #78
Closes #124

Co-authored-by: Ryan Schmidt <git@ryandesign.com>
2023-01-20 15:26:16 +02:00
Danila Vershinin
f50d7b799f Update available distros with module package
Fedora Linux has packages available, removed linking to old NGINX module package version
2022-07-19 15:54:45 +03:00
Ryan Schmidt
778561eabf README.rst: Note MacPorts can install fancyindex 2022-05-25 23:52:14 +03:00
Ryan Schmidt
3d47d0d6b1 README.rst: Fix typos and other minor edits 2022-05-10 21:54:12 +03:00
Anthony Ryan
5930c29d6a Remove fancyindex_name_length by offloading work to CSS
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.
2021-10-28 22:37:48 +03:00
Adrian Perez de Castro
527511fbf8 Load local header and footer files when configuring
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.
2020-10-24 18:52:58 +03:00
Adrian Perez de Castro
6637a7afab Update to Nginx 0.8 as oldest supported version 2020-10-24 15:40:07 +03:00
Adrian Perez de Castro
d3d7adc89d README: Update CI link to use travis-ci.com instead of .org 2020-10-24 14:08:56 +03:00
Joshua Shaffer
56934db14c update readme 2020-05-26 16:14:09 +03:00
kPherox
47ce20d993 refs aperezdc/ngx-fancyindex#57 Add fancyindex_hide_parent_dir directive 2018-10-15 11:28:09 +02:00
Nicolas CARPi
7abb6e3693 Fix some issues in the README file
* 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
2018-10-15 02:10:55 +02:00
Adrian Perez de Castro
5f265ab6eb
Add themes by @fraoustin and @alehaa
Closes #87
2018-07-03 01:01:31 +03:00
Lilian Besson
5dd4ec3b3c Typo on code block formatting 2018-07-02 23:46:01 +03:00
Nick Geoghegan
b21ec45790 Fixes #72 2017-06-17 00:43:52 +03:00
Lilian Besson
eb2fd247ea Update link for the 2nd theme example
The linked project (and example) was dead. Mine is not. (https://github.com/Naereen/Nginx-Fancyindex-Theme)
2017-04-26 01:38:19 +03:00
Danila Vershinin
a97cc6639d Update README.rst 2017-04-22 17:49:57 +03:00
Danila Vershinin
6ffd207a56 Update requirements for CentOS 7
Adds reference to GetPageSpeed extras RPM repository and availability of fancy index dynamic module
2017-04-22 17:49:57 +03:00
Iulian Onofrei
6e2f3fbe1c Update README.rst
Add missing module loading command to the documentation
2017-01-17 12:31:35 +02:00
Luke Zapart
2fa65b05f1
Add fancyindex_directories_first config directive.
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.
2016-08-18 00:36:24 +03:00
nwrd
1e037c8fba fix readme file 2016-06-26 19:08:36 +02:00
Adrian Perez de Castro
022c117576
README: Mention the possibility of compiling as dynamic module 2016-06-08 16:04:41 +03:00
Adrian Perez de Castro
aa18095ffc
Change the build status badge to use the Travis-CI one
Travis-CI better signifies the build status, as it tries building with
combinations of compilers, nginx versions, and dynamic vs. statically
linked modules.
2016-06-08 15:49:09 +03:00
Thomas P
cb3d21157b Add the 'show_path' configuration directive
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
2016-02-13 15:37:54 +01:00
stayn0ided
69105c65d8 fixed readme theme section 2015-08-23 12:51:47 +02:00
Adrian Perez de Castro
4d0200d22c README: Add one more theme 2015-08-17 01:08:23 +03:00
Adrian Perez de Castro
5599bbebba Allow specifying timestamp format with fancyindex_time_format
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.
2015-08-16 23:54:32 +03:00
Adrian Perez de Castro
42d10a2a24 Add option to hide symbolic links from generated listings
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
2015-08-16 13:08:04 +03:00
Adrian Perez de Castro
fdce427a5c README: Mention the need for ngx_http_addition_module
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.
2015-08-09 14:14:40 +03:00
Martin Herkt
dc64f24bbc Make file name length limit configurable 2015-02-19 13:10:27 +01:00
Mim
7a07987ad3 Make sorting criterion configurable 2015-02-19 13:06:27 +01:00
Adrian Perez de Castro
e5cbf4873d Link to theme designed by @TheInsomniac from README
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
2014-11-05 11:47:15 +02:00
Adrian Perez de Castro
4d1aa8680e Added drone.io status badge to README 2014-09-19 13:10:26 +03:00
Adrian Perez de Castro
87e4206159 Release version 0.3.3 2013-10-25 13:06:44 +03:00
Adrian Perez
607159a61d Update README with some bits
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.
2012-01-18 00:31:22 +02:00
Óscar García Amor
a86e293f4f - Fixed description errors in README.rst
- Now the directives are sorted alphabetically
2011-07-20 08:37:07 +02:00
Adrian Perez
d8e0bdaef2 Update e-mail address and copyright headers 2011-04-03 00:22:59 +03:00
Adrian Perez
2f138afb70 Implement fancyindex_ignore configuration directive
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.
2010-09-09 16:42:46 +02:00
Adrian Perez
4b19f3a73f Add fancyindex_css_href configuration option
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.
2010-06-10 16:56:31 +02:00
Adrian Perez
062b851137 Update README file, add .gitignore
* 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.
2010-06-10 01:49:30 +02:00
Adrián Pérez
6d5cec8e68 Corrected README 2008-12-10 02:23:32 +01:00
Adrian Perez
d508e6f95a - Added support for sending as much response as possible in a single
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.
2007-09-19 18:22:16 +02:00
Adrian Perez
2f429b796b - Updated documentation.
- Fixed XHTML 1.0 validation by enclosing JS code into a CDATA section.
2007-09-13 23:40:40 +02:00
Adrian Perez
4cc0d75806 Fixed readme 2007-09-12 12:40:21 +02:00
Adrian Perez
549d00bdae Clarified documentation 2007-09-11 12:28:26 +02:00
Adrian Perez
ddadd2a210 Removed now unused (see comments on #205) include_mode and corresponding directive 2007-09-10 18:01:40 +02:00
Adrian Perez
ef9ee57749 Updated README 2007-08-30 18:39:37 +02:00
Adrian Perez
c2f086207b Added fancyindex_mode directive. 2007-08-28 13:32:01 +02:00
Adrian Perez
ec48c46ce8 - Added config flag to wrap up readme file as an IFRAME.
- Updated readme file accordingly.
2007-08-22 19:30:46 +02:00
Adrian Perez
6af366dc6f Added missing words 2007-08-21 21:50:38 +02:00
Adrian Perez
1f5952dff9 Fixed rst ref typo 2007-08-21 21:50:07 +02:00