Judging by the documentation for hosting documentation archives essentially only one documentation archive can be hosted per host (out of the box).
Are there any approaches for hosting multiple (versions of) documentation archives on one host?
My particular use case would be to provide users access to older documentation versions.
However I imagine other projects may have several documentation archives which would make sense at a
doc.xyz/ProjectA address without needing to set up may subdomains.
Hosting multiple unique documentation archives together should be possible using the approach described on this Developer Forums post. Essentially, you’ll want to ensure that JSON requests for data are routed to the appropriate archive containing the right data based on the URL, and then you can share the assets of a single archive when it comes to requests for CSS/JSS/HTML.
Hosting multiple versions of an individual documentation archive together may be slightly trickier however (at least “out of the box”) because of the shared URL. You would need to introduce some differentiating aspect of the URLs that DocC generates to distinguish one version from another (which is does not do currently) for loading pages and linking between versions. This might be a good idea to create a feature request issue on Jira for future tracking purposes.
Thanks for the hints.
It seems to me that needing to do URL rewriting is perhaps a bit of a limitation and also prevents using entirely static/file-based hosting which could make DocC more attractive or simpler to use.
I've opened [SR-15541] Support hosting of multiple DocC archive(s) (versions) · Issue #204 · apple/swift-docc · GitHub and will keep an eye on this.