How to keep ASCII art in the source while using --minify?

Hi @royston, I’m necro’ing this thread. :smile: I can’t seem to configure minify in my config.toml so that when I run hugo --minify, this ascii art doesn’t get stripped out. Do you have any ideas or experience?

I’m working from this page: Configure Hugo | Hugo

Hello @robert-jelenic

You could configure Hugo’s inbuilt minification to keep HTML comments and then wrap the ACII art within a comment.

If the minification config does not work for you then provide a sample repo so that people in the forum can reproduce the issue.

The inspiration for this workaround comes from the Cloudflare forums.

P.S. I moved your question to a new topic as the other one is quite old.

1 Like