Posts Github Blog 관련 FAQ
Post
Cancel

Github Blog 관련 FAQ

1. 구글 검색 활성화

1.1 Activate sitemap

Modify _config.yml

1
plugins: ['jekyll-paginate', 'jekyll-sitemap', 'jekyll-include-cache', 'jekyll-gist']

1.2 Add robots.txt

User-agent: *
Allow:/

Sitemap: https://jayleekr.github.io/sitemap.xml

1.3 Register sitemap to google search console

  1. Go to https://www.google.com/webmasters
  2. Click SEARCH CONSOLE

2. Jekyll 관련

2.1 로컬에서 blog를 테스트하기위한 Dependency들 설치

1
2
$ sudo apt-get install -y gem 
$ sudo gem install jekyll bundler tzinfo tzinfo-data minima 

2.2 Theme 설치

minimal-mistakes 를 설치해보도록 하겠다.

  1. 먼저 Gemfile 에 설치하고자 하는 minimal-mistakes 테마를 추가해주자
1
gem "minimal-mistakes-jekyll"
  1. bundle을 설치하자.
    1
    
    $ bundle install 
    
  2. _config.yml 파일에 theme를 추가하자
    1
    
    theme : minimal-mistakes-jekyll
    

2.3 Jekyll 실행

1
2
3
4
5
6
7
8
9
10
11
$ jekyll serve
Configuration file: /home/jayleekr/workspace/00_codes/07_blog/_config.yml
            Source: /home/jayleekr/workspace/00_codes/07_blog
       Destination: /home/jayleekr/workspace/00_codes/07_blog/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
                    done in 0.823 seconds.
 Auto-regeneration: enabled for '/home/jayleekr/workspace/00_codes/07_blog'
    Server address: http://127.0.0.1:4000
  Server running... press ctrl-c to stop.

2. Jekyll 버전 호환이슈

프로젝트의 버전과 설치한 Jekyll의 버전이 다를때 발생한다.

Gem 의 의존성을 모두 제거하면 해결가능하다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ sudo gem install bundler
$ bundle install
$ bundle exec jekyll serve
bundle exec jekyll serve
Configuration file: /home/jayleekr/workspace/00_codes/07_blog/_config.yml
            Source: /home/jayleekr/workspace/00_codes/07_blog
       Destination: /home/jayleekr/workspace/00_codes/07_blog/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
                    done in 0.823 seconds.
 Auto-regeneration: enabled for '/home/jayleekr/workspace/00_codes/07_blog'
    Server address: http://127.0.0.1:4000
  Server running... press ctrl-c to stop.
This post is licensed under CC BY 4.0 by the author.