tw93/tw93.github.io

math.div

Jie-Huangi opened this issue · 7 comments

大佬,我在deploy你网址时,显示math.div这里有问题。为什么在github上deploy会出现问题呢,我应该怎么解决吗?我现在是把带有math.div的代码全注释了,再deploy,就可以显示成功。如果不注释应该怎么弄呢?求指点了。

tw93 commented

math.div 是指?是不是版本依赖的问题,有详细报错吗?贴一下看看

嗯嗯,不好意思,报错详情没有保存。line-height: 0 + math.div(round(math.div($doc-line-height, $size)*10000), 10000); 就是这种语句,带有math.div都在github里面都编译不通过。我windows电脑没有装jekyll,直接Fork了再copy到本地修改的代码。现在情况是注释了所有带有math.div的语句,上传后再重新编译就能看到自己修改的主页。https://jie-huangi.github.io 这是我copy结果。

这是有问题的代码

@mixin font-size($size) {
  font-size: 0px + $size;
  font-size: 0rem + math.div($size, $doc-font-size);
  line-height: 0 + math.div(round(math.div($doc-line-height, $size)*10000), 10000);
  margin-bottom: 0px + $doc-line-height;
  margin-bottom: 0rem + math.div($doc-line-height, $doc-font-size);
}

有问题的代码在github上编译报错提示:github-pages 228 | Error: Invalid CSS after "...ze: 0rem + math": expected ";", was ".div($size, $do..." on line 57

这是注释过后的结果,可以正常使用。

@mixin font-size($size) {
  font-size: 0px + $size;
  // font-size: 0rem + math.div($size, $doc-font-size);
  // line-height: 0 + math.div(round(math.div($doc-line-height, $size)*10000), 10000);
  margin-bottom: 0px + $doc-line-height;
  // margin-bottom: 0rem + math.div($doc-line-height, $doc-font-size);
}
Deprecation: The 'gems' configuration option has been renamed to 'plugins'. Please update your config file accordingly.
  Logging at level: debug
Configuration file: /github/workspace/./_config.yml
      GitHub Pages: github-pages v228
      GitHub Pages: jekyll v3.9.3
             Theme: jekyll-theme-primer
      Theme source: /usr/local/bundle/gems/jekyll-theme-primer-0.6.0
         Requiring: jekyll-github-metadata
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
  Conversion error: Jekyll::Converters::Scss encountered an error while converting 'css/index.scss':
                    Invalid CSS after "...ze: 0rem + math": expected ";", was ".div($size, $do..." on line 57

我也碰到相同的问题。
本地能正常运行,但github pages的Action build失败了。
image

tw93 commented

这里一般是node版本的问题,包括对应的依赖导致,不过注释就好,一般用不上这个东西