DocC for private github repos

Hello! I have successfully followed these instructions for publishing some documentation to a public repo of mine.

Now, I am trying to apply the same process to a private repo for my company and I am running in to some issues. When I open the page it is blank white. When I open Safari's inspector, I see the following errors:

I temporarily made the page public which resolved the errors and it started to load successfully.

I have tried playing around with different values of --hosting-base-path. In addition to the repo's name, I have tried using the wonky hostname GitHub gives me and a few similar combinations. Is there anything in particular I am missing? Or maybe the generate-documentation tool is just not compatible with private repos yet?

1 Like

I'm not aware of anything that would make the tool incompatible with private repos.

The one thing to watch out for might be that the URL of the actual site may change depending on if the repository is private or public. Github states:

If you publish your site privately, the URL for your site will be different.

So, you may need to either modify or remove the --hosting-base-path argument to accommodate the expected URL for the private repo. It wouldn't be needed at all if the private URL does not contain a path with the repo name like it does for public ones as an example.

Thank you! Removing --hosting-base-path did the trick!

1 Like

I think the instructions in the docs could benefit from some clarification on setting things up for private repos. @ethankusters I know you prepared this documentation, is there a repository where we can contribute to it?

I agree! Some clarification around this would be great. The documentation is a part of the Swift-DocC Plugin repo itself.

Here's the specific path to the GitHub pages documentation: https://github.com/apple/swift-docc-plugin/blob/main/Sources/SwiftDocCPluginDocumentation/SwiftDocCPlugin.docc/Publishing%20to%20GitHub%20Pages.md

A PR is, of course, welcome. But if you'd prefer to file a bug on bugs.swift.org (using the Swift-DocC component), I'm also happy to make this change.