Search code examples
jekyll

How do I provide files for download?


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

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.


Solution

  • 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