elm / elm-lang.org

Server and client code for the Elm website.
http://elm-lang.org/
BSD 3-Clause "New" or "Revised" License
1.99k stars 366 forks source link

Broken links and pages in elm-lang.org #450

Closed berndca closed 7 years ago

berndca commented 8 years ago

I did some testing in the context of converting elm-lang.org to static pages. All tests were done using a local installation of the server.

There is a Debug.crash statement in pages:

The following internal links (http://elm-lang.org/...) are broken, i.e. the target does not exist.:

Some of these links can be migrated to /examples/existingEample others don't have any existing equivalent.

Here is a list of defunct external links:

Broken link detection for elm-lang.org required a slightly different approach than usual because the server pretty much always return status code 200. I had to extract the title and compare against the title of the 404 page to verify that these links were broken. I do have a linkchecker logfile for my static version of the site with additional information such as parent page of broken links and line numbers in the static versions of these pages. I'm not sure how helpful this would be since there is no direct relation to the elm code line numbers of the current version of the site. Please let me know if you need additional information.

I'm almost done converting everything to a Hykall database.

Bernd

jvoigtlaender commented 8 years ago

Thanks for doing this!

It seems your method does not catch all broken links? For example, the page http://elm-lang.org/blog/interactive-programming contains a link to http://elm-lang.org/edit/examples/Intermediate/Bounce.elm, and that link 404s, but is not listed above.

berndca commented 8 years ago

You are of course correct. /edit/examples/Intermediate/Bounce.elm used in an iframe on /blog/interactive-programming is another missing link. I spend quite some time on /blog/interactive-programming since there were issues affecting the video iframes. In the context of debugging this issue I removed the paragraph above the Bounce.elm iframs and the iframe itself. The report is based on the existing static pages and my current page for /blog/interactive-programming does not have this link. Sorry for the confusion.

jvoigtlaender commented 8 years ago

Hah, so I managed to find the one link that you dropped. :smile: I had help, though, since I was looking through other issues about missing links in this repository, to check whether they could be closed now.

Actually, here is another one, probably missing from your list for the very same reason as the other one: http://elm-lang.org/examples/Intermediate.elm.

And, to also keep the information about the iframe around here, quoting myself from one of the other issues:

But what is really a bit embarrassing is the big "404 iframe" inside http://elm-lang.org/blog/interactive-programming that should apparently show a live-editable-and-hotswappable version of that (not anymore existing?) bouncing ball example.

jvoigtlaender commented 8 years ago

So let's think about how to make progress given all the information above now.

My suggestion would be to try to collect appropriate redirects here first. For example:

Based on that information, we can then search systematically for occurrences of stale links and replace them with current ones, or, where appropriate, instead add the redirects to this list.

evancz commented 8 years ago

I added checkboxes to all the broken links. It seems like many are from the website revamp where a bunch of paths changed, so they should be easy.

Ideally, we could do the fixes one at a time, so a single PR fixes a single link. This will be very very easy to review and nothing will block anything. Furthermore, you can make the changes through github even. So that's how I think we should go.

Also, thanks @berndca for getting this all together! :D

berndca commented 8 years ago

You can find more details about the broken links such as the parent file in this spreadsheet created by the linkchecker utility. For the implementation of the static website I applied three types of modifications.

  1. Redirects for broken internal links with existing target.
  2. Update of href attribute in broken external links with existing target.
  3. Deactivating of links without existing target.

Here is the list of my redirects (from, to):

    Redirect("Documentation.elm", "docs"),
    Redirect("Examples.elm", "examples"),
    Redirect("Install.elm", "install"),
    Redirect("Learn.elm", "docs"),
    Redirect("try", "examples/try"),
    Redirect("learn/What-is-FRP.elm", "guide/reactivity"),
    Redirect("learn/Syntax.elm", "docs/syntax"),
    Redirect("learn/Records.elm", "docs/records"),
    Redirect("learn/Union-Types.elm", "guide/model-the-problem"),
    Redirect("learn/Ports.elm", "guide/interop"),
    Redirect("learn/Tasks.elm", "guide/reactivity"),
    Redirect("learn/Components.elm", "guide/interop"),
    Redirect("learn/Pattern-Matching.elm", "guide/model-the-problem"),
    Redirect("blog/Pong.elm", "blog/making-pong"),
    Redirect("blog/Interactive-Programming.elm", "blog/interactive-programming"),
    Redirect("blog/announce/Repl.elm", "blog/announce/repl"),
    Redirect("blog/announce/PackageManager.elm", "blog/announce/package-manager"),
    Redirect("blog/Introducing-Elm-Reactor.elm", "blog/time-travel-made-easy"),
    Redirect("blog/Blazing-Fast-Html.elm", "blog/blazing-fast-html"),
    Redirect("edit/examples/Intermediate/Mario.elm", "examples/mario"),
    Redirect("edit/examples/Intermediate/Flickr.elm", "examples/flickr"),
    Redirect("edit/examples/Intermediate/Pong.elm", "examples/pong"),
    Redirect("edit/examples/WebGL/Cube.elm", "examples/cube"),
    Redirect("edit/examples/JavaScript/ZipCodes.elm", "examples/zip-codes"),
    Redirect("edit/examples/Reactive/ZipCodes.elm", "examples/zip-codes"),
    Redirect("edit/examples/Functional/Either.elm", "examples/either"),
    Redirect("edit/examples/Elements/Position.elm", "examples/mouse-position"),
    Redirect("edit/examples/Elements/Texture.elm", "examples/texture"),
    Redirect("edit/examples/Elements/Markdown.elm", "examples/markdown")

The list of changed external target can be found in this spreadsheet and the list of inactive links is here. All but two instances are links. There is however one iframe (Thwomb) in blog/announce/12.3 and one image (Tango-Palette.png) in blog/announce/0.10 in the inactive links.

Hope this helps.

evancz commented 8 years ago

Thanks @jvoigtlaender for fixing some of the existing links.

To share from another discussion, I think it makes the most sense to fix internal links rather than do redirects. There may be links on the internet to these things, but I think it still makes sense to fix the ones we own.

Also, many of the redirects listed by @berndca already exist here, but I think we should still fix the local links.

jvoigtlaender commented 8 years ago

@berndca, I think the redirect

Redirect("edit/examples/Elements/Position.elm", "examples/mouse-position")

is semantically wrong.

The former example was about Position in http://package.elm-lang.org/packages/elm-lang/core/3.0.0/Graphics-Element#container, whereas the other one you replace it by is about http://package.elm-lang.org/packages/elm-lang/core/3.0.0/Mouse#position.

jvoigtlaender commented 8 years ago

@berndca, in your list of fixed external links you appear to have always chosen the currently latest package versions. So for example, http://docs.elm-lang.org/library/Color.elm becomes http://package.elm-lang.org/packages/elm-lang/core/3.0.0/Color. Wouldn't it be better to use http://package.elm-lang.org/packages/elm-lang/core/latest/Color? That way, the links would stay current, rather than being pinned to some arbitrary point in time.

berndca commented 8 years ago

@jvoigtlaender, thanks for pointing out the issue with Position.elm. I'll add it to the deactivated links. Thanks also for pointing out that there is a "latest" url in page.elm-lang.org. I was actually looking for that the the time, however there appears to be a redirect in place diverting the client from this url. Perhaps this redirect could be changed giving the user the opportunity to bookmark the "latest" version of this link so that they don't have the change the bookmark with every release? @evancz I'm going to change the redirects to renames.

evancz commented 8 years ago

@jvoigtlaender, I don't know exactly how those libraries are referred to, but I was thinking it may be appropriate to link to the "matching" version of the library. So if it was 0.6 then it'd be an older version of core.

jvoigtlaender commented 8 years ago

@evancz, a problem with this is that versioning of libraries did not exist before Elm 0.14. So for the (indeed existing) link to http://docs.elm-lang.org/library/Color.elm in http://elm-lang.org/blog/announce/0.5, there is no "matching" version of the library one could link to. I see two options:

Following the second strategy would be easier, because it could be done very systematically, without checking for each old link whether it should go to 1.0.0 or 2.0.0 or ...

Also, you have already been following that second strategy yourself in newer blog posts. For example, http://elm-lang.org/blog/announce/0.14, which came out when versioning of libraries existed, contains a link to http://package.elm-lang.org/packages/evancz/elm-markdown/latest. That could have been a link to http://package.elm-lang.org/packages/evancz/elm-markdown/1.0.0 instead. (Or maybe 1.1.1, who knows?) So, if following the first strategy, then to be consistent with replacing http://docs.elm-lang.org/library/Color.elm by http://package.elm-lang.org/packages/elm-lang/core/1.0.0/Color rather than by http://package.elm-lang.org/packages/elm-lang/core/latest/Color in the 0.5 post, would we also have to go through the 0.14, 0.14.1, 0.15, ... posts and replace .../latest/... links in those by some pinned versions?

jvoigtlaender commented 8 years ago

http://www.share-elm.com isn't actually a defunct external link. It was just unreachable for a time, but now is back up.

jvoigtlaender commented 8 years ago

Only two of the "defunct external links" listed in the very first comment above should remain now:

justgage commented 8 years ago

I'm not sure if this is something that you are already aware of but I found this broken link on the current site:

I don't know if this has been noticed yet but the link about option types seems to be broke http://elm-lang.org/guide/model-the-problem

found here http://elm-lang.org/docs/syntax#union-types

Mouvedia commented 8 years ago

What about using archive.org as a fallback?

evancz commented 7 years ago

A lot of these are out of date, so I don't think it makes sense to try to use this to track these problems anymore. That said, thank you for creating this and helping resolve a bunch of these!