2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

gatsbyを使ってみる(プロジェクト作成からsurgeで公開まで)

Last updated at Posted at 2019-02-18

はじめに

gatsbyという静的サイトジェネレータを使ってみました。
その備忘録です。

gatsby

  • インストールする
yarn global add gatsby-cli
  • プロジェクトを作成する
gatsby new gatsby-site
  • 開発モード
yarn develop
  • ビルド
yarn build
  • surgeを入れる
yarn add -D surge
  • package.jsonにscriptを追加
"deploy": "surge public/"
  • surgeで公開
yarn deploy
  • https://godly-celery.surge.sh/にアクセス出来る様になる

  • ssl化するためにsurgeスクリプトを変更(http://~からhttps://~にリダイレクトされるようになる)

"deploy": "surge public/ https://godly-celery.surge.sh/"

テンプレートテーマを使ってみる

  • https://github.com/LekoArts/gatsby-starter-portfolio-emiliaを使う
gatsby new nz-memories https://github.com/LekoArts/gatsby-starter-portfolio-emilia

参考

  • 静的サイトジェネレーター一覧:https://www.staticgen.com/
  • gatsby公式:https://www.gatsbyjs.org/
  • surge公式:https://surge.sh/
  • surge日本語:https://surge-sh.cf/
2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?