Closed olivroy closed 7 months ago
Thank you @olivroy !!
Could extra requests:
@schloerke Would you want me to delete the old docs directory, or leaving it as docs_old/
is okay for now?
@schloerke Would you want me to delete the old docs directory, or leaving it as
docs_old/
is okay for now?
The geojson files in docs_old/json
need to be available to the files. Maybe we put the data files in the pkgdown/assets
folder and add the assets folder in the pkgdown config? (And also move the _pkgdown.yml
file to pkgdown/_pkgdown.yml
, similar to https://github.com/rstudio/plumber/blob/56a69494cf15c3c3ca0831a86a91ba033337206a/pkgdown/_pkgdown.yml#L9 )
By having the files as assets, they are available on the website and users can see the full url. In the past, we've had comments that the files do not exist on user's local machines when copying the example to run. So I'd like to keep the URL behavior if possible.
I do not see any other files that I would keep in docs_old/
. Let's remove it? Thank you!
Two comments then I think we're good to go!
Can we move the json files in pkgdown/assets/FILE
to pkgdown/assets/json/FILE
? This will keep the existing urls like https://rstudio.github.io/leaflet/json/us-states.geojson working.
We need to add redirect HTML files from the previous vignette locations to the new locations. In addition, I'd like to maintain the hash being used. (**working on getting an example file / instructions)
We should add files with the content of: (untested)
<!DOCTYPE html>
<html>
<body>
<h1>VIGTITLE</h1>
Please find the article at its <a href="articles/ARTICLE">new location</a>
<script>
window.location.href = "articles/ARTICLE" + window.location.hash;
</script>
</body>
</html>
Where VIGTITLE
is the article title and ARTICLE
is the file name.
Within pkgdown/assets
, we need an HTML redirect file (named ARTICLE
) for every past article (except for ./
):
ARTICLE
- VIGTITLE
:
map_widget.html
- The Map Widget
basemaps.html
- Basemaps
markers.html
- Markers
popups.html
- Popups and Labels
shapes.html
- Lines and Shapes
json.html
- GeoJSON and TopoJSON
raster.html
- Raster Images
shiny.html
- Shiny Integration
colors.html
- Colors
legends.html
- Legends
showhide.html
- Show/Hide Layers
choropleths.html
- Choropleths
projections.html
- Projections
morefeatures.html
- Additional Features
I tested the pkgdown approach for redirects locally, but ideally, we'd overwrite the site now, and move to dev mode later? I tested this with servr locally, and changed the URL manually in my browser, and it works well!
https://pkgdown.r-lib.org/reference/build_site.html#redirects
Yes! (TIL, again!)
The previous website didn't really have headers to click on to set the hash. So the pkgdown redirects will work great. Thank you
Thank you @olivroy !
Thanks for the prompt review! (I would have forgotten the redirects !)
I will send a follow-up early next week to address outstanding issues! And will test outstanding issues, reorder vignettes etc. maybe use the json approach and move other shapefiles / resources to pkgdown/assets
to read from the website as much as possible, add back the copywright license in the bottom. The "leaflet" R package is copyright © 2014-2023 Posit Software, PBC.
The Leaflet JavaScript library is © 2010–2023 Vladimir Agafonkin, 2010–2011 CloudMade.
Maps © OpenStreetMap contributors unless otherwise noted.
to make the reproducibility of examples easier to do for users. internal links in the articles. ( I didn't want to read all the content in the context of this PR)
( I didn't want to read the content in the context of this PR)
I appreciate it.
I look forward to the followup next week. I'll try to have the PR merged (**waiting on team approval) later today.
Thank you @olivroy !!
Now hosted at https://rstudio.github.io/leaflet
I think some of the information is a bit dated, but will not pursue further if there is no interest.
For deployment, you need to setup gh pages with
usethis::use_pkgdown_github_pages()
.Everything renders! Polishing probably necessary in a potential follow-up
But having the function reference online, search function seems like an improvement to me?
Outstanding work if you decide to proceed:
On my side:
docs/
that is worth saving somewhere else?On your side:
usethis::use_pkgdown_github_pages()