Skip to content

Broken doc links when trailing slash #136

Closed

Description

@infotroph

The list of book versions presented at https://pecanproject.github.io/documentation works as expected and contains the expected links to https://pecanproject.github.io/documentation/develop/, https://pecanproject.github.io/documentation/latest/, https://pecanproject.github.io/documentation/v1_10_0/, and so on.

But when we add a trailing slash to the URL to get https://pecanproject.github.io/documentation/, the page loads and looks identical, but the links have an extra /documentation in them (https://pecanproject.github.io/documentation/documentation/develop, etc) and all load to the 404 page.

This has been biting me a lot because my browser, very reasonably, thinks the version with the trailing slash is the likeliest autocompletion since that's the longest common substring of all the different doc pages I visit.

Activity

  1. dlebauer commented on Jan 29, 2026

    @dlebauer
    Member

    at the same time, it seems some links are broken when there is no trailing slash, e.g. the /gsoc link I fixed earlier this week by adding a gsoc.html redirect (#140) and the subsequently reported menu link to package documentation (https://pecanproject.github.io/package-documentation/develop broken; https://pecanproject.github.io/package-documentation/develop/ works)

  2. infotroph commented on Jan 29, 2026

    @infotroph
    MemberAuthor

    @dlebauer I'm not convinced this belongs underneath #135 -- debugging one already-reported link issue isn't the same as implementing a full link check

  3. dlebauer commented on Jan 31, 2026

    @dlebauer
    Member

    @infotroph Certainly this isn't a perfect or necessary relationship. But I put it here because the parent should catch open errors, and only be closed when there are no more errors.

  4. dlebauer commented on Jan 31, 2026

    @dlebauer
    Member

    Also this should be closed by #143

  5. infotroph commented on Jan 31, 2026

    @infotroph
    MemberAuthor

    should be closed by #143

    No, it made it worse: Now if I try to manually visit https://pecanproject.github.io/documentation (no slash, with working links on it), I'm immediately redirected to https://pecanproject.github.io/documentation/ (with slash, all links broken).

  6. infotroph commented on Jan 31, 2026

    @infotroph
    MemberAuthor

    OK, I figured this out and #147 should fix it: Turns out having a src/pages/documentation.js file alongside a src/pages/documentation/ directory meant the former got compiled into the latter's index.html, NOT to a documentation.html outside the directory. So the relative links to documentation/foo/ were a layer too deep.

  7. AritraDey-Dev commented on Jan 31, 2026

    @AritraDey-Dev
    Member

    Yes, another solution could be to use "/documentation/develop" instead of "documentation/develop" with Link tag, but adding them like this in the markdown (#147) makes more sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions