Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add a downloadable file to my Github.io page?

I have set up my professional website/homepage using Github Pages. I know if this was just HTML being served up from somewhere, my downloadable file would need to be in the directory of my .html file, and then I could reference it in the .html file and link it up. However, since this is served by Github through repository, I am unsure on how to do this.

  1. Do I put my downloadable file in my repo under version control like the rest of the project?
  2. If so, what path do I use in the .html file?

Also, I am aware that the Automatic Page Generator makes it possible to hardly touch the HTML, but it seems pretty restrictive as far as customizing where links and other content appears on your page...

like image 557
Houdini Avatar asked Aug 05 '13 15:08

Houdini


People also ask

How do I add files to GitHub io?

On GitHub.com, navigate to the main page of the repository. Above the list of files, using the Add file drop-down, click Upload files. Drag and drop the file or folder you'd like to upload to your repository onto the file tree.

How do I add a download button to GitHub?

To download from GitHub, you should navigate to the top level of the project (SDN in this case) and then a green "Code" download button will be visible on the right. Choose the Download ZIP option from the Code pull-down menu.


1 Answers

You could just link it normally in your html. Commit it to your repository and have users right click to save.

I just tried this on one of my repositories where I put a link to my CSS file.

<a href="css/style.css">style.css</a>

I was able to right click the link and download the file. If you wanted to create a download from the root you would do:

<a href="file.txt">Download File</a>

I'm pushing my repositories manually instead of using the Automatic Page Generator. The steps are pretty straight forward Creating Project Pages Manually - GitHub Help

like image 109
Patrick Avatar answered Oct 28 '22 23:10

Patrick