๋ฒ๊ทธ ์ค๋ช
๊ฐ์ธ ๋น ๋น๋๊ฐ ์์๋์์ต๋๋ค. https://www.docz.site/docs/gatsby-theme#how -to-use์ ์ง์นจ์ ๋ฐ๋์ต๋๋ค.
๋ฒ๊ทธ๊ฐ ๋ฌด์์ธ์ง ๋ช ํํ๊ณ ๊ฐ๊ฒฐํ๊ฒ ์ค๋ช ํฉ๋๋ค.
์ ์ฌ์ ๋จน์ ๋ gatsby develop
.
์ฌํํ๋ ค๋ฉด
โ hello-gatsby git:(feature/add-documentation) gatsby develop
Configuring yargs through package.json is deprecated and will be removed in the
success open and validate gatsby-configs - 2.034 s
success load plugins - 0.970 s
Configuring yargs through package.json is deprecated and will be removed in the
success onPreInit - 0.312 s
success initialize cache - 0.006 s
success copy gatsby files - 0.066 s
success onPreBootstrap - 0.009 s
Configuring yargs through package.json is deprecated and will be removed in the
success source and transform nodes - 0.532 s
success building schema - 0.287 s
Configuring yargs through package.json is deprecated and will be removed in the
success createPages - 0.309 s
success createPagesStatefully - 0.036 s
success onPreExtractQueries - 0.002 s
success update schema - 0.041 s
ERROR
There was a problem parsing "/Users/laurentsutterlity/Works/hello-gatsby/node_modules/gatsby-theme-docz/templates/Layout.tpl.js"; any GraphQL fragments or queries in this file were not processed.
This may indicate a syntax error in the code, or it may be a file type that Gatsby does not know how to parse.
ERROR #85901 GRAPHQL
There was an error in your GraphQL query:
Error: RelayParser: Encountered duplicate defintitions for one or more documents: each document must have a unique name. Duplicated documents:
- DefaultSEOQuery
success extract queries from components - 8.357 s
success write out requires - 0.008 s
success write out redirect data - 0.002 s
success Build manifest and related icons - 0.137 s
success onPostBootstrap - 0.144 s
โ
info bootstrap finished - 17.704 s
โ
success run static queries - 0.002 s
success run page queries - 0.026 s โ 7/7 292.91 queries/second
DONE Compiled successfully in 6477ms 09:12:11
โ
You can now view hello-gatsby in the browser.
โ
http://localhost:8000/
โ
View GraphiQL, an in-browser IDE, to explore your site's data and schema
โ
http://localhost:8000/___graphql
โ
Note that the development build is not optimized.
To create a production build, use npm run build
ํ๊ฒฝ
์ด๊ฒ์ Gatsby์ ์ ๋ฒ์ ๊ณผ ๊ด๋ จ๋ ๋ฒ๊ทธ์
๋๋ค. ๋๋ ๊ทธ๋ค์ด ์ด๊ฒ์ ๊ณ ์น๊ธฐ ์ํด ๋
ธ๋ ฅํ๊ณ ์๋ค๊ณ ์๊ฐํฉ๋๋ค.
cc @pieh
์ฌ๊ธฐ์ ๋น์ทํ ๋ฌธ์
๊ฐ์ ๋ฌธ์ ๋ ์ํ๊น๊ฒ๋ ์ฌ์ ํ ์๋ ํ ์์๋ ์ด์ ๋ฒ์ ์ Gatsby๊ฐ ์๋์ง ๋๋ ์ด์ ๋ฒ์ ์ ๊ณ ๋ คํ๋ ๊ฒ์ด ์ข ์์ฑ ์๋ง์ธ์ง ์๊ณ ์์ต๋๊น?
Docz ํ ๋ง๋ฅผ ์ค์น ํ ํ ๋น์ทํ ๋ฌธ์ ๊ฐ ์์ต๋๋ค.
ํธ์ง : ์ฌ์ค, ๋๊ฐ์ ๋ฌธ์ ๊ฐ ์์ต๋๋ค.
ํด๊ฒฐ ๋ฐฉ๋ฒ์ด ์์ต๋๊น?
Docz ํ ๋ง๋ฅผ ์ค์น ํ ํ๋ ๋ง์ฐฌ๊ฐ์ง์ ๋๋ค.
ํธ์ง :์ด ๋ฌธ์ ์ ๋ํ ๋ด์ค๊ฐ ์์ต๋๊น?
v2๋ก ๋ง์ด๊ทธ๋ ์ด์ ์ ์๋ํ ํ์๋์ด ๋ฌธ์ ๊ฐ ๋ฐ์ํฉ๋๋ค. ๊ทธ๋ฆฌ๊ณ Gatsby์ ๊ด๋ จ๋ ๊ฒฝ์ฐ v1 ํ๊ทธ๊ฐ์๋ ์ด์ ๋ ๋ฌด์์ ๋๊น?
v2.0.0-rc.31
์์์ด ๋ฌธ์ ์ ์ง๋ฉด ํจ ๐ฌ
๋๊ตฐ๊ฐ v2๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ, gatsby๊ฐ ์ต์ ์ํ์ธ์ง ํ์ธํ๊ณ ๊ด์ฐฎ์ ๊ฒ์
๋๋ค. ์ด๋ค ์ด์ ๋ก ๋ v1 (๋์ ๊ฐ์)์ ๋ถ์ด์๋ ์ฌ๋์ด๋ผ๋ฉด docz gatsby์์ ํ์ผ์ ๋ณ๊ฒฝํ์ฌ ๋ก์ปฌ์์ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์ ์์ต๋๋ค. ํ
๋ง node_modules
์ ์ฃผ๋ ๋จ์ ์ ์ข
์์ฑ์ ์ถ๊ฐํ๊ฑฐ๋ ์
๋ฐ์ดํธ ํ ๋๋ง๋ค ์์ ์ฌํญ์ ๋ฎ์ด ์ฐ์ง๋ง, ์ ๋น๋์ ์ผ๋ถ๋ก ํ์ผ์ ๊ต์ฒดํ๋ ๊ฒ๋ง์ผ๋ก๋ ์์ ํ ์๋ํ ๋ ์ํ๋ก ์ ์งํ ์ ์๋ค๋ ๊ฒ์
๋๋ค.
์ฃผ๋ ๋ฌธ์ ๋ node_modules/gatsby-theme-docs/templates/Seo.js.tpl
ํ์ผ์ด ์ฟผ๋ฆฌ๋ฅผ ๋ด๋ณด๋ด๊ณ ๋ค๋ฅธ ํ์ผ์ ์์ฑํ๊ธฐ์ํ ํ
ํ๋ฆฟ์ผ๋ก ์๋๋์์ง๋ง ์ฌ์ ํ gatsby์ ์ํด ์ฒ๋ฆฌ๋๊ธฐ ๋๋ฌธ์ ์ฟผ๋ฆฌ ์ด๋ฆ์ด ์คํค๋ง์ ์ค๋ณต๋ฉ๋๋ค. ์ฆ ์ค๋ฅ . ๋ฐ๋ผ์ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋ ค๋ฉด ์ฟผ๋ฆฌ ์ด๋ฆ์ ์ฟผ๋ฆฌ์์ ์ ๊ฑฐํ๋ฉด๋ฉ๋๋ค. ์ฟผ๋ฆฌ ์ด๋ฆ์ ๋ณ์๋ฅผ ์ฌ์ฉํ ๋ graphql์์๋ง ํ์ํ๋ฏ๋ก์ด ์ฟผ๋ฆฌ์๋ ์ด๋ฆ์ด ํ์ํ์ง ์์ผ๋ฏ๋ก ํด๋น ํ์ผ์์ ๋ณ๊ฒฝํ๊ธฐ ๋งํ๋ฉด๋ฉ๋๋ค.
query DefaultSeoQuery {
์ผ๋ก
query {
์๋ฃจ์ ์ ๋ํด @jstacoder ์๊ฒ ๊ฐ์ฌ๋๋ฆฝ๋๋ค
@jstacoder ์ ์๋ฃจ์
์ ์ฌ์ฉํ์ฌ ๋น๋ ๋จ๊ณ์ ์ผ๋ถ๋ก node_modules
๋ฅผ ์ง์์ ์ผ๋ก ๋ณ๊ฒฝํ๋ ๊ฒฝ์ฐ patch-package
๋ฅผ ํ์ธํ์ญ์์ค.
์ด ๋ฌธ์ ๋ ์ต๊ทผ ํ๋์ด ์์๊ธฐ ๋๋ฌธ์ ์๋์ผ๋ก ์ค๋๋ ๊ฒ์ผ๋ก ํ์๋์์ต๋๋ค. ๋ ์ด์ ํ๋์ด ๋ฐ์ํ์ง ์์ผ๋ฉด ํ์๋ฉ๋๋ค. ๊ทํ์ ๊ธฐ์ฌ์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๋๊ตฐ๊ฐ v2๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ, gatsby๊ฐ ์ต์ ์ํ์ธ์ง ํ์ธํ๊ณ ๊ด์ฐฎ์ ๊ฒ์ ๋๋ค. ์ด๋ค ์ด์ ๋ก ๋ v1 (๋์ ๊ฐ์)์ ๋ถ์ด์๋ ์ฌ๋์ด๋ผ๋ฉด docz gatsby์์ ํ์ผ์ ๋ณ๊ฒฝํ์ฌ ๋ก์ปฌ์์ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์ ์์ต๋๋ค. ํ ๋ง
node_modules
์ ์ฃผ๋ ๋จ์ ์ ์ข ์์ฑ์ ์ถ๊ฐํ๊ฑฐ๋ ์ ๋ฐ์ดํธ ํ ๋๋ง๋ค ์์ ์ฌํญ์ ๋ฎ์ด ์ฐ์ง๋ง, ์ ๋น๋์ ์ผ๋ถ๋ก ํ์ผ์ ๊ต์ฒดํ๋ ๊ฒ๋ง์ผ๋ก๋ ์์ ํ ์๋ํ ๋ ์ํ๋ก ์ ์งํ ์ ์๋ค๋ ๊ฒ์ ๋๋ค.์ฃผ๋ ๋ฌธ์ ๋
node_modules/gatsby-theme-docs/templates/Seo.js.tpl
ํ์ผ์ด ์ฟผ๋ฆฌ๋ฅผ ๋ด๋ณด๋ด๊ณ ๋ค๋ฅธ ํ์ผ์ ์์ฑํ๊ธฐ์ํ ํ ํ๋ฆฟ์ผ๋ก ์๋๋์์ง๋ง ์ฌ์ ํ gatsby์ ์ํด ์ฒ๋ฆฌ๋๊ธฐ ๋๋ฌธ์ ์ฟผ๋ฆฌ ์ด๋ฆ์ด ์คํค๋ง์ ์ค๋ณต๋ฉ๋๋ค. ์ฆ ์ค๋ฅ . ๋ฐ๋ผ์ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋ ค๋ฉด ์ฟผ๋ฆฌ ์ด๋ฆ์ ์ฟผ๋ฆฌ์์ ์ ๊ฑฐํ๋ฉด๋ฉ๋๋ค. ์ฟผ๋ฆฌ ์ด๋ฆ์ ๋ณ์๋ฅผ ์ฌ์ฉํ ๋ graphql์์๋ง ํ์ํ๋ฏ๋ก์ด ์ฟผ๋ฆฌ์๋ ์ด๋ฆ์ด ํ์ํ์ง ์์ผ๋ฏ๋ก ํด๋น ํ์ผ์์ ๋ณ๊ฒฝํ๊ธฐ ๋งํ๋ฉด๋ฉ๋๋ค.์ผ๋ก