2017-01-11 56 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