Jekyll主题无法更新无报错,页面仍渲染Minima主题
Hey there! I’ve run into this exact issue before when switching Jekyll themes—let’s walk through the most common fixes to get your new official Gem-based theme working:
Double-check your Gemfile configuration
Make sure you’ve properly added your desired official theme and commented out Minima. For example, if you’re using the Primer theme (one of GitHub’s official options), your Gemfile should look like this:source "https://rubygems.org" # Comment out the Minima line to disable it # gem "minima" # Add your new official theme gem "jekyll-theme-primer"After updating the Gemfile, run
bundle installto install the new theme and update your dependencies.Update your _config.yml file
Jekyll won’t switch themes unless you explicitly set it in your config. Open_config.ymland replace the existingthemeline with your new theme’s name:theme: jekyll-theme-primerNote: Don’t confuse this with
remote_theme—that’s for GitHub-hosted themes, not Gem-based ones.Clear Jekyll’s cache and restart the server
Jekyll caches assets and theme files aggressively. Run this command to clear the cache:bundle exec jekyll cleanThen restart your server with bundle exec to ensure you’re using the dependencies from your Gemfile:
bundle exec jekyll serveSkipping
bundle execcan cause Jekyll to use old global dependencies instead of your project’s specific ones.Remove local theme directories
If you have a local_themefolder or aminimadirectory in your project, Jekyll will prioritize these over the Gem-installed themes. Delete any local theme-related folders to force Jekyll to use the Gem version.Verify your installed gems
Runbundle listto check if your new theme is installed and if Minima is still present. If Minima is listed, double-check that you commented it out in your Gemfile and runbundle updateto remove it.
Once you’ve gone through these steps, your localhost:4000 should load your new theme instead of Minima. Let me know if any of these steps don’t work—I can help troubleshoot further!
内容的提问来源于stack exchange,提问作者bortman

