Repository navigation
Consider enabling whitespace trimming in the Jinja2 env #3309
kamilkrzyskow
started this conversation in
Ideas
Replies: 3 comments 2 replies
|
@oprypin Sorry for the mention, I just noticed that you're currently active. Could you please state your opinion on this matter? |
0 replies
This comment was marked as disruptive content.
This comment was marked as disruptive content.
|
I think it's safe if a theme enables the |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi 👋,
kind of a weird feature to ask for, I know, but I got the idea after looking at the default source code of our built documentation page. We're using the Material theme, and for our deployment we're using the
minifyplugin too.But many people don't do that, either because they don't think about this, or don't want to increase their build time with the plugin. So their pages waste network and processing time globally ❗
However, I checked and it's possible to enable simple trimming directly in the env.
Testing it with a hook:
mkdocs newwith the Material theme got reduced from 11,795 down to 10,539 characters, so roughly a 10% reduction.Our homepage, which uses different features of Material etc. got reduced from 83,975 down to 65,449 characters, so roughly a 20% reduction,
The issue lies of course in the Material theme's lack of whitespace management, but this seems like the less painful solution in general if MkDocs would enable this Jinja2 feature by default.
The build time didn't change for me with this setting enabled.
EDIT:
Or perhaps it would be possible to add it as an opt-in feature for the themes 🤔
All reactions