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

Links to sample data cause a 404 #26

Closed
philrz opened this issue Jul 22, 2022 · 2 comments · Fixed by #30 or #39
Closed

Links to sample data cause a 404 #26

philrz opened this issue Jul 22, 2022 · 2 comments · Fixed by #30 or #39
Assignees
Labels
bug Something isn't working

Comments

@philrz
Copy link
Contributor

philrz commented Jul 22, 2022

A community user reported the following via private gist.

There's links to sample data from the docs that currently result in a 404. For instance, the one linked from the section https://zed.brimdata.io/docs/next/tutorials/zed/#adding-data-to-our-lake highlighted here:

image

When clicked:

image

It doesn't fail when clicked in the page's original location within section https://github.com/brimdata/zed/blob/main/docs/tutorials/zed.md#adding-data-to-our-lake on GitHub, however. The original markdown link is just [here](github1.zng), and when clicked from within GitHub that resolves to https://github.com/brimdata/zed/blob/main/docs/tutorials/github1.zng. For what it's worth, that may not be a great link destination either, because it just brings the user to a page at https://github.com/brimdata/zed/blob/main/docs/tutorials/github1.zng that looks like this:

image

At this point clicking either "View Raw" or that "Download" button both end up downloading the file. So having this link resolve to the intermediate screen doesn't seem to be helping the user much.

Meanwhile, on the deployed docs website, the hyperlink that 404s ends up as https://zed.brimdata.io/assets/files/github1-2496d524ce44f4cb9f32cfeb70fa669e.zng/. Based on what I see in the Docusaurus docs, I guess it recognizes it's a file destination and downloads it and serves it out of this assets/ directory. In any case, as it turns out, if we just remove the trailing slash, the link works fine as https://zed.brimdata.io/assets/files/github1-2496d524ce44f4cb9f32cfeb70fa669e.zng.

Therefore, I can see see at least two possible ways out, though I'm sure there's others:

  1. We could change the destination for the link in the original markdown to be https://github.com/brimdata/zed/raw/main/docs/tutorials/github1.zng (i.e., the link attached to that "Download" button), since it looks like that link would stay as-is even after Docusaurus publishes the site. This would have the added bonus that if users ever click the link in the original page on GitHub it'll go straight to download, but maybe there's other negatives to having an absolute URL like that.

  2. Someone could figure out how to remove the trailing slash from the generated link on the docs site or figure out how to make our web site serve a file destination even if it has a trailing slash. FWIW, I did some searching and found people at asset links with trailing slash true can be broken facebook/docusaurus#6282 talking about a similar problem.

@philrz
Copy link
Contributor Author

philrz commented Jul 30, 2022

I've reopened this. Details are in #32.

@philrz
Copy link
Contributor Author

philrz commented Aug 29, 2022

The conclusion here is that we ended up using a Docusaurus config with trailingSlash: false and hosting the site at Netlify rather than GitHub Pages to make that config workable. The links to the assets on the Zed tutorial page that previously caused an HTTP 404 when clicked now have links https://zed.brimdata.io/assets/files/github1-2496d524ce44f4cb9f32cfeb70fa669e.zng and https://zed.brimdata.io/assets/files/github2-d64f82ea518d971a86ad9e81da3a9b6e.zng, which download successfully.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants