[英]Jekyll blog folder won't compile on github pages but works offline
我在myuser.github.io
建立了一個github用戶頁面myuser.github.io
。 我在那里建立了一個常規的html靜態網站,效果很好。 (我還使用CNAME文件和CNAME DNS記錄設置了自定義域,以便myuser.github.io轉到www.example.com)
然后,我還在該倉庫中創建了一個/blog
文件夾,並放入了一個jekyll博客模板。
在本地運行jekyll build serve
或bundle exec jekyll serve
不會給我帶來任何錯誤。 我可以發布新帖子,它們顯示在localhost:4000/blog/
。
但是,當我將博客文件夾推送到github時,這些事情發生了:
b2/css/main.scss
包含語法錯誤。有關更多信息,請參見https://help.github.com/articles/page-build-failed-markdown-errors 。” www.example.com/blog/index.html
收到404。 這意味着github由於該錯誤而嚇跑了,直到它修復后才會更新。
我如何找出“ main.scss”錯誤是什么? 既然在當地還可以。 我是jekyll(和github頁面)的新手,但我會盡最大可能遵循文檔。
這是我的main.scss:
---
layout: null
# Only the main Sass file needs front matter (the dashes are enough)
#http://sassmeister.com/
---
@charset "utf-8";
// Our variables
$base-font-family: "Raleway",Arial,sans-serif;
$base-font-size: 16px;
$small-font-size: $base-font-size * 0.875;
$base-line-height: 1.5;
$spacing-unit: 30px;
$text-color: #111;
$background-color: #fdfdfd;
$brand-color: #2a7ae2;
$grey-color: #828282;
$grey-color-light: lighten($grey-color, 40%);
$grey-color-dark: darken($grey-color, 25%);
$blue-color: #515865;
// Width of the content area
$content-width: 800px;
$on-palm: 600px;
$on-laptop: 800px;
// Using media queries with like this:
// @include media-query($on-palm) {
// .wrapper {
// padding-right: $spacing-unit / 2;
// padding-left: $spacing-unit / 2;
// }
// }
@mixin media-query($device) {
@media screen and (max-width: $device) {
@content;
}
}
// Import partials from `sass_dir` (defaults to `_sass`)
@import
"base",
"layout",
"syntax-highlighting"
;
PS:這是我正在使用的jekyll博客主題: https : //github.com/smallmuou/Jekyll-Pithy
Github頁面是從根生成的。 如果你把你的化身在/blog
的文件夾,你的_setting.yml
不在於發現和SCSS導入路徑可以被搞砸了。
如果要在本地復制,則必須重新創建相同的文件夾體系結構,並從根目錄而不是從/ blog觸發jekyll serve --trace
。
解決方案是創建一個blog
存儲庫,並將您的jekyll推送到gh-pages
分支中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.