ClimateTown / knowledge-hub

Your one-stop shop in the fight against climate change, containing important climate resources you wish you knew about yesterday.
https://hub.climatetownproductions.com
Creative Commons Attribution 4.0 International
36 stars 26 forks source link

Patch download link filename #348

Closed VeckoTheGecko closed 11 months ago

VeckoTheGecko commented 1 year ago

Describe your changes

Looks like the issue is in the download \ attribute (defined in ButtonLinks.svelte, called in ResourceNav.svelte)

Usecases:

  1. Download file (original fname): <a href="path-to-your-file.ext" download>Download File</a>
  2. Download file (custom fname): <a href="path-to-your-file.ext" download="custom-filename.ext">Download File</a>

download looks like it should be a string attribute, with an empty string corresponding to usecase 1 (as per the example in this PR https://github.com/sveltejs/svelte/pull/2804/files), while a custom string can override the file name (case 2).

Updating the data type and passed argument.

Related issue number/link

Fixes #345

VeckoTheGecko commented 1 year ago

to generate the CSV for testing purposes, run (in your activated Python environment):

python scripts/resource_converter.py -i data/resources.yml -o static/ClimateTown-Knowledge-Hub-resources.csv
dmlb commented 11 months ago

👀

prettier.................................................................Failed
- hook id: prettier
- exit code: 1

[error] Cannot find package 'prettier-plugin-svelte' imported from /code/noop.js
VeckoTheGecko commented 11 months ago

👀

prettier.................................................................Failed
- hook id: prettier
- exit code: 1

[error] Cannot find package 'prettier-plugin-svelte' imported from /code/noop.js

Yeah, that's #349 😅