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

FileExtension & DirectoryIndex can be confusing #60

Open
wjdp opened this issue Aug 28, 2017 · 0 comments
Open

FileExtension & DirectoryIndex can be confusing #60

wjdp opened this issue Aug 28, 2017 · 0 comments

Comments

@wjdp
Copy link
Owner

wjdp commented Aug 28, 2017

The FileExtension option is used to set which files are picked up by the document store (i.e. which files will be treated as HTML documents and tested). The DirectoryIndex option sets the name of the document which is the root of a directory (i.e. index.html).

Issue is to use another extension you need to set both:

FileExtension: .htm
DirectoryIndex: index.htm

If you don't set DirectoryIndex you get confusing errors like: target is a directory, no index --- index.htm --> subfolder/

I can think of three options to fix this, we can implement one or more as a combination.

  1. Remove the extension from DirectoryIndex (i.e. index) and do DirectoryIndex + FileExtension to get the index document. This is the cleanest but I think makes DirectoryIndex harder to understand.
  2. Warn / throw an error if the extension of FileExtension and DirectoryIndex do not match.
  3. Automatically adjust the extension of DirectoryIndex from FileExtension if the former is not explicitly set.

At the moment I'd go for a combo of 2 & 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant