miller
miller

It would be great if there was an option to minify all html code of the page just like css and js.

Scott
Scott

it's not really made to do this... but you could wrap your layout between spaceless tags

{% spaceless %}
    <html>
        <!-- page stuff... -->
    </html>
{% endspaceless %}

But keep in mind this won't be true minification, this would just remove the whitespace between tags. So for example

<div>
    <p>
        Hello world
    </p>
</div>

Would be compressed to

<div><p>Hello world</p></div>

Whereas something like...

<div>
    <img
        src="/whatever.jpg"
        alt="Some image">
</div>

would be compressed to

<div><img
        src="/whatever.jpg"
        alt="Some image"></div>

Last updated

miller
dazmiller8556
miller
miller

That's definitely a better solution. I'll try it tomorrow.

patos
patos

Hi, Any idea where to paste the Laravel trick in a running app ?

BG78
BG78

patos said:

Hi, Any idea where to paste the Laravel trick in a running app ?

I know, it's an old post. But has anyone an idea where to place?

Cryden
Cryden
LukeTowers

1-10 of 10