I want to use links in a markdown file that one click download an RPM file. When I click the link, the page opens on GitHub.
Here is what I tried:
| Package | Summery |
| -------------------------------------------------------------------------------------------------------------------- | -------------------------- |
| <a href="centos/8/x86_64/rpms/hello-2.10-1.el8.x86_64.rpm" download="hello-2.10-1.el8.rpm">hello-2.10-1.el8.rpm</a> | Hello, the rpm binary |
| <a href="centos/8/srpms/hello-2.10-1.el8.src.rpm" download="hello-2.10-1.el8.src.rpm">hello-2.10-1.el8.src.rpm</a> | Hello, the rpm build files |
2nd
| Package | Summery |
| ----------------------------- | -------------------------- |
| [hello-2.10-1.el8.rpm][1] | Hello, the rpm binary |
| [hello-2.10-1.el8.src.rpm][2] | Hello, the rpm build files |
[1]: centos/8/x86_64/rpms/hello-2.10-1.el8.x86_64.rpm
[2]: centos/8/srpms/hello-2.10-1.el8.src.rpm"
2
Answers
The relative link that you are using would resolve and redirect to the GitHub page of the particular file (note that it would redirect to
../blob/master/..
). You need to add the markdown with the link for the raw file (so that it would redirect to../raw/master/..
) as below for it to be downloadable on click.Alternatively, you can also use the hyperlink markdown instead of html as below
In markdown links are shown like
so you can write it like
so as the .rpm can`t be open in the browser, they will be downloaded
And as you said it open the github page try to add https://raw.githubusercontent.com instead of https://github.com
Then it will work