mmistakes / minimal-mistakes

:triangular_ruler: Jekyll theme for building a personal site, blog, project documentation, or portfolio.
https://mmistakes.github.io/minimal-mistakes/
MIT License
12.48k stars 25.74k forks source link

Theme works. But not in locally. #2136

Closed niklasjang closed 5 years ago

niklasjang commented 5 years ago

At First, thank you for your great works.

Goal : I want to check my post.md in local before Push

Work well in general.

I forked your repo and customized somewhat. I can post on my blog and some features are work very well. image

But not in local.

But when I my blog on local, theme is not working.

bundle exec jekyll serve

this commend is work. But when I open localhost:4000...

image

I think it is not duplicated question. Almost everyone is in reverse situation of mine.

_pages: image

my Gemfile:

source "https://rubygems.org" gem "minimal-mistakes-jekyll" gem "jekyll", "~> 3.6.2" gem "rake", "~> 12.3.0" group :jekyll_plugins do gem "jekyll-feed" gem "jekyll-seo-tag" gem "jekyll-sitemap" gem "jekyll-paginate" gem "jekyll-algolia" gem 'jemoji' gem "tzinfo" gem "tzinfo-data" gem "jekyll-include-cache" gem "jekyll-archives" end

mmistakes commented 5 years ago

I would strongly discourage anyone from forking the Minimal Mistakes theme repo. Aside the fact that it's difficult to manage updates, it also requires many config edits.

There are folders, files, configurations, Gemfile contents, and more that are setup in a way that are only applicable to the theme gem and developing it. This is why I encourage installing the theme using the remote_theme method and forking this starter instead.

It has the bare minimum of configuration and sample posts to get you started quickly. Give that a try instead.

The reason I think you're having issues is your Gemfile isn't correct. Most of it doesn't apply when you're hosting with GitHub Pages because they don't allow a lot of the 3rd party gems you're trying to install. The biggest difference is gem "jekyll" is replaced with gem "github-pages" which loads a specific version of Jekyll (and approved plugins).

One of it's dependencies loads a bunch of metadata directly from your repo and uses that to populate url and baseurl configs in your _config.yml automatically. This is likely why your site works on GitHub Pages, but is broken locally... the path to your CSS file is wrong so you get a site without a stylesheet.

Using the github-pages gem will mimic the environment of your hosted site which should either work or point out any issues.

This is a long way of me saying, don't fork the theme repo, but instead use the starter instead since that has a GitHub Pages Gemfile ready to go.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity.

If this is a bug and you can still reproduce this error on the master branch, please reply with any additional information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in 7 days if no further activity occurs. Thank you for all your contributions.