Should I upload all of _site to Github Pages?


#1

What is the point of doing this? I have added everything but sitemap.xml to .gitignore, as it doesn’t seem to have a need.

Is this bad practice?

Thanks!


#2

For clarification, this is under my /_site folder:

*
!sitemap.xml
!.gitignore

#3

Depends. If you’re not using any blacklisted plugins then there’s no benefit at all to pushing the contents of your _site folder. GitHub Pages runs Jekyll, the whole point is you push up your source files and it will build and then host the contents of _site.

The only reason I can think of that you’d want to push _site up to GH and use it as a “dumb” host is if you need to build the site locally (or with a CI tool) because you’re using plugins not supported on GH Pages.


#4

Okay, thanks. I am not doing that, so guess I won’t.

I am facing this issue and trying to fix it. Is there any way I can force Github pages to rebuild?

Thanks!


#5

GitHub Pages will rebuild your site anytime you push up a commit. Though if you are only pushing up the compiled _site folder it’s not going to have anything to build.

You’ll need to remove that and push up the source .md files, _layouts,_includes,_sass`, assets, etc. instead.


#6

Okay, thank you very much!