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

Directory listing appears twice #79

Open
minfrin opened this issue Dec 7, 2020 · 3 comments
Open

Directory listing appears twice #79

minfrin opened this issue Dec 7, 2020 · 3 comments

Comments

@minfrin
Copy link

minfrin commented Dec 7, 2020

Just gave this a run, and very impressed as to how the javascript is so cleanly separated from the server.

When using an Apache mod_autoindex to generate a directory listing, I get this effect below - the directory listing appears twice, once inside a ul tag as provided by mod_autoindex, and a second time via a ul tag embedded in a main tag:

image

Am I misunderstanding how this works?

@minfrin
Copy link
Author

minfrin commented Dec 7, 2020

I figured out this was caused by a missing <!-- at the end of the scripts, which was being used as a hack to hide the existing static page.

A more rigorous approach would be to use the tag at the end of the HeaderName file, and a closing tag in the ReadmeName file.

This means when javascript is switched off, the page still works.

@dom111
Copy link
Owner

dom111 commented Dec 7, 2020

Hey there,

Thanks for the valuable feedback! The examples provided are just provided as-is for a starting point rather than a fully fledged integration so, yeah, definitely a hack to make it look 'right' without much in the way of configuration.

Sounds like a sensible idea to me, also potentially just obliterating the DOM entirely would be another option, but I was worried about lack of flexibility (lets say you wanted to display a disclaimer or whatever in the Header) afforded by those options. If you have time would you mind having a go at those changes and setting up a PR? If not I'll come back to take a look at this as time allows.

Thanks for your kind words too!

Dom

@stokito
Copy link

stokito commented Mar 5, 2023

We can just clear an existing body with:

console.log("Clear existing body if any")
document.body.innerHTML = ""

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

3 participants