Github prepends "https://github.com/user/repo/blob/main/" to all links in readme.md - github

I have a private repository on GitHub that contains a readme.md file with links to Kaggle datasets. When viewing the repo on github prepends "https://github.com/{user}/{repo}/blob/main/" to the url, breaking it.
Why is this happening, and how do I change this behavior?
For what it's worth, I'm also using git-lfs, though I can't find any documentation of this behavior associated with that, either.

I ended up figuring this out on my own. The URL was missing a scheme, and github was treating it like a relative link to something in the repository. This was my mistake and not an issue with github.

Related

How to fix wrong link in CONTRIBUTING.md in a github repository?

When you have a github repository you might have a file CONTRIBUTING.md which describes how users can contribute to this project.
In a file CONTRIBUTING.md in one of our groups repositories the following raw text
Please do not hesitate to raise an issue on [github project page][github].
creates the text
Please do not hesitate to raise an issue on github project page.
where github project page is a link that leads to a different github repository!
So the internal link [github] (or what this is) leads to a different repository. I also do not understand what the two square brackets together mean
[github project page][github]
as a link usually is created with a normal and a square bracket
[GitHub Pages](https://pages.github.com/)
The project has been renamed, but the link leads to a completely different github repository.
How can I fix this? How can I change the link of the internal link [github]? Or where can I find documentation about this feature?
It turns out it is a kind of reference defined at the end of the file!
So for the above example you can define this reference at the end of your file as follows:
[github]: https://github.com/YourGroup/YourRepo
Not sure this is documented.

Gh-pages not displaying the right thing

I'm having some issues with getting the proper page to display. I've looked up different answers and they don't seem to be working for me.
https://github.com/samus94/portfolio2.1
Please let me know what I've done wrong here.
It was displaying the readme before, and I think it still is.
First, You've posted a link to your GitHub repository, not your GitHub Page. The address for GitHub pages always looks like https://<yourname>.github.io/<reponame>.
To get this URL you can go into the settings for your repo and find the GitHub Pages section. Make sure you have GitHub Pages enabled, then look for the URL your site is published at.
Finally, GitHub Pages requires your repository have a very specific structure. It expects there to be an index.html file at the root of the repository. This means you have to either move everything in your /src directory to the root, or move the index.html and update the URLs to your javascript and CSS.
All of these requirements are outlined clearly in the GitHub Pages documentation.
Deploying static HTML + CSS + JS sites (NO jekyll) to Github Pages,
using Github Actions was harder than I though.
Theres is very few quality documentation about this specific topic, except this one:
Steps overview:
Setup a custom action in github
Push changes and the action executes automatically
Your page is deployed to github pages
One important thing: I had no need of changing any property in the yml; don't worry about customizations.

Github Pages with Sphinx generated documentation not displaying HTML correctly

I have been trying to publish a Sphinx generated documentation for our repository on Github pages with the theme provided by readthedocs.org.
After a few attempts I managed to get it online by uploading the Sphinx generated HTML files in the gh-pages branch of the repository.
Obtaining this:
https://takeqontrol.github.io/qontrol_api/
Which is looking awful, erasing all the customization of the theme by Read the Docs.
Here is an example of what you see if you open the link:
But if I open those HTML files on my computer the pages looks exactly how I wanted them to look.
Here is an example of how exactly the same HTML looks locally:
Does anybody know what is going on? Or even point me somewhere where I can find an explanation?
All the code is available here: https://github.com/takeqontrol/qontrol_api
in the two branches.
I fought with this for 9 hours before figuring out that the underscore in the _static folder was causing the issue.
You need to by pass Jekyll on github pages.
To do this, add an empty .nojekyll to your gh-pages branch. (See example)
I was having a similar issue and then found this, which solved it for me:
Python Sphinx css not working on github pages
Looks like using underscores for the _sources + _static folder caused the issues. Need to rename the folders and paths using them in the html files accordingly.

GitHub Markdown - Add current branch name

Just a short question:
Is it possible to show the current branch name in e.g. README.md automatically with a placeholder or something like that using GitHub Flavored Markdown?
No, I'm not aware of anything like that within READMEs or any other markdown documents when browsing through the source of your project. And nothing turns up when searching their help page either.
However, GitHub Pages offers all sorts of info about the repo the document is associated with. Of course, GitHub Pages is a very different thing than a README file, so that may or may not be helpful to you.

GitHub: Linking to an issue from a wiki page

On GitHub, is there a simple way to reference an issue (eg: #1234) from within a markdown file such that it is displayed as a hyperlink?
I don't want to write out the full form each time, as in:
[#1234](//github.com/user/project/issues/1234)
In commit messages, issue numbers are automatically hyperlinked. Can this happen in wiki documents too?
(This is not a duplicate of this question which is simply asking about markdown hyperlink syntax.)
It doesn't happen in wiki documents.
You can use a relative url but it isn't that much of a shortcut. It also depends on where you are in the project.
For example in the Readme.md in the master branch of the project:
[#1](../../issues/1)
On the github wikis:
[#1](../issues/1)
Anywhere:
[#1](/user/project/issues/1)
(h/t to VertigoRay for suggesting this)