VuePress ์‚ฌ์ดํŠธ ๋ฐฐํฌํ•˜๊ธฐ ์ ˆ์ฐจ

VuePress๋กœ ๊ทธ๋‚  ๊ทธ๋‚  ๋ฐฐ์šด ๋‚ด์šฉ์„ ์ •๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด ํ•™์Šต ๋…ธํŠธ ์‚ฌ์ดํŠธ๋ฅผ ์ œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.

์‚ฌ์ดํŠธ ๋ฐฐํฌ ํ•˜๊ธฐ ์ ˆ์ฐจ

  1. ๊นƒํ—™ ๊ณ„์ • ์ƒ์„ฑ
  2. ๊นƒํ—™ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ ์ƒ์„ฑ
  3. ์ƒ์„ฑํ•œ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ๋ฅผ ํด๋ก 
# ํ•™์Šต ๋…ธํŠธ๋ฅผ ๊ด€๋ฆฌํ•  ํด๋”์˜ ์œ„์น˜์—์„œ ์•„๋ž˜ ๋ช…๋ น์–ด ์ž…๋ ฅ
git clone '์ƒ์„ฑํ•œ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ ํด๋ก  ์ฃผ์†Œ'
  1. ํด๋ก ๋œ ํ”„๋กœ์ ํŠธ ์œ„์น˜๋กœ ์ด๋™
cd 'ํด๋ก ํ•ด์„œ ์ƒ์„ฑ๋œ ํด๋” ์ด๋ฆ„'
  1. ํ”„๋กœ์ ํŠธ์—์„œ docs ํด๋” ์ƒ์„ฑ
  2. ํ”„๋กœ์ ํŠธ์—์„œ ์•„๋ž˜์™€ ๊ฐ™์€ ๋ช…๋ น์–ด๋ฅผ ์ˆœ์„œ๋Œ€๋กœ ์ž…๋ ฅ
npm init -y
npm install -D vuepress

๋งŒ์•ฝ permission ๊ด€๋ จ๋œ ์˜ค๋ฅ˜๊ฐ€ ๋‚  ๊ฒฝ์šฐ์—๋Š” npm install -D vuepress ๋Œ€์‹ ์— sudo npm install -D vuepress ์ž…๋ ฅํ•˜์„ธ์š”.

  1. package.json ํŒŒ์ผ์˜ ๋‚ด์šฉ์„ ์•„๋ž˜์™€ ๊ฐ™์ด ์ˆ˜์ •
{
  ...
  "scripts": {
    "doc": "vuepress dev docs",
    "build": "vuepress build docs"
  },
  ...
}
  1. docs ํด๋” ๋ฐ‘์— README.md ํŒŒ์ผ์„ ์ƒ์„ฑํ•˜๊ณ  ์•„๋ž˜์˜ ๋‚ด์šฉ์„ ์ถ”๊ฐ€
# Vue.js ์ •๋ณต ์บ ํ”„ ํ•™์Šต ๋…ธํŠธ!!
  1. ํด๋ก ๋œ ํ”„๋กœ์ ํŠธ ํด๋” ๋ฐ‘์— deploy.sh ํŒŒ์ผ์„ ์ถ”๊ฐ€ํ•˜๊ณ  ์•„๋ž˜ ๋‚ด์šฉ ์‚ฝ์ž…
#!/usr/bin/env sh

# abort on errors
set -e

# build
npm run build

# navigate into the build output directory
cd docs/.vuepress/dist

# if you are deploying to a custom domain
# echo 'www.example.com' > CNAME

git init
git add -A
git commit -m 'deploy with vuepress'

# if you are deploying to https://<USERNAME>.github.io
# git push -f git@github.com:<USERNAME>/<USERNAME>.github.io.git master

# if you are deploying to https://<USERNAME>.github.io/<REPO>
git push -f <๋ทฐ ํ”„๋ ˆ์Šค๋ฅผ ์œ„ํ•ด ์ƒ์„ฑํ•œ ๊นƒํ—™ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์˜ ํด๋ก  ์ฃผ์†Œ> master:gh-pages

cd -

์œ„์—์„œ <๋ทฐ ํ”„๋ ˆ์Šค๋ฅผ ์œ„ํ•ด ์ƒ์„ฑํ•œ ๊นƒํ—™ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์˜ ํด๋ก  ์ฃผ์†Œ>๋Š” ๊ผญ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์˜ ์ฃผ์†Œ๋กœ ๋ณ€๊ฒฝํ•ด์ฃผ์…”์•ผ ํ•ฉ๋‹ˆ๋‹ค.

  1. ํ”„๋กœ์ ํŠธ ํด๋”์˜ ์œ„์น˜์—์„œ sh deploy.sh๋ฅผ ์‹คํ–‰ํ•˜์—ฌ ์‚ฌ์ดํŠธ ๋ฐฐํฌ

sh๋ผ๋Š” ๋ช…๋ น์–ด๋Š” ์œˆ๋„์šฐ ๊ธฐ๋ณธ ๋ช…๋ น์–ด ํ”„๋กฌํ”„ํŠธ ์ฐฝ์—์„œ ๋จน์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ cmder์ด๋ผ๋Š” ์ฝ˜์†” ํ”„๋กœ๊ทธ๋žจ์„ ์„ค์น˜ํ•ด์„œ ์‹คํ–‰ํ•˜๊ฑฐ๋‚˜ git bash์™€ ๊ฐ™์€ ๋ณ„๋„์˜ ์ฝ˜์†”์ฐฝ์„ ์‚ฌ์šฉํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค ๐Ÿ˜ƒ

  1. ๋ธŒ๋ผ์šฐ์ €์— https://<USERNAME>.github.io/<REPO> ์ž…๋ ฅ ํ›„ ์‚ฌ์ดํŠธ ํ™•์ธ (๋ณดํ†ต 5~10๋ถ„ ์†Œ์š”)