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"
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.
| Package | Summary |
| -------------------------------------------------------------------------------------------------------------------- | -------------------------- |
| <a id="raw-url" href="https://github.com/joergklein/packages/raw/master/centos/8/x86_64/rpms/hello-2.10-1.el8.x86_64.rpm">hello-2.10-1.el8.rpm</a> | Hello, the rpm binary |
| <a id="raw-url" href="https://github.com/joergklein/packages/raw/master/centos/8/srpms/hello-2.10-1.el8.src.rpm">hello-2.10-1.el8.src.rpm</a> | Hello, the rpm build files |
Alternatively, you can also use the hyperlink markdown instead of html as below
| Package | Summary |
| -------------------------------------------------------------------------------------------------------------------- | -------------------------- |
| [hello-2.10-1.el8.rpm](https://github.com/joergklein/packages/raw/master/centos/8/x86_64/rpms/hello-2.10-1.el8.x86_64.rpm) | Hello, the rpm binary |
| [hello-2.10-1.el8.src.rpm](https://github.com/joergklein/packages/raw/master/centos/8/srpms/hello-2.10-1.el8.src.rpm) | Hello, the rpm build files |
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With