How do you include an asset download link in markdown?

ktouchie picture ktouchie · Jan 19, 2017 · Viewed 17.7k times · Source

I have a small JavaScript file in assets that I'd like to link to as a direct download.

The following link simply opens the file in the current tab:

[myFile.js]({{file name='myFile.js'}})

I'd like the file to actually download on clicking the link. Is that at all possible in markdown?

Answer

Johnson Zhou picture Johnson Zhou · Dec 6, 2018

It's the same as a link. [File Name](url). It works for me on Github pages' Jekyll implementation of markdown.