1👍
Instead of mixing ListView
and DetailView
into one view (which would conceptually be a mess and difficult to maintain), I suggest designing all your views as if they were versioned and treating the unversioned ones as those with version 1
(or a similar unspecified version number).
In the unfederated websites, the URL /path/to/docs/<DOMAIN>/<SLUG>/
would behave the same as visiting /path/to/docs/<DOMAIN>/1/<SLUG>/
.
In the federated websites, the URL /path/to/docs/<DOMAIN>/<SLUG>/
would present a list of the available versions (as a ListView
).
You can implement the above behaviour with a view that does the following:
- Check how many versions there are available for this domain
- If there is only one, redirect to
/path/to/docs/<DOMAIN>/<LATEST_VERSION>/<SLUG>/
. - If there are multiple, display a list of the available versions and let the user choose which one to visit.
The unfederated websites would simply be websites that only have one version of the docs. If this changes in the future then you can easily turn them into versioned docs as well.