Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify Vignette source URLs #2336

Closed
tony-aw opened this issue Aug 18, 2023 · 9 comments
Closed

Specify Vignette source URLs #2336

tony-aw opened this issue Aug 18, 2023 · 9 comments

Comments

@tony-aw
Copy link

tony-aw commented Aug 18, 2023

Hi,

Maybe I'm being stupid, but the URLs to vignette source codes is incorrect in pkgdown.

For example, for an article in pkgdown, it gives the following URL for the source vignette:
.../blob/vignettes/web_only/e_import_pkgs.Rmd
But the actual URL is:
.../blob/main/vignettes/web_only/e_import_pkgs.Rmd

Notice that pkgdown seems to forget to add "/main/" to the URL. Is there an option somewhere in pkgdown to fix this, or to tell pkgdown where the correct location of the vignettes are?

Thank you in advance.

Kind regards,

Tony

@dmurdoch
Copy link
Contributor

dmurdoch commented Aug 18, 2023

The links work for me, for example https://dmurdoch.github.io/rgl/articles/deprecation.html has a source link to https://github.com/dmurdoch/rgl/blob/HEAD/vignettes/deprecation.Rmd. That one was built a few weeks ago by pkgdown 2.0.7; is this a recent change? 2.0.7 is still the current version on CRAN.

@tony-aw
Copy link
Author

tony-aw commented Aug 18, 2023

Yes, that's strange. Why is it head with your GitHub page, and main with my GitHub page?

The links work for me, for example https://dmurdoch.github.io/rgl/articles/deprecation.html has a source link to https://github.com/dmurdoch/rgl/blob/HEAD/vignettes/deprecation.Rmd. That one was built a few weeks ago by pkgdown 2.0.7; is this a recent change? 2.0.7 is still the current version on CRAN.

@tony-aw
Copy link
Author

tony-aw commented Aug 18, 2023

I also use pkgdown version 2.0.7 btw

@dmurdoch
Copy link
Contributor

My vignettes are in the vignettes directory. Yours (if your package is https://github.com/tony-aw/tinyoperations/) are in vignettes/web_only. That web_only subdirectory is non-standard. I don't know if it's a pkgdown invention or yours, but it may be what's causing your problems.

@tony-aw
Copy link
Author

tony-aw commented Aug 18, 2023

The "web_only" additional is actually suggested in the pkgdown website itself, in case you want the articles to be present on the webpage, but not in the R package itself.
See https://pkgdown.r-lib.org/articles/pkgdown.html#articles

However, I can try moving the vignettes directly to the vignettes folder without "web_only" in between, and see if that fixes it.
I will let you know shortly if that fixes the issue.

@tony-aw
Copy link
Author

tony-aw commented Aug 18, 2023

OK, I moved all vignettes to folder vignettes (instead of vignettes/web_only), re-run the pkgdown site build, and let GitHub re-create the website.
The problem is similar as before:
The given URL on the pkgdown site is: https://github.com/tony-aw/tinyoperations/blob/vignettes/e_import_pkgs.Rmd
But the actually correct URL is: https://github.com/tony-aw/tinyoperations/blob/main/vignettes/e_import_pkgs.Rmd

So, as before, the "/main/" part is missing from the pkgdown URL, thus leading to the "404" page.
So "web_only" was not the cause.
Do you know what else could cause this issue?

Thanks in advance.

@maelle
Copy link
Collaborator

maelle commented Aug 24, 2023

@tony-aw to get "web only" vignettes, they have to be in the vignettes/articles folder.

How do you build the website? Do you build it from inside the package folder?

Another question: in the vignettes/ folder you have Markdown and HTML files, why is it so? Were you trying to pre-compute vignettes?

@tony-aw
Copy link
Author

tony-aw commented Aug 24, 2023

Hi,

I build the website from my pc; pkgdown then automatically creates a "docs" folder inside my package folder. I then bring the whole docs folder to my repository on github.

I usually run all vignettes just to check if they run without issues. That's why there are both markdown and html files there. But that shouldn't, I think, pose a problem for pkgdown.

Kind regards,

Tony

@hadley
Copy link
Member

hadley commented Oct 30, 2023

This doesn't seem to be a widespread problem (i.e. I double checked a few tidyverse sites and they all seemed to link to the source just fine), so unfortunately the problem is likely to be something specific to your site.

@hadley hadley closed this as completed Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants