Add a logo to the HTML template
The logo is placed at the top of the navication sidebar.
This commit is contained in:
parent
a5ec0dac1c
commit
b391d933ef
|
@ -603,6 +603,10 @@ fn make_data(
|
|||
"description".to_owned(),
|
||||
json!(config.book.description.clone().unwrap_or_default()),
|
||||
);
|
||||
data.insert(
|
||||
"book_logo".to_owned(),
|
||||
json!(config.book.logo.clone().unwrap_or_default()),
|
||||
);
|
||||
if theme.favicon_png.is_some() {
|
||||
data.insert("favicon_png".to_owned(), json!("favicon.png"));
|
||||
}
|
||||
|
|
|
@ -344,6 +344,13 @@ ul#searchresults span.teaser em {
|
|||
right: 0;
|
||||
padding: 10px 10px;
|
||||
}
|
||||
.sidebar .sidebar-scrollbox .sidebar-book-logo img {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
width: 100%;
|
||||
max-width: max-content;
|
||||
}
|
||||
.sidebar .sidebar-resize-handle {
|
||||
position: absolute;
|
||||
cursor: col-resize;
|
||||
|
|
|
@ -103,6 +103,11 @@
|
|||
|
||||
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
|
||||
<div class="sidebar-scrollbox">
|
||||
{{#if book_logo }}
|
||||
<div class="sidebar-book-logo">
|
||||
<img src="{{ book_logo }}">
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#toc}}{{/toc}}
|
||||
</div>
|
||||
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
|
||||
|
|
Loading…
Reference in New Issue