Repository navigation
How to modify outputPath via Template / Transform #2494
Unanswered
whoisvadym
asked this question in
Q&A
Replies: 1 comment 2 replies
|
https://www.11ty.dev/docs/languages/custom/#compileoptions.permalink-to-override-permalink-compilation is what you want I think! |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi, I'm an author of the
eleventy-plugin-postcssand as a part of my plugin functionality, I'd like to be able to modify the output path of the files that are created by my custom template.The plugin works by attaching the extension via
.eleventy.js:So far I've investigated the following options:
compilemethod to return a modified outputPath pass along with string content, but it looks like the method is expected to return the string or Buffer.eleventyConfig.addTransform("<transform_name>", (_content, outputPath) => { ... });but it looks like theoutputPathis read-only within the transform function.Why
One of the primary reasons for this is to implement a "hash" functionality that would attach a random configurable hash to the output file name to enable a cache-busting functionality:
output-dir/../output-file-name.<hash>.cssAll reactions