GitHub Blog 생성하기

Github blog를 생성하기 위한 단계 기록


순서

GitHub 가입 및 Repository 생성

GitHub 가입 시에 지정했던 username으로 github repository를 생성한다.

Repository name : username.github.io

ex) sloth-bear.github.io

http://{username}.github.io

참조: 웹호스팅 (github pages)

jekyll 설치

    $ sudo install jekyll 

설명 참조: https://help.github.com/en/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll

github에 만든 원격 repository를 내 pc로 복제

    $ git clone https://github.com/sloth-bear/sloth-bear.github.io.git

Create a new Jekyll site

    $ jekyll new .
    
    Your user account isn't allowed to install to the system RubyGems.
      You can cancel this installation and run:
    
          bundle install --path vendor/bundle
    
      to install the gems into ./vendor/bundle/, or you can enter your password
      and install the bundled gems to RubyGems using sudo.
  • Test to serve
      $ jekyll serve
    
    • http://localhost:4000 으로 접속
    • cf) Welcome to Jekyll! 글을 확인해보면 포스팅에 관해 작성되어있음

git push

    $ git add .
    $ git commit -m "init github pages"
    $ git push -u origin master
  • github pages 접속 테스트 -> https://sloth-bear.github.io/

  • 글쓰기
    • _post에 마크다운을 사용해 작성
    • 파일명: 2020-03-21-how-to-create-github-blog.md
  • Git Push
      $ git add .
      $ git commit -m "Create a new post"
      $ git push