I am trying to write a custom helper that would work with local files. What is the preferred way to reconstruct a file path from a passed URL? url.fileURLToPath() does the job when the file URI scheme is used, but I need a universal solution. (I see that the {{imageDimensions}} helper solves this issue by referencing rendererInstance.siteConfig.domain and rendererInstance.inputDir, but it doesn’t seem to be possible for custom helpers.)
Unfortunately helpers.js has no access to such data. Through the last argument you will get only access to data available for handlebars, not the renderer config.
--
Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!