Closed fegue closed 1 year ago
I don't think you need the "www" prefix on your image paths. Everything in "www" is accessible from the root path.
Just contributing with my experience. In my custom_sign_in_ui_page I too have images displayed correctly and as @merlinoa said, I also omit www in the picture path as that's already accessible from the app.
I followed your suggestion and removed the 'www' prefix. Then the logos won't be displayed anymore. The way the images are referenced is the default and the recommended golem way.
add_resource_path(
"www",
app_sys("app/www")
)
But the problem is not that the images never show up. The problem is that the logos don't appear when visiting the page the first time. And this problem only occurs when the app is deployed.
I do not feel comfortable making guesses here, but could the problem have something to do with caching the images but not having access on the first Log-In?
Just contributing with my experience. In my custom_sign_in_ui_page I too have images displayed correctly and as @merlinoa said, I also omit www in the picture path as that's already accessible from the app.
Do you use the golem package?
I do not normally use golem, but I just updated this example golem app using polished to work with a custom sign in page a custom image: https://github.com/Tychobra/polished_example_apps/blob/master/08_golem_app/R/run_app.R
Going to close this out since it should be possible by following the example app linked above. Feel free to reopen if you are still having issues.
This is fixing it for me!
The path www/app
now gets added as a resource both in app_ui.R
and run_app.R
.
This doesn't feel optimal but it works.
Thank you for your help!
I use polished in a Shiny app developed with the golem package. The function
sign_in_ui_default()
is configured inrun_app.R
. The images are stored ininst/app/www
and the path is added to the app viaadd_resource_path()
.The app is deployed on shinyapps.io. When visiting the page the first time, the alt text is displayed instead of the logos. This happens independent of the browser. After logging out again, the logos are being displayed. After that the logos get displayed but only for some time. After a while (maybe after reboot?) the logos disappear again.
Is this a bug or am I doing something wrong?
Here is the code in
run_app.R
Thank you for the help!