Skip to content

Loading…

Conflict when a templates subdirectory has same name as a top level rendered page. #66

Open
corporealfunk opened this Issue · 2 comments

2 participants

@corporealfunk

Punch version 0.5.14

Given a project with a templates/_layout.mustache file and a contents/test.json file, when using the punch server, visiting localhost:9009/test.html renders correctly.

Now, from the project root:

mkdir templates/test
echo "this is the static content under test/index.html" > templates/test/index.html

Visit: localhost:9009/test.html and we should see the test.json data templated via the _layout.mustache file as before, however, we see:

"this is the static content under test/index.html"

We should only see that content if we visit: localhost:9009/test/index.html or localhost:9009/test/

This appears to be a problem during generation as well, but in a slightly different way. Only the "test/index.html" file is generated, the "test.html" is not generated.

@laktek
Owner
@corporealfunk

Webservers such as Apache, NGINX, etc. serve this use case without difficulty and I am currently dealing with a legacy site structure that uses naming conventions like these.

I'm actually curious as to why this is a design feature of punch, these two paths are quite different:

test.html
test/index.html

Why should they not be allowed to be generated and serve different content?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.