[BUG] Header logo is cut on the sides
Closed this issue · 6 comments
Describe the bug 描述你遇到的错误
When using a svg
logo in the header, it gets cut on the sides.
Expected behavior 期待的行为
The logo is displayed correctly.
Bonus:
It would probably look nicer, if the logo is vertically aligned to the middle of the header text. Currently it's aligned on the bottom boundary it seems:
Comparing with the alignment of the menu items, it seems like the header text is positioned correctly, but the logo size is simply too large (36px).
Screenshots 屏幕截图
Build Environment 构建环境
- hugo v0.125.1-68c5ad638c2072969e47262926b912e80fd71a77+extended linux/amd64 on Docker
- latest DoIt commit
Preview Environment 预览环境
Firefox on Windows 11
Additional Information 补充信息
No response
The logo image is restricted to be a square to avoid layout shift
DoIt/layouts/partials/header.html
Line 8 in 0a0b127
Do you think it's better remove this restriction or use the capability to insert the image as raw HTML in this case?
The logo actually is quadratic and defines width="64" height="64"
in the source:
If I remove the size hint, the logo is no longer truncated at the left side, but still on the right:
For me it looks like the header text positioning is the actual problem and not the logo. In this screenshot you can see how the header text overlaps the logo:
You can as well see, that the header text (and the menu) is not fully centered on the vertical axis.
Hi @HEIGE-PCloud, thanks for trying to fix this 🙂
Try 36x36 or inlining the svg directly.
Ok it should now definitely be fixed. Sorry I missed your logo's svg file previously.
Thanks a lot! I can confirm that the latest fix solves the issue 🙂 I left a minor comment on the commit: de76eff#r142794099
Not sure if this would have unwanted side-effects, but in my particular case it seems to further improve the result.