Skip to content

Generated DocC documentation fails to load on GitHub Pages #106

@saadshams

Description

@saadshams

When hosting the generated documentation using GitHub Pages (via the /docs directory on the main branch), the documentation doesn't display correctly. The generated HTML file at docs/documentation/package-name/index.html throws a 404 error for theme-settings.json. This issue also occurs when opening the same files locally in the browser.

This may be due to path resolution issues in the generated HTML and asset references. The error prevents the documentation theme from loading and renders the page unusable.

This issue might not be new, but I haven't been able to confirm a previous working version yet.

Checklist

  • [ x] If possible, I've reproduced the issue using the main branch of this package.
  • [ x] This issue hasn't been addressed in an existing GitHub issue.

Expected behavior

The documentation should render correctly when hosted via GitHub Pages or viewed locally, including loading all required assets like theme-settings.json.

Actual behavior

A 404 error occurs for theme-settings.json, and the documentation page doesn't display as intended. This happens both when hosted on GitHub Pages and when opened directly from the file system.

Steps to Reproduce

  1. Generate documentation using Swift-DocC.
  2. Push the contents of the docs/ folder to the main branch.
  3. Enable GitHub Pages to serve from the docs/ directory.
  4. Visit https://your-username.github.io/repo-name/docs/documentation/package-name/index.html.
  5. Observe the 404 error in developer tools for theme-settings.json.
  6. Same issue occurs when opening index.html locally in a browser.

Swift-DocC Plugin Version Information

Swift-DocC plugin version: 1.0.0 for example, or a commit hash.
Swift Compiler version: Output from swiftc --version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions