Index.html is blank for static hosting

Hi, I'm generate the static hosting version of my DocC documentation like this:

swift run docc process-archive transform-for-static-hosting ../docbuild/Build/Products/Debug-iphonesimulator/MyPackage.doccarchive --output-path ../web

This works, however the index.html file at the root of the generated website is always blank. Why is this? The documentation is accessible via the path documentation/mypackage but I'd like it to be visible when you visit the root address of the website. Is this a feature or a bug? :sweat_smile:

1 Like

AFAIU, this is expected, as it lets you publish the docs as part of a larger website. As part of the generation process for the ArgumentParser docs, I copy in a file to add a redirect from that root directory to the documentation root (feedback welcome):

That said, it would be great if there was an option to either publish directly to the website root or automatically redirect!

1 Like

Haha we've done the same with the redirect. Good to know, I thought I was going mad!

@yusuf if you'd like to file a bug on bugs.swift.org for this, I can definitely imagine adding a flag to docc convert that adds a redirect file on an opt-in basis. Seems like this is a common use case we should better support.

5 Likes