You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BUT in a site in dev status (i.e., pkgdown), site.root is an empty string. I think it should actually be /dev/ or dev/.
Here's the relevant bit of pkgdown::data_template() run on current pkgdown:
site:
root: ''title: pkgdown
So what ends up happening on a dev site is that the site is copied to /dev, but the href values in the site head don't have the /dev/ prefix.
I am guessing this has gone unnoticed because most packages start with a release version, where everything (assets and site) is copied to /. Then, in a subsequent dev version, the site contents are copied to /dev, but the assets are still in /, so the head href links still work, but they're using the assets from the released site in /.
This is also why the favicon checker is failing in #2804. The head of the deployed site has:
In trying to fix #2804, I think I uncovered a different issue. It doesn't look like the site root path is set correctly for packages in dev status.
The paths to the head assets (favicon, JS, CSS) in the template are specified like this:
pkgdown/inst/BS5/templates/head.html
Line 8 in c40ba2c
BUT in a site in dev status (i.e., pkgdown),
site.root
is an empty string. I think it should actually be/dev/
ordev/
.Here's the relevant bit of
pkgdown::data_template()
run on current pkgdown:So what ends up happening on a dev site is that the site is copied to
/dev
, but the href values in the site head don't have the/dev/
prefix.I am guessing this has gone unnoticed because most packages start with a release version, where everything (assets and site) is copied to
/
. Then, in a subsequent dev version, the site contents are copied to/dev
, but the assets are still in/
, so the head href links still work, but they're using the assets from the released site in/
.This is also why the favicon checker is failing in #2804. The head of the deployed site has:
but the file is actually in
/dev/favicon.svg
(correct link). And the deployed site only has the stuff in/dev
and can't rely on anything in/
.You can also see this in the dev pkgdown site. It's head has the following, so is using the favicon assets from the released site:
I think the fix is to make
site.root
mirrorpkg$development$prefix
(but with a leading slash, so/dev/
instead ofdev/
)The text was updated successfully, but these errors were encountered: