1
Fork 0

Wrap logo in container to prevent layout reflow

This commit is contained in:
Jakob Ståhl 2019-04-27 15:09:57 +02:00 committed by Guillaume Gomez
parent f998182fb4
commit 184e3a3f92
2 changed files with 9 additions and 2 deletions

View file

@ -182,14 +182,16 @@ pub fn render<T: fmt::Display, S: fmt::Display>(
let p = SlashChecker(&p);
if layout.logo.is_empty() {
format!("<a href='{path}index.html'>\
<div class='logo-container'>\
<img src='{static_root_path}rust-logo{suffix}.png' \
alt='logo' width='100'></a>",
alt='logo' width='100'></div></a>",
path=p,
static_root_path=static_root_path,
suffix=page.resource_suffix)
} else {
format!("<a href='{}index.html'>\
<img src='{}' alt='logo' width='100'></a>",
<div class='logo-container'>\
<img src='{}' alt='logo' width='100'></div></a>",
p,
layout.logo)
}