Search code examples
gitgithub-pagesgit-submodules

Github pages not recognizing index.html in Submodule


Question

I searched various questions on SO regarding inaccessible submodule matter, but mostly is decade-old posts, fix on it didn't worked.

I am already using https://username... link instead of git@username... in .gitmodules which is what most of the solutions points out.

Is my Submodule setup wrong, or is it just Github failing to pull submodule?

enter image description here


Resource

[submodule "./docs/SimpleLive2dViewer"]
    path = ./docs/SimpleLive2dViewer
    url = https://github.com/jupiterbjy/SimpleLive2dViewer
git submodule add https://github.com/jupiterbjy/SimpleLive2dViewer .\docs\SimpleLive2dViewer
git push --recurse-submodules=check

Since it worked with local jekyll serve, I am guessing github couldn't clone repository properly - which raise another mystery that deployment didn't reported any errors.

Other non-submodule sites on same directory loads fine.


Solution

  • I was in the same situation but didn't have to go as far as the cloning steps in jupiterbjy's answer. I had added my repo X as a submodule of my GitHub Pages repo, but X didn't have Pages enabled in its settings. When I enabled that, GitHub said it would be published at [username].github.io/X (ie not apparently requiring the use of a submodule). I removed the submodule from the Pages repo and pushed it, and all was fine after that.