Search code examples
sassjekyllgithub-pages

Having problems building github page(SCSS import fails (Jekyll))


I was trying to run a github page with Jekyll theme,and the website runs fine locally. However, when I try to urn in on htttps://username.github.io, GitHub cannot build the website.

I got the following error message :

Your site is having problems building: Your SCSS file myblog/assets/main.scss has an error on line 1: File to import not found or unreadable: minimaless.

The main.scss :

---
# Only the main Sass file needs front matter (the dashes are enough)
---

@import "minimaless";

It seems to be the path to the .scss file expected by GitHub is different from where the Jekyll theme put it. I checked some posts mentioned that I should put the absolute path of .scss in _config.yml file.

It seems to be the path to the .scss file expected by GitHub is different from where the Jekyll theme put it. I checked some posts link mentioned that I should put the absolute path of .scss in the directory of urlbase, which is /myblog. But I am not familiar with ruby, so I am not sure how should I do it.

The folder structure is like this :

myblog/ - assets/

         - main.scss

   - _sasss/

         - minimaless.scss

         - minimaless/

                    - basic.scss

                    - layout.scss

                    - hight-lighting.scss

   - _config.yml

This is my GitHub page folder :

https://github.com/Po-Hsuan-Huang/Po-Hsuan-Huang-github.io


Solution

  • The issue could be because your source contents are within a subdirectory myblog. Try moving all the contents to the root of your repository.

    It could also be because of the following in your config file:

    theme: minimaless
    #remote_theme: brettinternet/minimaless
    

    theme: minimaless is not supported on GitHub Pages. Comment it out.

    And finally, _site directory should not be checked into version control. Delete it from your repository and then add an entry for it in your .gitignore file.