Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

로컬에서 블로그 확인하기 #3

Open
seopbo opened this issue May 1, 2021 · 0 comments
Open

로컬에서 블로그 확인하기 #3

seopbo opened this issue May 1, 2021 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@seopbo
Copy link
Member

seopbo commented May 1, 2021

이 글의 안내에 따라 글을 작성하고 해당 마크다운 문서를 _posts 디렉토리에 커밋하기만 하면 블로그에 자동으로 해당 글이 추가됩니다.
다만 커밋하기에 앞서 해당 원고가 어떻게 퍼블리시되는지 확인해보고 싶을 때가 있을 수 있습니다.
이를 위해서는 루비(ruby), 지킬(jekyll) 등 관련 패키지들을 설치해야 합니다.
MacOS에서 다음 순서대로 설치하면 됩니다.

  • ruby 설치
brew install rbenv
rbenv init
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
rbenv install 2.7.0
rbenv global 2.7.0
# 위의 스크립트를 실행한 뒤 ~/.bash_profile 등에 아래 라인 추가
# eval "$(rbenv init -)"
  • jekyll 설치 : 위의 ruby 설치 커맨드를 모두 실행하면 터미널을 다시 실행해 아래를 수행합니다.
gem install --user-install bundler jekyll
# 위의 스크립트를 실행한 뒤 ~/.bash_profile 등에 아래 라인 추가
# export PATH="$HOME/.gem/ruby/2.7.0/bin:$PATH"
  • 블로그 의존성 패키지 설치 : 위의 jekyll 설치 커맨드를 모두 실행하면 터미널을 다시 실행해 아래를 수행합니다.
# 현 리포(blog)의 루트로 이동 (예) cd blog
bundle install
bundle exec jekyll serve

이제 모든 준비가 끝났습니다.
원고를 작성한 뒤 다음 현 리포의 루트에서 다음 커맨드를 실행하면 http://0.0.0.0:4000에서 해당 원고가 실제로 어떻게 퍼블리시되는지 확인해볼 수 있습니다.
이 확인에서 문제가 없으면 해당 원고를 푸시하면 됩니다.

# 현 리포(blog)의 루트로 이동 (예) cd blog
bundle exec jekyll serve
@seopbo seopbo added the documentation Improvements or additions to documentation label May 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant