Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I provide files for download?

Tags:

I have written a post and would like to provide a file as attachment for download.

So far I have

  • created a link [Download files][download-file]
  • declared the link as [download-file]: download.zip
  • put download.zip in the _posts folder

However, the file does not get copied to the correct location.

I have

  • read about data files
  • read about directory structure
  • read about static files, which IMHO was the closest hit. Unfortunately, no example is provided.

So neither page gave me an answer on how to provide files for download.

I don't know where to put static files in the directory structure. Once I knew that, it seems I could use some Liquid like {{ site.static_files }}, but even then I'd still need to specify a file name.

like image 775
Thomas Weller Avatar asked Sep 19 '15 22:09

Thomas Weller


1 Answers

Here is my solution. I have a "myname".github.io, I created a folder /download inside the myname.github.io and inside this download folder I uploaded the files I want to include in my posts.

In the single post then I created the following code:

some text and [here is possible to download the file in PDF][1]  [1]:{{ site.url }}/download/file.pdf 
like image 122
SabDeM Avatar answered Oct 10 '22 00:10

SabDeM