Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add custom logo in navbar title field in rmarkdown?

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"
like image 297
Jim O. Avatar asked May 26 '17 14:05

Jim O.


People also ask

How do I add a logo to the left navbar?

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.


2 Answers

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).

like image 75
Dan Avatar answered Oct 11 '22 23:10

Dan


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

enter image description here

like image 21
Martin Schmelzer Avatar answered Oct 11 '22 23:10

Martin Schmelzer