Jieiku / abridge

Fast & Lightweight Zola Theme
https://abridge.pages.dev/
MIT License
147 stars 41 forks source link

setting minify_html breaks page formatting on pages with numbered code blocks #84

Closed skewballfox closed 1 year ago

skewballfox commented 2 years ago

I'm not sure if this is a bug or not, but currently setting minify_html=true causes the table of contents to be rendered at the bottom of the post(after go to top) rather than the side.

Jieiku commented 2 years ago

Thanks for the report, Will try and reproduce this now.

EDIT: Was unable to reproduce this on a fresh git clone, so it is probably some combination of options that causes it.

Do you have a repo I can clone to reproduce this? Or perhaps you can share a redacted config.toml?

If you have not yet, try coping the config.toml from abridge into your root site, and only make a couple changes at a time between trying zola serve.

simbleau commented 2 years ago

Issue is getting stale. @skewballfox Are you still having issues?

skewballfox commented 2 years ago

yes, unless it's something specific to my system I'm pretty sure you can test this yourself.

git clone https://github.com/Jieiku/abridge
cd abridge
sed -i 's/minify_html = false/minify_html = true/g' config.toml
zola serve --port 1234

then navigate to the local copy of the code blocks entry, and you should see a missing Index box, which is now improperly renderered after the body of the post

simbleau commented 2 years ago

Thanks, will look into this.

Jieiku commented 2 years ago

@skewballfox Thanks! I just followed your example to the letter.

What Operating System, Browser, and resolution are you using?

here is Firefox:

2022-07-24_18-45-45

here is chrome:

2022-07-24_18-46-34

skewballfox commented 2 years ago

not quite, I'm talking about the page Code blocks and themes, not the index/list of post. I was using that specific post as an example, but the issue will be present for any post which has multiple headings

image here is the table of contents for that page rendered below the post when minified. it's correct when not minified though

I've used firefox and chrome on fedora 36, resolution should be 1080p

Jieiku commented 2 years ago

Perfect, I see the issue as well. This is a new issue, I am able to reproduce this and will figure out the cause.

With minify=true the rich content and image shortcodes pages do not have this issue, but the code blocks and markdown pages both do.

I definitely think it has to do with the code blocks, will keep investigating.

It actually looks like it is the numbered code blocks that are causing the problem, going to try removing them and see what happens.

EDIT: YEP! its the line numbered code blocks that cause this problem, now I just need to investigate if this is abridge specific or an issue with zola, if it turns out to be an issue with zola then I will open a bug report there and link to this issue.

Jieiku commented 2 years ago

I was able to reproduce this with another theme, so it does not appear to be abridge specific: https://github.com/Jieiku/zola-minify-test

Jieiku commented 1 year ago

Closing because it is unrelated to Abridge, for now I simply disabled the minify_html option.