我正在尝试使用GitHub Pages在Jekyll上托管博客。我能够毫无困难地在本地运行博客。我正在使用username.github.io/username
存储库。我使用以下命令创建了新博客:
git clone https://github.com/xxx/xxx.github.io.git
jekyll new blog
cd blog
jekyll serve
这适用于本地。然后我使用以下命令提交并推送到git repo:
cd ..
git add *
git commit -m "testing"
git push
页面构建失败,出现以下错误:
文件
blog/css/main.scss
包含语法错误。有关详细信息,请参阅https://help.github.com/articles/page-build-failed-markdown-errors。如果您有任何疑问,请通过https://github.com/contact与我们联系。
main.scss如下,
---
# Only the main Sass file needs front matter (the dashes are enough)
---
@charset "utf-8";
// Our variables
$base-font-family: Helvetica, 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%);
// 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"
;
我认为问题是css不是从scss生成的。我不确定。问题是什么?
答案 0 :(得分:0)
您需要指定_sass
目录。看看我的项目有main.scss
(位于css / main.scss)文件,该文件从_sass目录导入部分内容 - > https://github.com/wiredsister/wiredsister.github.io