swiftlang / swift-docc-plugin

Swift Package Manager command plugin for Swift-DocC
https://swiftpackageindex.com/apple/swift-docc-plugin/1.3.0/documentation/swiftdoccplugin
Apache License 2.0
316 stars 54 forks source link

GitHub hosted pages fail to load function pages #66

Closed migueldeicaza closed 10 months ago

migueldeicaza commented 10 months ago

I am generating documentation for static hosting on GitHub Pages and while I can try the result locally with a python server, when hosted on GitHub, some pages do not render, it looks like they are pages with '_' in their name.

The error is "The page you’re looking for can’t be found"

Navigate to this page:

https://migueldeicaza.github.io/SwiftGodotDocs/documentation/swiftgodot/node/

Then look for the "func _enterTree()" and click on that, which should be this url:

https://migueldeicaza.github.io/SwiftGodotDocs/documentation/swiftgodot/node/_entertree()

This will fail with a 404 for https://migueldeicaza.github.io/SwiftGodotDocs/data/documentation/swiftgodot/node/_entertree().json

You can see that the file has been posted to GitHub:

https://github.com/migueldeicaza/SwiftGodotDocs/blob/main/docs/data/documentation/swiftgodot/node/_entertree().json

But it looks like this does not get deployed or is accessible from the deployed GitHub pages.

Checklist

Expected behavior

Actual behavior

The page should be visible.

Steps to Reproduce

git clone https://github.com/migueldeicaza/SwiftGodot.git mkdir SwiftGodotDocs cd SwiftGodot make build-docs && make push-docs

Then push the above "SwiftGodotDocs" to a GitHub repo that can host Pages.

Swift-DocC Plugin Version Information

Swift-DocC plugin version: 1.3.0 for example, or a commit hash. Swift Compiler version: swift-driver version: 1.87.1 Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)

j-f1 commented 10 months ago

This is probably because your GitHub Pages deploy action is using Jekyll to post-process your repo, and Jekyll ignores file names starting with an underscore. Adding an empty .nojekyll file at the repo root (or maybe in the docs folder) should prevent this processing from happening.

migueldeicaza commented 10 months ago

Thank you! That did it!