7
6

More than 5 years have passed since last update.

JekyllでMinimal Mistakesのテーマを使う

Last updated at Posted at 2018-05-03

この記事の目的

  • JekyllでMinimal Mistakesのテーマを使ってブログを作る。
  • Github Pages で公開する。

手順

  1. Terminalから以下のコマンドでjekyllコマンドを入れる

    gem install bundler
    bundle add jekyll && bundle install
    
  2. https://github.com/mmistakes/minimal-mistakes のリポジトリを自分のgithubアカウントにFork

  3. フォークしたリポジトリの名前を「<username>.github.io」に変更(<username>の部分は自分のgithubのアカウント名)

  4. リポジトリをローカルにclone

  5. 以下のファイル・ディレクトリを削除

    • .editorconfig
    • .gitattributes
    • .github
    • /docs
    • /test
    • CHANGELOG.md
    • minimal-mistakes-jekyll.gemspec
    • README.md
    • screenshot-layouts.png
    • screenshot.png
  6. Gemfileを以下のように変更

    source "https://rubygems.org"
    
    gem "minimal-mistakes-jekyll"
    gem "github-pages", group: :jekyll_plugins
    
  7. _config.yml 内のthemeとremote_themeの部分を以下のように変更

    theme                  : "minimal-mistakes-jekyll"
    remote_theme           : "mmistakes/minimal-mistakes"
    
  8. bundle installコマンドを叩く(新しくgemを追加した場合はbundle update

  9. bundle exec jekyll serve コマンドでローカルでブログを立ち上げる(場合によって30秒ほどかかる)

  10. ブラウザでhttp://127.0.0.1:4000 にアクセスして確認。

  11. Github上のmasterにpushする(gh-pagesブランチを別途作る必要は特に無し)

  12. GithubからThe page build completed successfullyという内容のメールが届く(失敗していた場合はThe page build failed for themasterbranch with the following error:という内容のメールが届く)

  13. ブラウザで<username>.github.io にアクセスし、公開できていることを確認

ブログデザインの変更

https://mmistakes.github.io/minimal-mistakes/docs/configuration/
このサイトを見ながら_config.ymlを編集し、GitHubのリポジトリにpushすれば反映される。

参考

7
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6