press icon indicating copy to clipboard operation
press copied to clipboard

rendering files before compression

Open fgutmann opened this issue 14 years ago • 2 comments

Hi Dirk,

we need to render some files with the template engine before compressing them. I implemented a patch for this purpose, which we want to use internally for our project.

In our version the script, single-script, stylesheet and single-stylsheet tag support an option "render". If it is true, the file is rendered using TemplateLoader before adding the source to the compressed file.

When press is disabled ("press.enabled=false"), files that need rendering are linked as "/press/[js|css]/rendered/". The corresponding action just renders the file and outputs it uncompressed.

The improvement is of limited use because you can't pass additional parameters to the template, but it is fine for our use case. If you wan't this option in future press versions, I'm glad to send you a pull request.

Btw. what is the licence of the press module? Is it fine for you that we use a modified version? All changes are published in my press git repository.

Thanks,

Florian

fgutmann avatar Jun 27 '11 12:06 fgutmann

Hey Florian, It's an interesting idea. I'm currently on site with a client but when I get back to Buenos Aires I'll take a look at it. Thanks for the submission! Dirk

dirkmc avatar Jun 28 '11 16:06 dirkmc

Any reason why this feature is not included in the latest version? Thanks

Simon

mhchan avatar Nov 17 '11 17:11 mhchan