1

I have a Github repository, see here. For a subfolder of this repository I built a Jupyter book, see here. The develop branch of this repository is set-up to host with github pages. However, it doesn't render my Jupyter book. If I go to the supposed address, I get a 404 file not found error.

From the documentation, I couldn't figure out how to set up Jupyter book with github pages in a subfolder properly. I also added the .nojekyll file, but this didn't change anything. For separate html files in other folders, the github pages is working properly, e.g. here.

Does anyone know if and how this can be set-up correctly?

Thinker
  • 73
  • 5
  • How do you want to organise your repo? If you just want source files in the repo, then you should put the book HTML pages into the gh-pages branch and configure Github Pages to use that (GIthub: Settings->Pages). A Github Action can also build the book and push it to the gh-pages branch automatically; see: https://jupyterbook.org/publish/gh-pages.html When serving from main, you need to put the files in the `docs/` directory. – psychemedia Jun 23 '21 at 14:36
  • Thanks for the reply! I want to organise the repo to have a subfolder contain the book HTML pages. This subfolder is in on the main branch (or well develop) and not a specific gh-pages branch, however the develop branch is configured with Github Pages. Can this work from a subfolder, or should I always copy the HTML pages to a `docs/` folder at the root of the repo? – Thinker Jun 24 '21 at 07:42
  • I think Github Pages needs files at either the root or in docs/ in main; or root of the gh-pages branch. Also note: if you have things in subdirs etc where the subdir name is prefixed with an underscore (_), you need an empty .nojekyll file in the root of the published dir or those _-prefixed dirs/files wil be ignored. – psychemedia Jun 25 '21 at 20:21
  • Okay great to know, thank you! Yes I added an empty .nojekyll but without success. So it seems to me then that I will have to change the directory structure such that it is in the root of the branch or in a `docs/` folder. Where the `docs` should also be a directory in root, and not in another subdir. Correct? – Thinker Jun 29 '21 at 06:25
  • I think the content files need to be in / or /docs, and then you use the Pages config setting to select which path to publish from. The .nojekyll file needs to be in the fir that is published from (ie the same dir as the content files. – psychemedia Jun 30 '21 at 08:59

0 Answers0