opendevstack / ods-documentation

Antora playbooks to generate the versioned documentation
0 stars 6 forks source link

Feature Request: provide a latest URL part next to 3.x, etc. #64

Closed metmajer closed 1 year ago

metmajer commented 3 years ago

When linking to the documentation of a specific Quickstarter or other documentation artefacts, it would be great to support a stable URL that always leads readers to the latest (currently active) version. Example:

https://www.opendevstack.org/ods-documentation/opendevstack/3.x/quickstarters/release-manager.html

vs.

https://www.opendevstack.org/ods-documentation/opendevstack/latest/quickstarters/release-manager.html

Why useful? We would like to link to these documents from other documentation. A potential solution mentioning jekyll-redirect-from is mentioned here: https://stackoverflow.com/questions/29390425/github-pages-url-rewrite-support

Thoughts @gerardcl @michaelsauter ?

gerardcl commented 3 years ago

hi! I have been also taking a look and maybe we can make this happen from antora level via https://docs.antora.org/antora/2.3/playbook/urls-redirect-facility/ which I think this is something we already use. Might need to take a closer look, but will wait for Michael's thoughts!

michaelsauter commented 3 years ago

Yes this would be helpful :)

We have a few pages which use https://docs.antora.org/antora/2.3/page/page-aliases/, e.g. https://raw.githubusercontent.com/opendevstack/ods-jenkins-shared-library/841a4f8cf6a48c765e192349ec403f676c44953a/docs/modules/jenkins-shared-library/pages/index.adoc. However, I can't figure the URL out at the moment. I'm a bit confused as I thought this worked in the past.

tbugfinder commented 2 years ago

Antora v3 can set latest for the latest version configured (e.g currently 3.x).

urls:
  latest_version_segment: latest
  latest_version_segment_strategy: redirect:to

The migration to Antora v3 requires some cleanup as it errors out on invalid xrefs which are around in all branches of all repos. Also, the latest page-aliases are set in master as well as 4.x which also errors out (Antora 3).

The 4.x release isn't part of the versioned docs and the master still uses "4.x preview". Is this the intended way forward? Should master provide "5.x preview" and all 4.x branches use "4.x" so that it can be added into the site generator? Do we have to maintain, meaning fix the invalid links in 1.x branches or drops those completely?

michaelsauter commented 2 years ago

Is this the intended way forward? Should master provide "5.x preview" and all 4.x branches use "4.x" so that it can be added into the site generator?

I would say yes

Do we have to maintain, meaning fix the invalid links in 1.x branches or drops those completely?

I would propose to drop

tbugfinder commented 2 years ago

I've created PRs to move to "5.x preview" and "4.x" instead of "4.x preview"

tbugfinder commented 2 years ago

URLs using latest are in place now.

https://github.com/opendevstack/ods-documentation/pull/69