问题
I was quite happy when I finally managed to get this site online, but unfortunately the posts don't format or style correctly and I don't know what the problem is. Its located at https://github.com/skydusk/skydusk.github.io and the site is here: http://skydusk.github.io/
Can anyone tell me what i've done wrong here?
config.yml
##The website title
name: skydusk
url: "http://skydusk.github.io"
##Markdown processor
markdown: kramdown
##syntax highlighter. change it to pygments
highlighter: pygments
##define base_url for valid usage in sitemap.xml and robots.txt
base_url: /skydusk
sass:
sass_dir: _sass
style: :compressed
paginate: 5
paginate_path: "page:num"
##The website description (to be used in meta tags)
description: just another personal blog
##Some frequently used keywords on your website
keywords: windows, storage, crashplan, synology, backups, itunes
##define this for disqus comment support
#disqus: skydusk
##set this to enable google analytics
#ga_id: UA-66844898-1
#ga_domain: www.skydusk.com
##Some commonly used links
links:
facebook: username
twitter: username
email: info@skydusk.com
github: username
##put desired image in img/ directory and set the value accordingly. If not defined, a placeholder image will be used.
about_image: placeholder.jpg
##comment this if you want full width posts with no sidebar
sidebar: off
回答1:
the problem was in default.html.
<link rel="stylesheet" href="css/style.css">
had to be changed to
<link rel="stylesheet" href="/css/style.css">
It was the lack of a dash at the start that was causing it, thanks to nowonmai666 over on reddit. I hope this can help someone.
回答2:
baseurl is broken somewhere and someone needs to figure it out.
'/'
points to the root of the volume and is incorrect.
'./'
is more correct.
回答3:
It seems there is a problem with your _layout/post
file (here) and it doesn't load the CSS. Check if the CSS for posts are good or try another template.
回答4:
Your original code, forked from bitwiser, was modified.
In jekyll calling an asset is usually made like this :
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">
or
<script src="{{ site.baseurl }}/js/script.js"></script>
In you case :
Setting baseurl
to nothing (baseurl :
) and calling assets appropriatelly is ok.
来源:https://stackoverflow.com/questions/32253472/jekyll-posts-not-displaying-formatting-correctly-on-github-pages-rest-of-site-i