Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I include meta tags in my R Shiny app?

Tags:

r

shiny

html-meta

I tried adding the following, but the published app doesn't seem to include my meta tags. The source code shows that the stuff inside of the head tags appears to be default content. I'd like to make my app searchable.

tags$head(
  tags$meta(charset="UTF-8"),
  tags$meta(name="description", content="..."),
  tags$meta(name="keywords", content="..."),
  tags$meta(name="viewport", content="width=device-width, initial-scale=1.0")
)

ui<-fluidPage(...)
like image 764
julio Avatar asked Oct 17 '25 15:10

julio


1 Answers

Just make sure you include the meta tags in the fluidPage object. Shiny will pull out all the tags in the head to the appropriate place.

ui<-fluidPage(
  tags$head(
    tags$meta(charset="UTF-8"),
    tags$meta(name="description", content="..."),
    tags$meta(name="keywords", content="..."),
    tags$meta(name="viewport", content="width=device-width, initial-scale=1.0")
  ), ...)
like image 145
MrFlick Avatar answered Oct 19 '25 04:10

MrFlick



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!