I would like to add a custom logo in the navbar title field section. I tried adding an html script and it worked, but the logo image did not fit inside the navbar kindly — the logo was pushed off by margins, and the menu texts overlapped the logo, etc.
name: "my-website"
output_dir: .
navbar:
title: "I want to add custom logo here"
left:
- text: "Home"
To align the navbar logo to the left of the screen with the Bootstrap method is a quick trick that can save you from writing extra CSS. In this, we simply add another div tag above the div tag having class navbar navbar-expand-lg navbar-light bg-light fixed-top py-lg-0.
You can specify that on the YAML. For example, if using flexdashboard:
---
title: "My Website"
output:
flexdashboard::flex_dashboard:
theme: flatly
logo: LOGO.png
---
Note that no scaling is performed on the logo image, so it should fit exactly within the dimensions of the navigation bar (48 pixels high for the default "cosmo" theme, other themes may have slightly different navigation bar heights).
Well I fiddled me a site myself. This is working for me:
name: "my-website"
navbar:
title: "<img id=\"logo\" style=\"width: 30px;\" src=\"dog.gif\" />"
left:
- text: "Home"
href: index.html
- text: "About"
href: about.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With