jeffreytse / jekyll-theme-yat

🎨 Yet another theme for elegant writers with modern flat style and beautiful night/dark mode.
https://jeffreytse.github.io/jekyll-theme-yat
MIT License
1.01k stars 915 forks source link

Remote Theme ineffective #156

Open atom-tracer opened 8 months ago

atom-tracer commented 8 months ago

When I use order bundle exec jekyll serve locally, the page seems normal. image However, when I push the repo to github, it will be automatically and successfully deployed, and the page looks like this: image I noted that #37 has noted that problem in 2021, but I don't get it: what am I supposed to set my base_url? and what's the meaning? Here's part of my configuraion files:

# Gemfile
# frozen_string_literal: true

source "https://rubygems.org"

gem "jekyll-theme-yat"
gem "github-pages", group: :jekyll_plugins
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
group :jekyll_plugins do
  gem "jekyll-feed"
  gem "jekyll-seo-tag"
  gem "jekyll-sitemap"
  gem "jekyll-paginate"
  gem "jekyll-spaceship"

end
# _config.yml
...
remote_theme: "jeffreytse/jekyll-theme-yat"
theme: jekyll-theme-yat

There's 1 warning on Github Action: image But I don't know how to fix it.

Hoping to get help, thanks.

jeffreytse commented 8 months ago

Hi @atom-tracer

This issue was caused by your wrong base url, it made the css file loading wrongly. You can check the Readme for correcting your base url.

Thanks & Regards

atom-tracer commented 8 months ago

Hi @atom-tracer

This issue was caused by your wrong base url, it made the css file loading wrongly. You can check the Readme for correcting your base url.

Thanks & Regards

Hi jeffreytse, I checked the README.md, but it only points out that I should set the path correctly without telling how. So I checked your repo and set mine the same as yours: jekyll_baseurl: "/jekyll-theme-yat" # Default is according to _config.yml but it doesn't work. Can you provide more information like, the item is to load css file in my repo or from other server? Or can you check my repo and give me some advice? Thanks.

jeffreytse commented 8 months ago

Hi @atom-tracer

For yours, I believe it should be as below as your repository using a default github page name:

jekyll_baseurl: "/" # Default is according to _config.yml`

Note: the baseurl means the prefix for your resource path without considering the host.

Thanks & Regards

atom-tracer commented 8 months ago

Hi, I have done this, but the new bug come out during the Github Action, now it cannot pass the build. Here's the info:

Configuration file: _config.yml
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
  Jekyll Spaceship: 🗂  use table-processor
  Jekyll Spaceship: 🗂  use mathjax-processor
  Jekyll Spaceship: 🗂  use plantuml-processor
  Jekyll Spaceship: 🗂  use mermaid-processor
  Jekyll Spaceship: 🗂  use polyfill-processor
  Jekyll Spaceship: 🗂  use media-processor
  Jekyll Spaceship: 🗂  use emoji-processor
  Jekyll Spaceship: 🗂  use element-processor
            Source: /github/workspace
       Destination: /github/workspace/build
 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
   GitHub Metadata: Error processing value 'baseurl':
  Liquid Exception: No repo name found. Specify using PAGES_REPO_NWO environment variables, 'repository' in your configuration, or set up an 'origin' git remote pointing to your github.com repository. in /_layouts/post.html
             ERROR: YOUR SITE COULD NOT BE BUILT:
                    ------------------------------------
                    No repo name found. Specify using PAGES_REPO_NWO environment variables, 'repository' in your configuration, or set up an 'origin' git remote pointing to your github.com repository.
jeffreytse commented 8 months ago

Hi @atom-tracer

According to your log, this issue caused by a Liquid Exception happened in /_layouts/post.html.

Liquid Exception: No repo name found. Specify using PAGES_REPO_NWO environment variables, 'repository' in your configuration, or set up an 'origin' git remote pointing to your [github.com](http://github.com/) repository. in /_layouts/post.html

Please ensure your change on this file /_layouts/post.html is correct.

Thanks & Regards

atom-tracer commented 8 months ago

Hi, I see the log and, cuz I don't have any front-dev experience, I haven't changed this filepost.html. After I see the log, I copied yours and tried again, the problem still exists. Sry for that I can't provide any useful analysis, since I haven't learned about these at all. Can you give me more advice? Thanks.