-
-
Notifications
You must be signed in to change notification settings - Fork 5
Remove creation date from generated PDFs #4
Conversation
The creation date included in the generated PDFs causes `npm run build` to update all PDFs with a new creation date, causing a lot of unnecessary changes. This hacks the CreateDate value to be an empty string, preventing regeneration of the PDFs from causing changes to all PDFs. This can be tested by running `npm run build` on the master branch and observing that all PDFs are changed. Then running `npm run build` on this branch, commiting the result, running `npm run build` again and observering no changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, @ericcornelissen - and works perfectly when testing locally.
The only other proposal would be to set the creation date to the last time the SVG was modified on the main repo, but that's a headache for another PR!
Thanks for verifying this 👍
I totally agree that would be a nicer solution, and I thought about it myself as well, but I can't think of a way to get this information currently (the file stats of the |
That's fair. I imagine otherwise there's a LOT of logic to trying to find the commit that edited the file last, and using the timestamp of that commit. Not worth it in the grand scheme of things. |
It's definitely possible, but not worth the trouble I'd say. Not to mention that it would require fetching the repository on top of/instead of fetching the package from NPM. I don't think that's worth the trouble of building and maintaining something for this here. Maybe we can do this if there's a pre-existing solution for analyzing the hit history like this 🤔 |
Yeah that's fair, as I say it's something for another PR if we decide to proceed with it. Happy for this to get merged in, if it's ready? |
This PR is ready, but the website repo is not yet ready for this to be merged 🙃 hoping to get that done tomorrow. |
Do you want to open an issue for that, @adamrusted? |
... in order to prevent the PDFs from "changing" when running
npm run build
for new/updated SVGs.The implementation is a bit of a hack as it involves providing a value for the
info.CreationDate
option that results in an empty string in the PDF.Note that with this Pull Request, the change hasn't taken effect yet. The PDFs need to be regenerated once in order for the creation date to be set to an empty string, after which they will stay that way and unchanged SVGs no longer result in new PDFs.