Does the new docsite allow `latest` links? We don'...
# development
w
Does the new docsite allow
latest
links? We don't want to always set a version for some links, where we just want whatever the newest version is - so we don't drop a user into 2.18 or whatever.
Also, to be clear, by "latest' I don't mean
main
- I mean latest stable release
c
in what context? the
doc_url
method gives you an URL for the "current" version
w
Oh, like if I want to link to https://pantsbuild.org/latest/blahblah
w
c
ah
w
I'm going through the example repos doing the same change, but they'll be "stale" in a few weeks (e.g. you link to the site, and it'll say the docs are out of date)
c
to that Idk 🤷
👍 1
w
Maybe @bitter-ability-32190 or @broad-processor-92400 have some ideas - as there are a bunch of tickets and maybe @happy-kitchen-89482 might know something? Like can we set an auto-redirect like these? https://github.com/pantsbuild/pantsbuild.org/pull/156/files I've never used docusaurus, so a bit out of my depth at the moment
Note: not the end of the world, as it's a link to the latest - but 🤷
f
Where / how is the doc site hosted? Can we just set some 3xx redirects somewhere?
b
Anything is possible (-ish) but what I worry about
latest
is if it goes stale. We had a few of those dead links because we renamed. It's probably OK though
f
Can the redirects just be configured in the repo alongside the markdown content?
Then they wouldn't go stale because we could just update them as source code.
w
We had a few of those dead links because we renamed.
I agree, but wouldn't this also be the case if we link to old docs, and then click the "see the latest version"? Because there is no latest version for said URL?
Note: Docusaurus itself is kinda doing what I'm suggesting, but instead of a
latest
style version, they just remove the version
b
Can the redirects just be configured in the repo alongside the markdown content?
Yes thats possible, we have a few already
p
I ran into this recently as well. I'm still using some pre-docusaurus links so that I don't need to include the version. I ended up just dropping other docs links because I don't want to maintain them (update the link version whenever I update the version in pants.toml). These links are typically comments in pants.toml or BUILD files to explain an unusual or advanced feature I'm using.
b
(Small catch with the pre-docusaurus redirects: those will always go to the 2.18 versions, which was the latest version at the time of migration.)
😢 1
I've recorded this feature request into https://github.com/pantsbuild/pantsbuild.org/issues/221