Pushed .nojekyll file to Github pages, no effect?
Asked Answered
B

3

17

I'm trying to push some Sphinx-generated docs to Github pages. I've found out that Jekyll removes the folders with an underscore; since I wasn't using it anyway I added a .nojekyll file to the folder, committed and pushed. However, nothing is happening yet. Did I do something wrong, does the process normally take some time, or should I force the page to rebuild in some other way? Thanks.

Blackout answered 17/11, 2017 at 18:24 Comment(3)
Did you rebuild your site locally before pushing up? Putting a .nojekyll fine in the root tells Github NOT to use jekyll to build your site. So you need to build it locally first - so there is the right content in your output _site directory.Sofer
Also, Jekyll doesn't "remove" folders with an underscore. It uses their contents to build pages. When a folder does not have an underscore, Jekyll will copy that folder them over to the output_sites folder.Sofer
It worked now after another, uncorrelated commit & push. So I suspect it was just Github pages not rebuilding for whatever reason. Thanks!Blackout
B
26

The problem was solved after another commit and push of a seemingly unrelated change. It was probably just Github pages not rebuilding the site and once a build was forced it was all fixed. Issue closed for me.

Blackout answered 19/11, 2017 at 12:39 Comment(4)
Ah, caching. Ever wonderful, ever a mystical headache, eventually consistent.Nobleminded
In my this case this didn't help and I contacted Github support. I'm now waiting for a response from them.Apology
...never mind, it turns out that my problem was unrelated to .nojekyllApology
FWIW, you can confirm if there's caching issues by copying the URL that the browser requested from into the terminal: curl https://....Dagley
C
8

I had the same error and I found the issue on github pages repo:
https://github.com/tschaub/gh-pages/issues/315

Answer: just add the parameter -t true ...
Example:

// Package.json
"deploy": "touch ./output_folder/.nojekyll && gh-pages -d output_folder -t true"
Cornet answered 8/6, 2022 at 11:29 Comment(0)
H
2

If you use the gh-pages package to autopublish and deploy a build (I'm building Astro locally with a database) to the gh-pages branch you can add the --dotfiles flag.

npm install gh-pages -D
gh-pages -d dist --branch gh-pages --dotfiles
Hedda answered 13/12, 2023 at 15:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.