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

Pages are not display properly if viewed offline #7

Open
imikejackson opened this issue Aug 3, 2017 · 4 comments
Open

Pages are not display properly if viewed offline #7

imikejackson opened this issue Aug 3, 2017 · 4 comments

Comments

@imikejackson
Copy link

if I use the theme and do 'mkdocs serve' everything looks and acts great:.
screen shot 2017-08-03 at 4 13 35 pm

but if I do 'mkdocs build' then trying to access that same page results in the following:

screen shot 2017-08-03 at 4 16 33 pm

The image above was taken from our QWebEngine based html viewer (Basically Chrome). If I try the same site within Safari then the enclosing folder of the index.html file is opened up.

I use the "material" theme or the "mkdocs" theme I do not have these issues.

I like your theme because we have a large documentation project and the permanent navigation on the left side is extremely useful for navigation.

@dsagal
Copy link
Member

dsagal commented Aug 4, 2017

This is a two-part problem: one is that URLs need to handle "index.html" suffix (presumably you are also setting use_directory_urls: false in mkdocs.yml). The other is that with file:// URLs, the iframe isn't considered to be the same-origin as the main page. So it's not a simple fix, but I have a version that seems to work: #8 . Would you be able to test it a bit before I merge it in?

@imikejackson
Copy link
Author

Sorry for the delay, I was not subscribed to the issue.. I tried out the branch file_urls but using Safari on macOS 10.10 did not work. When I click a link the macOS Finder just opens the location to the file on the disk. Nothing is actually displayed in the web browser. Using Chrome I just get the file listing. Sorry, it does not seem to work.

@Eladretep
Copy link

Eladretep commented May 8, 2019

I have the same issue (directory view being displayed when files are used offline) on the latest version. Using #8 fixes the issue for me and lets me browse the site without serving it.

However, the search feature doesn't work on that pull request. I suspect that might be because the pull request is quite old now, and merging it into master could fix searching? If so, could you consider merging it? I'm hoping to be able to browse and use search when using the documentation offline.

Thanks, I'm happy to help with any further testing for this issue.

@Eladretep
Copy link

Eladretep commented May 8, 2019

I've tried a merge of #8 and master. It still fixes this issue for me, but search still doesn't work - there must be more to it. I might be being too hopeful about search working without serving the files, but #8 seems to break it when using mkdocs serve as well.

Edit: Just wanted to say I've got something working using a different theme now, but still happy to test if you decide to take a look at this anyway :)

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

No branches or pull requests

3 participants