Search code examples
rshinygolem

adding favicons in golem


the R documentation shows the code for adding a favicon to a shiny app developed with the golem package as:

golem::use_favicon(path="inst/app/www/favicon.ico", method = "curl")

My question: where do I insert this code? When running it in the console or within the 02_dev.R file, I receive the following message:

✔ favicon.ico created at /srv/shiny-server/modelCostOfOwnership/inst/app/www/favicon.ico
Favicon is automatically linked in app_ui via `golem_add_external_resources()`

I'd assume it is working. With the following code in the ui, the default golem favicon is gone, but the new favicon (replacing the original favicon.ico) is not appearing.

tags$head(tags$link(rel="shortcut icon", href="favicon.ico"))

Solution

  • The issue I had was saving the .ico file to the /www folder.
    keeping the .ico in a folder called /new_favicon and calling golem::use_favicon(path="new_favicon/favicon.ico", method = "curl") worked!