jekyll posts not displaying/formatting correctly on github pages (rest of site is OK though)

谁都会走 提交于 2020-01-25 05:27:25

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!