Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you include an asset download link in markdown?

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?

like image 320
ktouchie Avatar asked Jan 19 '17 13:01

ktouchie


People also ask

How do you add a link in readme MD?

To link inline, type the text you want to link within brackets, "[x]", followed directly by the link URL parentheses, "(y)". Reference-style linking allows you to give a link a number or "name" and refer to it multiple times.

How do I link an image in Markdown?

Using Markdown and HTML Images can be added to any markdown page using the following markdown syntax: ![ alt text for screen readers](/path/to/image.

How do I embed an image in a MD file?

You can add images to Markdown using the [alt text](image_url) syntax.


2 Answers

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

like image 157
Johnson Zhou Avatar answered Oct 17 '22 14:10

Johnson Zhou


Try using inline HTML <a href="myFile.js" download>Click to Download</a>

like image 6
Âishik Pyne Avatar answered Oct 17 '22 14:10

Âishik Pyne