DocC home page or redirect to /documentation/<target-name>

I just set up my GitHub Actions pipeline to publish the static content generated by DocC to GitHub Pages. Unfortunately, the way DocC works means I must go to my GitHub Pages URL e.g. (<username>.github.io/<repo-name>) and then append a /documentation/<target-name> path to get where I want.

It's frustrating that the buttons GitHub's UI provides all link to <username>.github.io/<repo-name> and I have to keep appending DocC's path to view the documentation.

Is there a way to tell DocC there's just one target, and to show that at / instead of /documentation/<target-name>?

Or could the DocC team perhaps add a default generated home page with links to the various targets' documentation? Then it's not a blank page when navigating to the base GitHub Pages URL.

Thanks!

Answered by Documentation Engineer in 719538022

Is there a way to tell DocC there's just one target, and to show that at / instead of /documentation/?

Not at the moment.

As a workaround to get the behavior you desire, you could potentially replace the top level index.html file in the docs directory with the following so that this URL redirects to the right place:

<!DOCTYPE html>
<meta charset="utf-8">
<meta http-equiv="refresh" content="1; url=https://<username>.github.io/<repo-name>/documentation/<target-name>">
<script>
  window.location.href = "https://<username>.github.io/<repo-name>/documentation/<target-name>"
</script>
<title>Redirecting...</title>
If you are not redirected automatically, follow
<a href="https://<username>.github.io/<repo-name>/documentation/<target-name>">
  this link
</a>.

Although not ideal, that should ensure that the URL https://<username>.github.io/<repo-name>/ redirects to https://<username>.github.io/<repo-name>/documentation/<target-name>/.

Or could the DocC team perhaps add a default generated home page with links to the various targets' documentation? Then it's not a blank page when navigating to the base GitHub Pages URL.

There has been some initial discussion about this as a requested feature here.

Accepted Answer

Is there a way to tell DocC there's just one target, and to show that at / instead of /documentation/?

Not at the moment.

As a workaround to get the behavior you desire, you could potentially replace the top level index.html file in the docs directory with the following so that this URL redirects to the right place:

<!DOCTYPE html>
<meta charset="utf-8">
<meta http-equiv="refresh" content="1; url=https://<username>.github.io/<repo-name>/documentation/<target-name>">
<script>
  window.location.href = "https://<username>.github.io/<repo-name>/documentation/<target-name>"
</script>
<title>Redirecting...</title>
If you are not redirected automatically, follow
<a href="https://<username>.github.io/<repo-name>/documentation/<target-name>">
  this link
</a>.

Although not ideal, that should ensure that the URL https://<username>.github.io/<repo-name>/ redirects to https://<username>.github.io/<repo-name>/documentation/<target-name>/.

Or could the DocC team perhaps add a default generated home page with links to the various targets' documentation? Then it's not a blank page when navigating to the base GitHub Pages URL.

There has been some initial discussion about this as a requested feature here.

Will keep an eye on this thread. It would be helpful to

  • allow specifying custom sub path other than /documentation/
  • render correctly without --hosting-base-path being set to a specific sub path
DocC home page or redirect to /documentation/&lt;target-name&gt;
 
 
Q