-
Notifications
You must be signed in to change notification settings - Fork 102
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
feat: Minify html,css,js #854
Conversation
Thanks for doing this! Looks like something needs to be resolved with the tests. I see there are three commits. Were these written for being preserved or would you want me to squash the PR? As for the
... I guess I got interrupted in the middle of that work. Don't worry about it. I am taking a break from cobalt to wrap up another project so I can focus on it but after that, I'm working on a re-architecting of cobalt to make it easier to add features. |
src/document.rs
Outdated
|
||
#[cfg(feature = "html-minifier")] | ||
fn minify_if_enabled(html: String, context: &RenderContex) -> Result<String> { | ||
if context.minify.html { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might render other types of data than html
Ideas:
- Limit this it
.html
extension - Switch control for this over to the frontmatter. We'd then move the other minification options to be under
assets
in the config. - Leave it as-is for now, see how it works out, and explore changing it later
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, yes i will try to add a double check that the final asset is actually an html file.
Sorry I didn't notice these two questions before; it was when writing up a description for this that I double checked how things worked and had these questions. |
Hi, I fixed the issue i had in the tests, but the run keep failing on something that do not seems related to my changes: https://dev.azure.com/cobalt-org/cobalt-org/_build/results?buildId=749&view=logs&j=50044035-f94f-5642-804a-a0db99902e68&t=ab898a7a-9071-5c69-f447-a57931fa134d For the commit, when I completed the rest i think is OK to squash them in a single commit |
The failure looks like an issue in syntect. I've opened trishume/syntect#334 |
Thanks for the work on this! Do you need me to cut a release for you? |
Hi, Have a good day. |
Minification is disabled by default, for backward and text compatibility. This can be changed on an extension-by-extension basis.
This doesn't touch the unused config crate.