yulijia / freshman21

Welcome to use Jekyll theme Freshman21.
http://yulijia.net/freshman21/
MIT License
133 stars 90 forks source link

build error from scss #27

Closed Richeir closed 7 years ago

Richeir commented 7 years ago

I clone the code and run [jekyll build], it shows

$ jekyll build Configuration file: D:/GitHub/richeir.github.io/freshman21/_config.yml Source: D:/GitHub/richeir.github.io/freshman21 Destination: D:/GitHub/richeir.github.io/freshman21/_site Incremental build: disabled. Enable with --incremental Generating... Conversion error: Jekyll::Converters::Scss encountered an error while converting 'css/main.scss': Invalid GBK character "\xE3" on line 324 jekyll 3.4.3 | Error: Invalid GBK character "\xE3" on line 324

yulijia commented 7 years ago

Hi @Richeir ,

Thank you for your feedback, please try only add "@charset "utf-8"; " on _layout.scss.

If you can build it successfully, please close the pull request and submit a new one.

Richeir commented 7 years ago

Hello @yulijia I should be apologized to you. This is a confused situation.

  1. I fork the freshman21 project and just run without change anything, but the css file can not be converted, so the blog have no css file and looks strange.

  2. I clone the freshman21 project into my computers.

    • On Mac, jekyll build just fine and css file can be converted, blog looks good, all things well.
    • On Windows 10, conversion error appeared, just like my pull request, after add "@charset "utf-8"; " in every scss file, then things can be well.

This is what I can get. Thanks for your freshman21, I really like this jekyll theme.

yulijia commented 7 years ago

Hi, thank you.

I mean would you mind help me to test it on Windows 10, if we only add ' @charset "utf-8"; ' in _layout.scss file, could we build the blog with css correctly?

If it works, you can push a new request (only add @charset "utf-8"; to one file) and help me to fix this bug on Windows OS.

Richeir commented 7 years ago

Hello @yulijia

Thanks for your reply.

jekyll 3.4.3 | Error: Invalid GBK character "\xE3" on line 324

GBK is Chinese Internal Code Specification, maybe this error only shows in OS use Chinese language.

add ' @charset "utf-8"; ' in _layout.scss file

I will make a complete test this weekends with your advice. The test will through MacOS, Windows 10 (Chinese), Windows 10 (English), Linux(Chinese), Linux(English).

Best Regards, Richeir

yulijia commented 7 years ago

Hi @Richeir,

Thank you for your help.

Cause of the error is a UTF-8 character "\xE3" in _layout.scss (line 324 and 329) cannot be shown correctly on Some OS with default GBK character encodings. I wonder to know if add @charset "utf-8";in_layout.scss file will fix this bug.

Richeir commented 7 years ago

Hello, @yulijia

I wonder to know if add @charset "utf-8";in_layout.scss file will fix this bug.

Your advice is correct, After add @charset "utf-8"; in_layout.scss file, both MacOS and Windows build pass and run well.

I have made a pull request, please accept it.

Best Regards, Richeir

yulijia commented 7 years ago

Thanks.