Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Css/js auto versions (extended the engine) #398

Open
Pok4 opened this issue Apr 12, 2022 · 2 comments
Open

Css/js auto versions (extended the engine) #398

Pok4 opened this issue Apr 12, 2022 · 2 comments

Comments

@Pok4
Copy link

Pok4 commented Apr 12, 2022

Hello guys, can someone give me a addon for mustache which is add ?v=65 (for example) in the end of css/js libs.
I already have templates and i want to prevent caching for my users with this custom addon.
I want to be automatically,because i'll make a input with version and this input will work with sql config table.
This will be cool.
Sorry for my english.

@Pok4
Copy link
Author

Pok4 commented Apr 14, 2022

here is some examples for what i want to do... If i have:
<link rel="stylesheet" href="http://localhost/template/default/css/style.css">
i want to be
<link rel="stylesheet" href="http://localhost/template/default/css/style.css?v=323211">

I want a custom code for editing the templates in cache folder or something similar...
All of the css and js files is in header.html file in my templates...

@bobthecow
Copy link
Owner

This is probably a use case for a postprocessing or preprocessing (could be done as part of the loader?) step, not an extension of Mustache itself.

Alternatively, if you control how the links are added to the template, you could use something like … 

<link rel="stylesheet" href="http://localhost/template/default/css/style.css{{ asset_version }}">
$m = new Mustache_Engine([
  'helpers' => [
    'asset_version' => $howeverYouGetThis,
  ],
]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants