Open9
Gatsby + Netlify CMS
ここで Stars
順に並べて先頭に見つかった Gatsby Starter Netlify CMS
を試してみる。
Gatsby + Netlify CMS Starter
READMEにあるボタン Deploy to Netlify
をクリック。
GitHubのAuthenticationを経てサイトの構築が始まる。
GitHubに追加されたリポジトリを確認してローカルで立ち上げてみる。
git clone https://github.com/[GITHUB_USERNAME]/[REPO_NAME].git
cd [REPO_NAME]
yarn
netlify dev # or ntl dev
その前に netlify cli
が必要でした。
Get started with Netlify CLI
npm install netlify-cli -g
source ~/.zshrc
yarn install
netlify dev
ローカルでサイトの起動を確認しました。
Gatsbyをv3にアップグレードしてgatsby-blog-starterもアップグレードした
こちらを参考にpluginsのバージョンをチェック。
npm outdated
Package Current Wanted Latest Location
gatsby-plugin-netlify 3.14.0 3.14.0 4.2.0 gatsby-starter-netlify-cms
gatsby-remark-relative-images 0.3.0 0.3.0 2.0.2 gatsby-starter-netlify-cms
react 17.0.2 17.0.2 18.0.0 gatsby-starter-netlify-cms
react-dom 17.0.2 17.0.2 18.0.0 gatsby-starter-netlify-cms
"gatsby-remark-relative-images-v2": "^0.1.5"
Problem with markdown images, using the Kaldi starter (Gatsby image not working properly)
gatsby-config.js
gatsby-node.js
Package subpath './umd/react.production.min.js' is not defined
node のバージョンを確認
node -v
v14.19.1
node install 14.18.1
nodenv global 14.18.1
nodeバージョンを変えたのでパッケージを入れ直し。
npm install netlify-cli -g
source ~/.zshrc
npm install
netlify dev
ローカルで動かす場合の参考記事
ローカルホストでGitHubの環境を汚さずにNetlify CMSをテストする