Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for extensionless files #131

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

waylan
Copy link
Contributor

@waylan waylan commented Feb 9, 2016

Provides support for serving files without their extension. The requested URL /path/to/file will serve the file /path/to/file.html. The feature is off by default (when default_extension is set to None), and is activated when default_extension is set to an extension (i.e. ".html").

Emulates the behavior of Jekyll's Extensionless Permalinks:

Jekyll supports permalinks that contain neither a trailing slash nor a file extension, but this requires additional support from the web server to properly serve. When using extensionless permalinks, output files written to disk will still have the proper file extension (typically .html), so the web server must be able to map requests without file extensions to these files.

Both GitHub Pages and the Jekyll’s built-in WEBrick server handle these requests properly without any additional work.

The Jekyll docs continue by demonstrating how to configure Apache and Nginx to behave the same way. This would be a useful feature to use in development servers for Python based static site generators (Jekyll clones/competitors).

Note that I did submit this upstream first, but is was rejected as a feature that Tornado did not want to offer out-of-the-box.

Provides support for serving files without their extension. The requested URL
`/path/to/file` will serve the file `/path/to/file.html`.  The feature is off
by default (when `default_extension` is set to `None`), and is activated when
`default_extension` is set to an extension (i.e. `".html"`).
@lepture lepture added type: feature A self-contained enhancement or new feature type: discussion Discussion of general questions, ideas, design, etc. labels May 10, 2016
@lepture
Copy link
Owner

lepture commented May 10, 2016

I am not sure whether I could add this feature. This library is mainly developed for wsgi app.

@waylan
Copy link
Contributor Author

waylan commented Jul 25, 2016

I'm not sure I follow. What does "mainly developed for wsgi app" have to do with this? My understanding is that this is a a development server for developers to use during development so that they can emulate their production server locally. Adding this optional feature allows a wider audience to use this tool in development as it can emulate additional production server configurations. Of course, the decision is yours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: discussion Discussion of general questions, ideas, design, etc. type: feature A self-contained enhancement or new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants