Replies: 1 comment 5 replies
-
I did find an ugly workaround: for (let alg of ["md5", "sha256"]) {
let hash = crypto.hash(alg, "kevincox@kevincox.ca");
eleventyConfig.addPassthroughCopy(
{ [`source/logo.png{,${hash}}`]: "avatar/" },
{
rename: () => `../${hash}`,
},
);
} There are 2 major hacks here. The first is using The second hack is that because this is a "glob" rather than a file the file name would typically get appended to the output path. So I use the Despite being incredibly ugly this seems to work and doesn't seem to be relying on any internal interfaces (other than maybe if the deduplication gets smarter in the future?) |
Beta Was this translation helpful? Give feedback.
-
I am trying to implement the libravatar specification. Doing so requires making my avatar image available at a path specified by the MD5 and SHA256 hash of the email being checked.
My first attempt was this:
However it seems that later calls overwrite earlier ones, so only the sha256 hash was being output.
Is there a way to copy a single file to multiple locations with eleventy?
Beta Was this translation helpful? Give feedback.
All reactions