0

At one point this worked. However, i left the project in what I thought was working condition and then come back to find that the formatting is all broken. The repo is available here and the site hosted here.

I've checked my _layouts/ folder and it has the / seemingly correctly set as per the answer here.

Similarly I've set my base URL as this is a project page as per this question.

Possibly something went wrong when I pushed the RMD file in, however I've tried to wind back and push that as the version of the repo, but I didn't see any changes (maybe I did this badly, I'm very new to github, and pretty novice at git).

How can I get my formatting back? The original structure was made using this tutorial on jekyll and ghpages.

FINAL SOLUTION:

After inspecting and testing both answers from LarsW and David_Jacquel, the final fix is as follows:

  1. _config.yml - include baseurl: /Pokemon_FieldStudies
  2. default.html - include <link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/css/main.css">

4 Answers 4

2

The link is wrong. The first / in /css/main.css makes it go to the root folder, which is the domain (http://davergp.github.io/) and not the site (http://davergp.github.io/Pokemon_FieldStudies/). Just change it to /Pokemon_FieldStudies/css/main.css or css/main.css.

Sign up to request clarification or add additional context in comments.

1 Comment

accepted as root answer, updating question with the actual solution implemented
2

In _config.yml, set baseurl: /Pokemon_FieldStudies.

An call you css like this : <link rel="stylesheet" type="text/css" href="{{ baseurl }}/css/main.css">

4 Comments

I've just tested your implmentation, I'm not sure it's worked. Have I done it wrong? Are you sure I don't need the / in the baseurl argument? If I include that then it works, and is a more ideomatic way of supplying LarW's answer
Now it's broken again. this slow refresh rater is frustrating.
thanks, + 1, turned out you're approach partially functioned, and definitely put me on the right track
Sorry it's baseurl: /Pokemon_FieldStudies the slash was missing.
0

Your main.css is blank that why the webpage is coming without styling.

enter image description here

Put this code in your main.css and hope it should work.

body {
    margin: 60px auto;
    width: 70%;
}
nav ul, footer ul {
    font-family:'Helvetica', 'Arial', 'Sans-Serif';
    padding: 0px;
    list-style: none;
    font-weight: bold;
}
nav ul li, footer ul li {
    display: inline;
    margin-right: 20px;
}
a {
    text-decoration: none;
    color: #999;
}
a:hover {
    text-decoration: underline;
}
h1 {
    font-size: 3em;
    font-family:'Helvetica', 'Arial', 'Sans-Serif';
}
p {
    font-size: 1.5em;
    line-height: 1.4em;
    color: #333;
}
footer {
    border-top: 1px solid #d5d5d5;
    font-size: .8em;
}

ul.posts { 
    margin: 20px auto 40px; 
    font-size: 1.5em;
}

ul.posts li {
    list-style: none;
}

2 Comments

thanks for the help, but my main css isn't blank... github.com/DaveRGP/Pokemon_FieldStudies/blob/gh-pages/css/…
His main.css is blank because when loading, the browser got error 404
0

Check the .gitignore file if some how there is excluded CSS files not pushed to the remote repo.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.