DocC Deep Linking Broken With Static Hosting?


I'm having issues with our site that is using static hosting. If I start at the root page I can navigate throughout the docs just fine. But if I try to load a deep link to a class or method, an empty white page is shown. The same thing will happen if I try to reload any page other than the root page. The following commands are used to build:

xcodebuild clean docbuild CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -scheme myScheme DOCC_OUTPUT_DIR=.

$(xcrun --find docc) process-archive transform-for-static-hosting .myFile.doccarchive --output-path ./docs --hosting-base-path my/path/

Here is a link to our API docs to see for yourself.

**Root Page That Loads Fine: ** Documentation

**Deep Link That Displays an Empty Page: **

If you click on MPIData from the root page, it will correctly display the same MPIData page I've linked to above.

I've seen this same behaviour in XCode 15.2 and 15.3 (not sure if it was happening with 15.1) Is this a DocC bug? Any thoughts on how I can resolve this?

Looks like it might have something to do with how your static hosting setup resolves directory URLs. /documentation/mappedin/mpidata loaded from scratch doesn't work for me, but /documentation/mappedin/mpidata/ (note the trailing slash) does. You'd want them both to resolve to the contents of /mpidata/index.html.

1 Like

Thanks a ton for spotting that! Now I know what needs fixing. :)