trunk
trunk copied to clipboard
267 Rename ```copy-file``` assets
Hi all!
This is my first PR for this project, so if anything is out of line with the code I wrote, feel free to call it out. I appreciate constructive criticism.
Overview
Resolves #267
Users have requested that they have the ability to change the file name when using Trunk to copy a file. This pull request is to reassign the file name-related attributes to the single FileAsset before it is written to the new directory.
Checklist
- [X] Updated CHANGELOG.md describing pertinent changes.
- [X] Updated README.md with pertinent info (may not always apply).
- [X] Updated
site
content with pertinent info (may not always apply). - [X] Squash down commits to one or two logical commits which clearly describe the work you've done. If you don't, then Dodd will 🤓.
Manual Testing Steps
- Create a project or use a previously existing project that has a
<link data-trunk rel="copy-file" ... />
tag in its index.html file. - Add the
new-name
attribute to it with any value you see fit (although you may run into more errors down the line if unsupported characters or file types are used).- ex:
<link data-trunk rel="copy-file" href="assets/favicon.ico" new-name="bojangles.jpg" />
- ex:
- Run
trunk serve
or any other build command. - Check the
dist/
directory (or other compilation target directory, should it differ in your environment) for your copied file with a new name.
My two (admittedly bikeshedding) cents: I think trying to stay HTML5 compliant as possible would probably be the most intuitive. data-dest
might be a better name; or we could also (ab)use and use overload target
instead as the attribute name.
@edward-shen I like where your head is about this. I've read some attribute-related issues for this project about the usage of the data-
prefix for HTML attributes, and there are discussions about changing it to a trunk-
prefix in the future. I happen to be on team trunk-
, but since that change hasn't happened yet, I'm of a mind to go with data-dist
for this issue. That way if and when HTML attributes are revisited project-wide, this one won't sneak past anyone.
This is a great feature. Any plans to get this PR merged?
@NiklasEi definitely! If you would like to push a changeset on top of this branch to fix these items, that would be awesome. Just don't overwrite @zottwickel's work 😄
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.
This PR was closed because it has been stalled for 10 days with no activity.