-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Configuration option to remove consecutive whitespace without outputting all on one line #57
Comments
You can disable compression entirely during production in your compress_html:
ignore:
envs: [local] and the If you want to have what you suggested in production, @penibelst will answer that. |
For all intents and purposes, this disables the compression entirely - I'm looking for a middle ground where repeated newlines are removed, but not all newlines. |
I've almost got a working version (Bug with pres I'm working on now) - here are the outputs I'd appreciate build instructions - a quick google turned up nothing and knitting the file together by hand is murder :( Site output default<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Compress HTML in Jekyll</title>
<link rel="stylesheet" href="/ui/app.css">
<link rel="icon" href="/ui/img/favicon-1.png">
<link rel="prefetch" href="https://github.com/penibelst/jekyll-compress-html">
<link rel="prerender" href="https://github.com/penibelst/jekyll-compress-html">
</head> Site output jekyll-compress-html<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Compress HTML in Jekyll</title> <link rel="stylesheet" href="/ui/app.css"> <link rel="icon" href="/ui/img/favicon-1.png"> <link rel="prefetch" href="https://github.com/penibelst/jekyll-compress-html"> <link rel="prerender" href="https://github.com/penibelst/jekyll-compress-html"> </head> Site output jekyll-compress-html with my patches and the config var on<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Compress HTML in Jekyll</title>
<link rel="stylesheet" href="/ui/app.css">
<link rel="icon" href="/ui/img/favicon-1.png">
<link rel="prefetch" href="https://github.com/penibelst/jekyll-compress-html">
<link rel="prerender" href="https://github.com/penibelst/jekyll-compress-html">
</head> |
@jnvsor Nice to see you start an implementation. Feel free to make a PR, so I can assist you. |
I had to move the comment stripping before the whitespace stripping or it would leave in empty lines that had comments. As a result the I intend to fix that last bug and write a test for human readable mode before submitting a PR PS: I keep running into a build error where it seems to double the last part of the file:
Any ideas? |
I'd love to have it implemented. Why not? |
It's been implemented since december: See blanklines |
jnvsor, thanks. But how do I enable ONLY this option? |
I would prefer my outputted source code to be somewhat easy to read. jekyll-compress-html is hard to read on one line, and jekyll itself is hard to read with dozens of lines of whitespace in between lines.
Could you please add a configuration option that would remove empty lines, but not all whitespace?
Something along the lines of:
The text was updated successfully, but these errors were encountered: