Ankit Chotaliya
Ankit Chotaliya

Reputation: 31

Jekyll Download files from _data folder

here is my _data folder

_data:
    abc.csv

and in md file, I wanted to download that CSV file using a button for example <a href="Link to _data folder" download="">download Raw CSV</a> how can I achieve this?

I have tried <a href="<path to _data folder and filename>" download="">download Raw CSV</a> it is returning me 404 not found error when I click download.

Upvotes: 0

Views: 240

Answers (2)

juicy-g
juicy-g

Reputation: 496

If you just want to have the ability to download the file, put a copy in a assets folder. You will be able to link to the file directly from this path.

Upvotes: 1

ashmaroli
ashmaroli

Reputation: 5434

Data Files are not handled in the same fashion as your posts, documents and pages. Instead, data files are just parsed into Ruby objects for use while rendering of your posts, documents and pages.

To get Jekyll to create physical files from data files, you'll need a Ruby plugin. You can either write the plugin yourselves or get someone to write it for you.

Upvotes: 1

Related Questions