I used to have a user-name jekyll website hosted on github pages. The name of the repo and the site was: “molecule [dot] github [dot] io”.
However, I found a need to install some plugins beyond what github-pages will allow w/ jekyll in --safe mode, so I thought I’d just move my generated _site/ folder to the gh-pages branch, rename the repo to “molecule”, and have my new site up and running as a “project page” at molecule[dot]github[dot]io/molecule (complete w/ more plugins).
Did you update the baseurl to the name of the repo? you probably had no value for the baseurl before as it was a username based repo and those are served from the root. Now what it is a project repo the project name is a sub folder under your username and that needs to be reflected in the path for your css. Usually that is handled by the baseurl setting in the config.
Oooh interesting. Ok, so I’ve added baseurl: /new-posts to my _config.yml on the master branch. I then do ‘jekyll serve -w’, and it tells me to visit the url: “http://127.0.0.1:4013/new-posts/”, but unfortunately everything still appears the same.
I’m guessing I haven’t properly configured my URLs, so the baseurl isn’t being used where it should be. For example, I have an image inside of a div, and the img-src looks like this:
what is the name of the project repo? new-posts? or molecule? seems like your first post says it is molecule which is what you should have the baseurl - /molecule
Basurl should always have a leading / but no trailing /.
yes, all your links to css/images/js and internal pages etc should have baseurl in them - kind of even if you don’t use baseurl just in case you ever do. If you don’t use baseurl and it is empty in the config then it doesn’t effect anything.
Here is an example of a link to css:
href="{{site.baseurl}}/assets/css/site.css"> other people use prepend not sure what the difference is. If baseurl is empty the link just renders as /assets/css/site.css which is what I want. if baseurl is set to /molecule then you end up with /molecule/assets/css/site.css.
The name of the repo is molecule, but the name of the url I want is new-posts. Do they have to match? (edit: I just tried both and yes, it seems they have to match. Please correct me if I’m wrong).
Ok, so my baseurl is /molecule now, and I’ve updated all the links to include {{site.baseurl}}. So the image example earlier:
index.html has all updated everything. It is also using the default.html file as a templater (apologies if my terminology is incorrect), and I updated default.html to look like this:
I added site.baseurl everywhere that had a relative path…but I’m still seeing messed up formatting (but only on the main page! Everything else is working great). Any ideas?