简体   繁体   中英

Jekyll theme not rendering in Github pages

I'm switching my website from Siteleaf to Github. The website is loading perfectly except the CSS is not rendering.

Here is my _config.yml

title: Awesomeness
timezone: UTC
collections:
  posts:
    title: Posts
    output: true
  uploads:
    title: Uploads
    output: true
defaults:
- scope:
    path: ''
    type: posts
  values:
    layout: post
    permalink: "/posts/:title/"
- scope:
    path: ''
    type: pages
  values:
    layout: page
permalink: pretty

And this is my Gemfile.lock

GEM
  remote: http://rubygems.org/
  specs:
    addressable (2.8.0)
      public_suffix (>= 2.0.2, < 5.0)
    colorator (1.1.0)
    concurrent-ruby (1.1.10)
    em-websocket (0.5.3)
      eventmachine (>= 0.12.9)
      http_parser.rb (~> 0)
    eventmachine (1.2.7)
    ffi (1.15.5)
    forwardable-extended (2.6.0)
    http_parser.rb (0.8.0)
    httparty (0.20.0)
      mime-types (~> 3.0)
      multi_xml (>= 0.5.2)
    i18n (1.10.0)
      concurrent-ruby (~> 1.0)
    jekyll (4.2.2)
      addressable (~> 2.4)
      colorator (~> 1.0)
      em-websocket (~> 0.5)
      i18n (~> 1.0)
      jekyll-sass-converter (~> 2.0)
      jekyll-watch (~> 2.0)
      kramdown (~> 2.3)
      kramdown-parser-gfm (~> 1.0)
      liquid (~> 4.0)
      mercenary (~> 0.4.0)
      pathutil (~> 0.9)
      rouge (~> 3.0)
      safe_yaml (~> 1.0)
      terminal-table (~> 2.0)
    jekyll-sass-converter (2.2.0)
      sassc (> 2.0.1, < 3.0)
    jekyll-watch (2.2.1)
      listen (~> 3.0)
    kramdown (2.4.0)
      rexml
    kramdown-parser-gfm (1.1.0)
      kramdown (~> 2.0)
    liquid (4.0.3)
    listen (3.7.1)
      rb-fsevent (~> 0.10, >= 0.10.3)
      rb-inotify (~> 0.9, >= 0.9.10)
    mercenary (0.4.0)
    mime-types (3.4.1)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2022.0105)
    multi_xml (0.6.0)
    pathutil (0.16.2)
      forwardable-extended (~> 2.6)
    psych (4.0.3)
      stringio
    public_suffix (4.0.7)
    rack (2.2.3)
    rb-fsevent (0.11.1)
    rb-inotify (0.10.1)
      ffi (~> 1.0)
    rexml (3.2.5)
    rouge (3.28.0)
    safe_yaml (1.0.5)
    sassc (2.4.0)
      ffi (~> 1.9)
    siteleaf (2.1.2)
      httparty (>= 0.16.0)
      jekyll (>= 1.4.1)
      psych (>= 2.1.0)
      rack
    stringio (3.0.1)
    terminal-table (2.0.0)
      unicode-display_width (~> 1.1, >= 1.1.1)
    unicode-display_width (1.8.0)

PLATFORMS
  ruby

DEPENDENCIES
  jekyll
  siteleaf (~> 2)

BUNDLED WITH
   2.1.4

I tried to add baseurl or root in the _config.yml yet I'm unable to solve the problem. When I serve the website locally it runs perfectly. The problem only occur in Github pages.

I solved this issues by removing the slash forward from "/css/main.css". So Github pages needed it to be "css/main.css"

I'm leaving this if any lost soul faces this issue in the future.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM