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

Source Inspection reveals too many generated white spaces. #14

Open
nitanmarcel opened this issue Feb 2, 2021 · 8 comments
Open

Source Inspection reveals too many generated white spaces. #14

nitanmarcel opened this issue Feb 2, 2021 · 8 comments
Labels
help wanted Extra attention is needed

Comments

@nitanmarcel
Copy link
Contributor

Hi! After I published my site a friend of mine did a source inspection which revealed that the generated code has too many sources included.

Browning on the internet I've found a fix by replacing all {{% with {{%-.

Yet even after this, there's a big blank space at the end of the main page source code I have no idea how to fix.

Any ideas?

Source before my changes:

IMG_20210202_112000_267

@nitanmarcel nitanmarcel changed the title Spurce Inspection reveals too many generated spaces. Source Inspection reveals too many generated white spaces. Feb 2, 2021
@nitanmarcel
Copy link
Contributor Author

Completely fixed all the problems with the generated code thanks to https://github.com/apsislabs/jekyll-tidy

@riggraz
Copy link
Owner

riggraz commented Feb 4, 2021

Hi nitanmarcel!

Actually I believe that version 0.4.0 fixes this whitespace problem. See this commit. In fact, I don't encounter this problem on my blog which is updated to version 0.4.0 of no-style-please.

Anyway I'm glad that you found a workaround in the meanwhile. If you decide to update the theme, let me know if it fixes the problem!

@nitanmarcel
Copy link
Contributor Author

Oh. I was making a PR. Those places are not the only places where the tags need to be replaced. I'll finish the PR and you could look at it ^^

@nitanmarcel
Copy link
Contributor Author

@riggraz done the PR, I would be happy if you could check it ^^

@riggraz
Copy link
Owner

riggraz commented Feb 4, 2021

Actually I was looking at my blog through "Inspect element" and didn't notice the whitespaces there. With "View page source", however, they're visible.

I'll take a look at your PR in the next days. Anyway, thanks a lot for taking the time to contribute!

@riggraz
Copy link
Owner

riggraz commented Mar 5, 2021

PR #15, which removes some whitespaces, was merged today. However there are still some whitespaces here and there, so I'll keep this issue open if someone wants to work on it.

I remember that it'd be cool to remove whitespaces without using any third party dependency like jekyll-tidy, since this theme strives to remain as lightweight as possible!

@riggraz riggraz added the help wanted Extra attention is needed label Mar 5, 2021
@nitanmarcel
Copy link
Contributor Author

@riggraz just had an idea. This would work only with gh-pages tho, and if user want to host this locally will have to do these manually.

There are libraries with command lines interfaces which can minify the generated html. What about creating a GitHub workflow to do such thing?

I've also found something on stackoverflow but I'm not so sure if it will break something or not.

https://stackoverflow.com/a/25803493/12420972

@riggraz
Copy link
Owner

riggraz commented Mar 17, 2021

There are libraries with command lines interfaces which can minify the generated html. What about creating a GitHub workflow to do such thing?

To be honest I think it'd be a little overkill, but thanks anyway for the suggestion.

I've also found something on stackoverflow but I'm not so sure if it will break something or not.

This is pretty interesting and may fix the problem without adding dependencies. I'm not sure if it works so it should be tested. If you want to work on it let me know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants