๋ณธ๋ฌธ์œผ๋กœ ๊ฑด๋„ˆ๋›ฐ๊ธฐ

[Step by Step Tutorial] 01. Setup

Setup

์ด ํŠœํ† ๋ฆฌ์–ผ์˜ ๋ชฉ์ ์€ ํ”„๋ก ํŠธ์—”๋“œ ์›น ๊ฐœ๋ฐœ ๊ฒฝํ—˜์ด ์—†์–ด๋„ ๊ธฐ๋ณธ gem ๊ธฐ๋ฐ˜ ํ…Œ๋งˆ์— ์˜์กดํ•˜์ง€ ์•Š๊ณ  ์ฒ˜์Œ๋ถ€ํ„ฐ Jekyll ์‚ฌ์ดํŠธ๋ฅผ ๊ตฌ์ถ•ํ•˜๋„๋ก ํ•˜๋Š” ๊ฒƒ์ด๋‹ค.


์„ค์น˜#


Jekyll์€ Ruby ํ”„๋กœ๊ทธ๋žจ์ด๋ฏ€๋กœ ๋จผ์ € ์ปดํ“จํ„ฐ์— Ruby๋ฅผ ์„ค์น˜ํ•ด์•ผํ•œ๋‹ค.

Installation

Ruby ์„ค์ •์„ ์‚ฌ์šฉํ•˜๋ฉด ํ„ฐ๋ฏธ๋„์—์„œ ๋‹ค์Œ์„ ์‹คํ–‰ํ•˜์—ฌ Jekyll์„ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ๋‹ค.

gem install jekyll bundler

๋จผ์ € Jekyll ํŠœํ† ๋ฆฌ์–ผ์„ ์ง„ํ–‰ํ•  ๋ฃจํŠธ ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ํ•˜๋‚˜ ๋งŒ๋“ ๋‹ค

mkdir first-jekyll-projectcd first-jekyll-project

ํ”„๋กœ์ ํŠธ์˜ dependencies list๋ฅผ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด ์ƒˆ๋กœ Gemfile ์„ ๋งŒ๋“ ๋‹ค.

bundle init

Gemfile ์— jekyll ์„ dependency๋กœ ์ถ”๊ฐ€ํ•œ๋‹ค (vi, vim์„ ์ด์šฉ)

gem "jekyll"

bundle ์„ ์‹คํ–‰ํ•œ๋‹ค

bundle

Gemfile.lock ํŒŒ์ผ์ด ์ƒ์„ฑ๋œ ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

2020-01-21-step-by-step-tutorial-01-setup-image-0


์‚ฌ์ดํŠธ ๋งŒ๋“ค๊ธฐ#


index.html ์„ ์ƒ์„ฑํ•˜๊ณ  ์•„๋ž˜๋ฅผ ์ž…๋ ฅํ•œ๋‹ค.

<!DOCTYPE html><html>    <head>        <meta charset="utf-8" />        <title>Home</title>    </head>    <body>        <h1>Hello World!</h1>    </body></html>

๋นŒ๋“œ#


  • jekyll build - jekyll์ด ๋นŒ๋“œํ•˜์—ฌ staticํ•œ site๋ฅผ _site ๋””๋ ‰ํ† ๋ฆฌ์— ๋‚ด๋ณด๋‚ธ๋‹ค .

  • jekyll serve - ๋นŒ๋“œ๋ฅผ ํ•˜๊ณ , ๋กœ์ปฌ ์›น ์„œ๋ฒ„๋ฅผ ์‹คํ–‰ํ•œ๋‹ค. ๋ธŒ๋ผ์šฐ์ €์—์„œ http://localhost:4000/ ๋กœ ์ ‘์†ํ•˜๋ฉด ๊ฒฐ๊ณผ๋ฅผ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.