In my flexdashboard, I would like to set the windows title (that is seen in the browser tab) dynamically.
The following mre works. But, when I change the params, I have to render the document two times to see the result in the windows title.
Is there a way to do it in one go? I tried cache=FALSE in the second chunk but that did not help.
---
title: 'Status: `r sprintf("%.0f%%", progress*100)`'
params:
current_page: 27
total_pages: 79
output:
flexdashboard::flex_dashboard: default
html_document: default
---
```{r global, include=FALSE}
library(bslib)
```
```{r, cache = FALSE}
progress <- with(params, current_page / total_pages)
bslib::value_box(title="Status", value=sprintf("%.0f%%", progress*100))
```