Hi @cole ,
I wasn't sure if I should use the RMarkdown label or the Shiny Server label for this topic. Let me know if you think that I should update it.
To answer your first question, yes, this works as expected when using the shiny runtime.
Unfortunately, I cannot share the code for the project I am working on, but I have created a repo containing two versions of a basic, demonstrative example: one using the shiny runtime, and one using the shiny-prerendered runtime.
I have also done my best to describe what I am trying to accomplish. What I describe hereafter can be seen either by opening one of the Rmd files in RStudio and clicking "Run Document" to trigger the start of a Shiny Server, or by copying the shiny_runtime and shiny_prerendered_runtime directories to an existing, deployed Shiny Server and navigating to the server in a browser.
Consider the simple website created in the repo linked to above, which consists of the following files:
./shiny_runtime[_prerendered]
├── _site.yml
├── index.Rmd
├── inputs_and_outputs.Rmd
└── mpg.Rmd
As can be seen in _site.yml, page navigation occurs using a navbar, in which the href of the individual menu items target the associated Rmd files.
When using the shiny runtime, the website functions as expected. That is, clicking on a menu item in the navbar will cause the URL to update to http://<shiny-server>/<targeted-file>.Rmd, and the page to render.
However, when using the shiny-prerendered runtime, the website ceases functioning. That is, clicking on a menu item in the navbar will still cause the URL to update to http://<shiny-server>/<targeted-file>.Rmd, but instead of rendering the new page, the index.Rmd page will simply be refreshed. The same behavior occurs if the URL is manually entered, even without having first visited index.Rmd. I assume this is because of the way Shiny Server handles RMarkdown files; that is,
If a hosted directory does not include a server.R file, Shiny Server will look to see if it contains any .Rmd files. If so, Shiny Server will host that directory in "R Markdown" mode using rmarkdown::run .
Since rmarkdown::run() targets index.Rmd by default, this is the page that will remain displayed no matter which Rmd file is targeted in the URL.
Note that, in the example using the shiny_prerendered runtime, updating _site.yml to target the html files produced, instead of the Rmd files, does not affect the incorrect behavior in any way.