lemmy-docs icon indicating copy to clipboard operation
lemmy-docs copied to clipboard

Fix 404 page

Open Nutomic opened this issue 4 years ago • 4 comments

broken: https://lemmy.ml/docs/en/index.htmlasd

working: https://rust-lang.github.io/mdBook/cli/index.htmlasd

Nutomic avatar Jan 25 '21 23:01 Nutomic

This should be pretty straightforward by adding the following to the nginx config, but I cant get it working.

# docs
location /docs {
    proxy_pass http://0.0.0.0:8030;
    error_page 404 = https://enterprise.lemmy.ml/docs/en/404.html;
}

I also noticed some more problems:

  • loading the 404 page doesnt work because javascript files are served with text/html headers
  • images are not loading, it tries /docs/en/main_screen.png but its under /docs/en/about/main_screen.png, so maybe we need to move the file
  • it would be nice if we could get rid of .html in URLs, but i'm not sure if that works with proxy_pass

Maybe it would be better to fix those problems in Lemmy.

Nutomic avatar Jan 26 '21 12:01 Nutomic

You could redirect to this page: https://enterprise.lemmy.ml/404?err=cant_find_docs

And customize with whatever message you like.

I imagine the 404 stuff should be handled whenever they merge that branch.

dessalines avatar Jan 26 '21 15:01 dessalines

I think it needs to be fixed on our end. Right now we are just serving static files, so we need to specify which file should be served if the one requested cant be found. And the mdbook 404 page is clearly better in this case.

Nutomic avatar Jan 26 '21 15:01 Nutomic

I think its on mdBooks end... if I go to https://enterprise.lemmy.ml/docs/en/index.html , all the content-type's for css and javascript are correct. They haven't properly worked out their 404 page. I still just suggest redirecting to our 404 as a short term fix until they actually get their multi-lingual support properly working and merged.

dessalines avatar Jan 26 '21 17:01 dessalines