• Resolved angelseee

    (@angelseee)


    My site uses minify html code:

    <p>Example-1</p><p>Example-2</p><p>Example-3</p>

    Your plugin invalidates minify html code:

    <p>Example-1</p>
    <p>Example-2</p>
    <p>Example-3</p>

    How to make “Staatic” save minify html code?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Team Staatic

    (@staatic)

    Unfortunately Staatic is unable to retain the minified HTML code completely, since it alters the HTML code during the rewriting of URLs.

    However, you may have better results while using “Simple Html Dom Parser”, which can be configured in Staatic > Settings > Advanced. From our experience, this HTML DOM Parser leaves unchanged HTML mostly as-is.

    To ensure fully minified HTML code, the minification process should be applied after all pages have been processed by Staatic.

    Note that some CDN services have built in HTML (and CSS/JS) minification available, like Cloudflare and Netlify, which could make this very easy if available to you.

    Thread Starter angelseee

    (@angelseee)

    Thanks for the answer! Unfortunately, “Simple Html Dom Parser” keeps minification, but not completely ??

    Plugin Author Team Staatic

    (@staatic)

    We have created an example HTML minification plugin which uses voku HtmlMin under the hood, in order to minify any HTML resources processed by Staatic during the publication process. Feel free to modify the plugin as needed.

    Thread Starter angelseee

    (@angelseee)

    Thank you very much for your new wonderful plugin “Staatic HTML Minifier”! It perfectly complements the magical work of your main plugin “Staatic – Static Site Generator”!

    Thread Starter angelseee

    (@angelseee)

    Plugin “Staatic HTML Minifier” does not put these tags at the end of the html code of a static page:

    </body></html>

    Please, fix this bug!

    Plugin Author Team Staatic

    (@staatic)

    Plugin “Staatic HTML Minifier” does not put these tags at the end of the html code of a static page:
    </body></html>

    This is by design, since these tags are optional in HTML5. See also: https://html.spec.whatwg.org/multipage/syntax.html#syntax-tag-omission.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘“Staatic” & minify html code’ is closed to new replies.