You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 6, 2018. It is now read-only.
There is a glitch here in the sequence of events that causes site text compression when used as-is.
If done properly then there is no need for ruby to cleanup the extra spaces but as-is, we are taking out potential br and paragraph codes as a preprocessor, when in post these would be just extra spaces in the html output. I have a ruby script that removes those and cleans up the html. It doesnt minify however.
--
desc "cleans up empty lines"
task :cleanup do
Dir['_site/**/*.html'].each do |file|
file_to_strip = IO.readlines(file)
fout = File.open("temp.html", "w")
in_code_block = false
file_to_strip.each do |line|
if line.include?("") or line.include?("
")
in_code_block = true
end
if (not in_code_block and not line.strip.empty?) or in_code_block
fout << line
end
if line.include?("") or line.include?("
")
in_code_block = false
end
end
fout.close
File.rename("temp.html", file)
end
end
The text was updated successfully, but these errors were encountered:
There is a glitch here in the sequence of events that causes site text compression when used as-is.
If done properly then there is no need for ruby to cleanup the extra spaces but as-is, we are taking out potential br and paragraph codes as a preprocessor, when in post these would be just extra spaces in the html output. I have a ruby script that removes those and cleans up the html. It doesnt minify however.
--
desc "cleans up empty lines"
task :cleanup do
Dir['_site/**/*.html'].each do |file|
file_to_strip = IO.readlines(file)
fout = File.open("temp.html", "w")
in_code_block = false
file_to_strip.each do |line|
if line.include?("
") or line.include?("
in_code_block = false
end
end
fout.close
File.rename("temp.html", file)
end
end
The text was updated successfully, but these errors were encountered: