I have a knitr program that renders to html in a browser page. Id like to put a favicon .png image in the browser tab that the output opens up to.
I have seen answers for this with shiny, but not standalone knitr
Favicon in Shiny
In order to get a favicon, you have to insert the following HTML
element in the <head>
element of the rendered document:
<link rel="shortcut icon" href="link_to_your_favicon.png">
There are many methods to achieve this goal.
I recommend to use the includes
option.
For instance, save the following line in a file named favicon.html
:
<link rel="shortcut icon" href="https://www.r-project.org/favicon-32x32.png">
If you render the following Rmd
document, you will get a HTML
file with the R project's favicon:
---
title: "Favicon"
output:
html_document:
includes:
in_header: "favicon.html"
---
A document with a favicon
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