nielsenramon / chalk

Chalk is a high quality, completely customizable, performant and 100% free Jekyll blog theme.
http://chalk.nielsenramon.com
MIT License
1.23k stars 442 forks source link

Github pages no longer building properly #154

Closed nbulischeck closed 6 years ago

nbulischeck commented 6 years ago

I mirrored my old website repo (https://github.com/nbulischeck/website) to a new repo (https://nbulischeck.github.io/project6/) and rebuilt the project. I'm now getting 404 errors when github tries to load the wrong resource.

I tried this with a newer clone of Chalk and still received the same errors (gh-pages trying to pull css/js resources from name-long_string_of_hex.js. Any help?

nielsenramon commented 6 years ago

@nbulischeck Did you see the important note here: https://github.com/nielsenramon/chalk/blob/master/README.md#deploy-to-github-pages ?

I think that will solve your issue!

nbulischeck commented 6 years ago

@nielsenramon Yes I've ran that and it hasn't worked recently. I have successfully built Chalk in the past, so I wouldn't say I'm new at your build system, but I could definitely be doing something wrong.

Testing Repo: https://github.com/nbulischeck/chalk-testing

Steps to reproduce:

git clone https://github.com/nielsenramon/chalk.git
cd chalk
git remote set-url origin git@github.com:nbulischeck/chalk-testing.git
git push -u origin master
npm run publish

Result: https://nbulischeck.github.io/chalk-testing/

migueldemoura commented 6 years ago

Just checked your repo - the assets are there, not sure why they aren't being served.

nbulischeck commented 6 years ago

screenshot from 2018-04-23 08-21-57

It's trying to load resources from seemingly incorrect filenames.

migueldemoura commented 6 years ago

If you check your repo, those files exist. I checked the light-*.css one. Can you verify?

Have you tried re-deploying?

nbulischeck commented 6 years ago

The light-*.css file is prevalent, but it's in /assets/, not the root directory (see here https://github.com/nbulischeck/chalk-testing/blob/gh-pages/assets/light-66f45f496d3d18e5d0be0a1c4197083526ac584c945d0ef492f7375867f3b191.css).

I re-ran npm run publish with the same results.

Edit:

The site seems to find the light css file in /assets/, but it's empty?

screenshot from 2018-04-23 08-29-17

migueldemoura commented 6 years ago

You're right, didn't notice the dir.

Try setting the baseurl: https://github.com/nbulischeck/chalk-testing/blob/master/_config.yml#L12 to /chalk-testing :smile:

Edit: @nielsenramon, we should probably add a notice to the readme, this is very easy to overlook and quite a few have had this issue already.

nbulischeck commented 6 years ago

That was it! What a simple solution :laughing:. I would recommend that be added to the important note. Something along the lines of:

Make sure to set your baseurl in _config.yml as the name of your github repo.

migueldemoura commented 6 years ago

You can probably send in a PR with that notice. Is the website always deployed to a subfolder using GH-Pages? Thought I'd seen others without it.

nbulischeck commented 6 years ago

Only if it's a project site.

If you're building it for a project site, then it will be at <user/organization>.github.io/repo-name.

If you're building it for a user or organization site, then it will be at <user/organization>.github.io/

I'll send in a PR shortly.

nielsenramon commented 6 years ago

@migueldemoura I was hesitant to add it as it's basic Jekyll functionality but I'll accept the PR!

Glad it's fixed ;-)

nielsenramon commented 6 years ago

PR merged thanks!