octokit / octokit.net

A GitHub API client library for .NET
https://octokitnet.readthedocs.io/en/latest/
MIT License
2.62k stars 1.07k forks source link

[DOCS] documentation site 'Edit On GitHub' links return a 404 #2863

Open wesdevpro opened 3 months ago

wesdevpro commented 3 months ago

Discussed in https://github.com/octokit/octokit.net/discussions/2859

Originally posted by **benhopkinstech** January 22, 2024 Hello all, Sorry if this is the wrong means of doing this but I don't feel it warranted an issue being created due to it not being a problem with the code itself. When I was browsing the [documentation website](https://octokitnet.readthedocs.io/en/latest/) I noticed that the 'Edit on GitHub' links all seem to return a 404. The links seem to point to the repository on the `master` branch which must have existed previously before being renamed to `main`. For example [https://github.com/octokit/octokit.net/edit/master/docs/index.md](https://github.com/octokit/octokit.net/edit/master/docs/index.md) is the link provided when trying to edit the home page. This should read [https://github.com/octokit/octokit.net/edit/main/docs/index.md](https://github.com/octokit/octokit.net/edit/main/docs/index.md). Hopefully it should just be a matter of updating the base url on the documentation site to https://github.com/octokit/octokit.net/edit/main/docs/. Ben
kfcampbell commented 3 months ago

@benhopkinstech would you prefer to have the conversation here or in the discussion you created?

benhopkinstech commented 3 months ago

@kfcampbell just keep it here and close the discussion, I wasn't sure where to raise it initially as I know the site is external to the repository.

kfcampbell commented 3 months ago

I've done so! I'm also going to copy my initial response there to here:

What's really curious to me is that in most cases, such as clicking on the "Getting Started" guide here, GitHub will redirect to the correct branch and show a little banner:

image

As for actually fixing this, I'm struggling to find where to make the change. I'm not seeing any relevant configuration in our docs configuration in mkdocs.yml. Searching for "master" in our codebase doesn't lead anywhere that looks useful (though incidentally I created this PR to correct some links using it when they shouldn't be). I wonder if readthedocs.io assumes our default branch incorrectly?

benhopkinstech commented 3 months ago

I've requested approval on that PR.

It still doesn't answer the issue on the readthedocs site, I have found this issue.

Looks like we will need whoever has an account for the site to go in and change the settings.

kfcampbell commented 3 months ago

Ooh that's interesting... @nickfloyd do you know who might own those credentials? I've checked and I don't have access to anything that looks relevant.

benhopkinstech commented 3 months ago

Sign in should be available here