Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Dat: ability to view html file without extension #272

Closed
aaronshaf opened this issue Jan 24, 2017 · 8 comments
Closed

Dat: ability to view html file without extension #272

aaronshaf opened this issue Jan 24, 2017 · 8 comments
Labels
enhancement Change that's on the roadmap

Comments

@aaronshaf
Copy link

Is there a way to tell Beaker to treat foo as foo.html? Thanks!

@aaronshaf
Copy link
Author

same issue with / and /index.html

@pmario
Copy link
Contributor

pmario commented Jan 24, 2017

But what if foo is a valid resource name?

@aaronshaf
Copy link
Author

Perhaps resolve foo if it exists, and then foo.html or foo/index.htmlif not?

@pfrazee
Copy link
Member

pfrazee commented Jan 24, 2017

A couple questions:

  • Is this for dat?
  • Is the issue that you have a /foo.html, and you want /foo to load /foo.html ?
  • What happens now? Does it 404, or does it show foo with the wrong content type?

@aaronshaf
Copy link
Author

aaronshaf commented Jan 24, 2017

Yes, dat.

Two separate proposals:

  1. /foo/ loads /foo/index.html
  2. /foo loads foo.html if foo file doesn't exist.

Either would return a text/html content type with a 200 OK.

#1 seems like standard browser behavior and has the benefit of parity with local "normal" behavior. #2 not so much.

The big idea is that people are used to hosting web pages without showing the extension. Aesthetics, but still important. This is how GitHub routes automatically as well for Jekyll-generated sites.

@pfrazee
Copy link
Member

pfrazee commented Jan 24, 2017

Yeah I think I'm on board with both proposals. Let me think about it for a little bit, to make sure I'm not forgetting anything, but I'll give a soft 'yes' on both.

@pfrazee pfrazee added enhancement Change that's on the roadmap and removed discussion labels Jan 24, 2017
@pfrazee pfrazee changed the title ability to view html file without extension Dat: ability to view html file without extension Jan 24, 2017
@tekknolagi
Copy link

I vote for proposal #1.

@pfrazee
Copy link
Member

pfrazee commented Feb 5, 2017

Turns out proposal 2 was already implemented. Proposal 1 will be in the next release.

Did you have trouble making proposal 2 work? It should be working (it is for me)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Change that's on the roadmap
Projects
None yet
Development

No branches or pull requests

4 participants