Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added compress_options to sekizai postprocessor #1025

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

CaptainChaos
Copy link

@CaptainChaos CaptainChaos commented Nov 17, 2020

Hi guys,
after I cancelled my last PR (#1023) due to missing features, I now added an improved way to configure the sekizai postprocessor. Specifically, I missed a way to

  • compress custom-named blocks, since the old postprocessor only supported the names "js" and "css"
  • generate preload or inline compress blocks

My idea was that a sekizai block can now contain an html comment <!-- compress_options [params] -->, where [params] can be

  • one of "js" or "css"
  • one or multiple of "file", "preload" and "inline"

If the comment is missing, the behavior of the postprocessor doesn't change. This way, I can for example include <!-- compress_options css file preload --> in my css sekizai block (with {% addtoblock "css" %}), and the postprocessor generates a compressed file and also the correct preload link.

If I should change anything, let me know.

Best regards!

@CaptainChaos
Copy link
Author

I added a defer option for scripts, because sometimes this makes sense for page speed optimizations

@karyon
Copy link
Contributor

karyon commented Jan 1, 2021

Hi! sorry for the late reply. is this params-in-html-comments a thing in sekizai? if yes that's fine, otherwise it appears too hacky to me to include it. Unfortunately I don't know sekizai at all so I can't give any design recommendations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants