Open oguzhanagyar opened 4 years ago
@oguzhanagyar: Twig files or files in any other templating language aren't supported by critical. You'll need to compile your layouts to html
before passing them down to critical and then you should do the inlining yourself.
What i would do is:
I've done this 3 years ago like this with symfony php and it worked quite well: See https://github.com/bezoerb/generator-sf/blob/master/generators/view/plain/templates/index.html.twig
However, you shouldn't use the loadcss approach. See https://www.filamentgroup.com/lab/load-css-simpler/
A simple <link rel="stylesheet" href="/path/to/default.css" media="print" onload="this.media='all'">
should do the async loading of the page css
I'm trying to add critical css to my project, but when I run grunt the '{% for%}' tags fail.
here is html.twig file
here is gruntfile.js
It works fine when I remove the for tags.
Does anyone know the solution to the problem?