Uh oh!
There was an error while loading. Please reload this page.
ARROW-14338: [Docs] Add version dropdown to the pkgdown (R) docs - #12172
ARROW-14338: [Docs] Add version dropdown to the pkgdown (R) docs#12172thisisnic wants to merge 13 commits into
Conversation
82f5c77 to
e219f6dCompareUh oh!
There was an error while loading. Please reload this page.
jorisvandenbossche
commented
Jan 19, 2022
Cool! The screenshot looks good. I don't have time to test it right now, but if it is working for you locally, I trust that, and I would merge it and then we can still see how it works in the hosted dev docs
Well, thanks to the person that implemented it in the pydata-sphinx-theme, as I just copied it from there :) |
kszucs
commented
Jan 19, 2022
Including to 7.0. |
jorisvandenbossche
commented
Jan 19, 2022
One question though: where does this versions.json asset get included? (where does it get copied on the actual website) |
| } | ||
| // Load the versions JSON and construct the select items | ||
| $.getJSON("./versions.json", function( data ) { |
There was a problem hiding this comment.
The "./versions.json", is that a relative path to the current location? Because that might not work if you have sub-directories in the docs (like for the articles)
Or does that point to a "root" file? (in which case it would always be arrow.apache.org/versions.json once deployed, which might also not be correct?)
There was a problem hiding this comment.
Good catch; I guess it'd make the most sense to hard code it to point to the published version like this?
| $.getJSON("./versions.json",function(data){ | |
| $.getJSON("https://arrow.apache.org/docs/r/versions.json",function(data){ |
Or perhaps not if the docs are published somewhere else though. I guess I need to construct the URL...
There was a problem hiding this comment.
Yeah, this part is annoying to test with an absolute url before it's actually deployed .. :)
But, I think an absolute url is probably the easiest for now. I would maybe not put it in /docs/r/versions.json, as that is the stable docs location (it would get overwritten when doing a release and recreating the stable docs). Unless the file is not included in the actual arrow repo, and only in the arrow-site repo. Although I see now that I actually did the same for the sphinx site ... :)
There was a problem hiding this comment.
Just added another commit where I did it a little differently to construct a relative URL based on the fact that the only thing we know for sure is the structure that pkgdown has means that the final instance of /r/in the path will be where versions.json is hosted. I think it makes sense now!
There was a problem hiding this comment.
So does that mean that if you are on a page like https://arrow.apache.org/docs/5.0/r/articles/developing.html, that would point to https://arrow.apache.org/docs/5.0/r/versions.json? (taking the last /r, and appending versions.json)
Because then it still points to the versions.json of that version, and not the latest one (which can be updated)
There was a problem hiding this comment.
Argh, of course! Reverting to absolute URL...
kszucs
left a comment
There was a problem hiding this comment.
Thanks @thisisnic! Merging on green.
Benchmark runs are scheduled for baseline = ff4b9be and contender = 9938f70. 9938f70 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Implemented:
arrow/r/pkgdown/assets/versions.jsonSuggestion for testing without putting together a complex Docker script:
extra.jsversions.jsonfile is not deployed yet, replace./versions.jsonin line$.getJSON("./versions.json", function( data ) {withhttps://raw.githubusercontent.com/thisisnic/arrow/ARROW-14338_pkgdown_versioning/r/pkgdown/assets/versions.json