2017-01-11 58 views
0

有许多类似于我的问题,但其中大多数是由于未正确使用baseurl而产生的。然而,我的website甚至没有使用baseurl。它使用根Github页面。我基本上把我的网站从luminousrubyist的正确显示的空域主题中分离出来,所以在某些地方我做了一个改变,使它无法正确显示。因此,如果其他人能够弄清楚什么是错的,我将不胜感激;我一直试图弄清楚几个小时。Jekyll github-pages网站不显示CSS格式,除本地外

我Github上page

我_config.yml文件:

title: "My Portfolio" 
subtitle: "My portfolio, detailing my experience" 
# Base URL of site. It should always start with a slash, 
# and never end with a slash. Set it to a blank value if hosting at the 
# root of your server. 
# baseurl: "/" # the subpath of your site 
url: "http://austinstover.github.io" # the base hostname & protocol for your site 
cover: "/assets/cover.png" 
logo: "/assets/logo.png" 

# Build settings 
markdown: kramdown 

# Google analytics 
ga_tracking_id: "UA-90009514-1" 

# Category descriptions (for archive pages) 
descriptions: 
    - cat: jekyll 
    desc: "Posts describing Jekyll setup techniques." 

    - cat: dummy 
    desc: "Just some placeholder posts, lorem ipsum and the rest." 

exclude: 
    - "/vendor/" 
    - "Gemfile" 
    - "Gemfile.lock" 
    - "README.md" 
    - "LICENSE.md" 
    - "*.gemspec" 

keep_files: 
    - "CNAME" 
    - ".git" 
    - ".gitignore" 
+0

我注意到的第一件事是前面的问题显示在您的页面上,这意味着它没有应用模板。我会检查文件的编码/行结尾。 – RobertKenny

回答

1

尝试设置baseurl_config.yml

baseurl: "" #if not used. 

顺便说一句,您的index.html使用page.html布局(从_layouts),使用default.html布局,其中包括head.html(来自_includes)。这一个叫{{ site.baseurl }}但它是未定义的。

+0

根据[jekyll文档](https://jekyllrb.com/docs/configuration/),默认情况下baseurl被设置为空字符串,所以我不需要将其设置为空字符串;无论如何,我已经尝试过一个空字符串,一个斜杠等等,这些都不会让我的页面工作。 – abeta201

+0

我认为你需要取消注释baseurl,并将其留空。我的网站和开发网站都有它,并似乎工作正常 – Alan

+0

这也是我认为,在刚刚创建它们,它可能会留下,因为OP提到,但由于他们正在使用的主题是指这个属性{{ site.baseurl}}显式地定位资源路径,它可能会在删除时导致一些问题。 尽管我不确定,因为我无法重现问题^^“ – yaitloutou