Skip to content

Commit

Permalink
Fix CSV download links
Browse files Browse the repository at this point in the history
  • Loading branch information
slowe committed Nov 28, 2024
1 parent 2e4e65c commit 2828070
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/_components/wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function ({ comp, component, config, download }) {
config.attribution += '<div class="menu" data-dependencies="/assets/js/menu.js">';
if(typeof config.data==="string"){
if(download && typeof download.text=="string"){
config.attribution += '<div class="menu-item"><a href="' + dataPath + '/'+ config.data.replace(/\./g,"\/")+".csv" + '" class="download"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16"><path d="M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"/><path d="M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3z"/></svg>'+ download.text + (download.type ? ' ('+download.type+')':'')+'</a></div>';
config.attribution += '<div class="menu-item">'+dataPath+'<a href="' + dataPath + '/'+ config.data.replace(/\./g,"\/").replace(/^sources\//,"")+".csv" + '" class="download"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 16 16"><path d="M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"/><path d="M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3z"/></svg>'+ download.text + (download.type ? ' ('+download.type+')':'')+'</a></div>';
}
}
config.attribution += '</div>'
Expand Down

0 comments on commit 2828070

Please sign in to comment.