yous / whiteglass

Minimal, responsive Jekyll theme for hackers

Home Page:https://yous.github.io/whiteglass/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The location for main.css in index.html inside _site folder is incorrect

armsp opened this issue · comments

I built a blog using your theme. However I am yet to figure out how to use GitHub Pages to work with it since you said that jekyll-archives wont play well with it. One option is to just publish the contents of _site folder so that GitHub Pages just renders index.html. However when that happened the css didn't work at all. When I looked at the link tag I noticed that location for main.css was - <link rel="stylesheet" href="/whiteglass/assets/main.css"> but there is NO whiteglass folder in _site.

How do I solve this so that whenever I do jekyll serve, everything is built properly?

I think it's because you have baseurl: "/whiteglass" in your _config.yml. If you want to use armsp.github.io as home of your blog, set baseurl: "". You may want to use armsp.github.io/blog as home, then set baseurl: "/blog".

I am not using it as a personal site, just a project page. So by default GitHub gives the URL as https://armsp.github.io/<repository-name>

In this case should I keep baseurl: "/<repository-name>" or baseurl: ""
EDIT
I tried with baseurl: "", the css didn't work.
If I do baseurl: "/<repository-name>" then the css path becomes <link rel="stylesheet" href="/<repository-name>/assets/main.css"> which is again incorrect since I am pushing the _site folder, so there is no folder called repository-name.

If you want to have a look then you can look here - https://github.com/armsp/testing-whiteglass

I am just testing it out, so its not complete neither fully edited, but its live so that I can show you that css fails - https://armsp.github.io/testing-whiteglass/

Please try changing _config.yml as the following:

baseurl: "/testing-whiteglass"
url: "https://armsp.github.io"

It's correct even if you don't have the folder called repository-name, as it's URL. <url><baseurl> will point the URL of the repository's GitHub Pages (in this case, https://armsp.github.io/testing-whiteglass). index.html will have <url><baseurl>/assets/main.css, and you have assets/main.css under your repository, it will load the CSS correctly.

It works !! I can't thank you enough.
Just one last question....should this have its own domain, then url: "https://armsp.github.io" will need to be changed to url: "https://abc.com" with baseurl: "", right?

Yes, if you want to give abc.com as home, that's right.

Great, closing this now. Thanks a lot once again!!

No problem! Always feel free to open a new issue if you have problems.