Gatsby로 블로그 만들기

Danbi Cho·2020년 5월 24일
0

Session

목록 보기
8/9

static blog
블로그 작성하면 파일 전체가 생성 / 물리적으로 사용자가 가지고 있을 수 있다
블로그를 작성하면 git에 배포(daploy)한다.

도메인 (영문 주소)

npm (node package manager)

npm install -g gatsby-cli
-g : 전역에 설치 (어느 위치, 터미널에서 gatsby 명령어 사용 가능)
cli : command line interface

설치할 때 (npm, yarn을 선택 하는데 mac에서는 yarn을 자동으로 선택)
npm run develop 명령어에서 에러가 난다.

npm install -g yarn (yarn을 설치 해준다)

배포

config.js에서 url을 내 도메인 주소로 바꾼다.
"deploy": "yarn run clean && gatsby build && gh-pages -d public -b master",

github에 repository를 만들어

git remote add origin https://github.com/danbiicho/danbiicho.github.io.git

git remote -v :

블로그 쓰기
1. Content/post/파일이름.md (기존 파일 복사해서 사용 / 제목 : 날짜별로 하는 것이 좋다)
title / date /
draft: true (이 글은 배포가 되지 않는다)
slug: 도메인 뒤에 /

  1. develop에 add commit push
    ------ 배포 전
  2. npm run deploy (나는 yarn이므로 yarn deploy)
    md 파일 -> html 파일로 변경
profile
룰루랄라! 개발자 되고 싶어요🙈

0개의 댓글