Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
98233b91
Unverified
Commit
98233b91
authored
May 02, 2020
by
Stefan Judis
Committed by
GitHub
May 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Examples] Improve Contentful example starter and docs (#12351)
parent
5808221f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1071 additions
and
25 deletions
+1071
-25
README.md
examples/cms-contentful/README.md
+91
-24
export.json
examples/cms-contentful/contentful/export.json
+955
-0
setup.js
examples/cms-contentful/contentful/setup.js
+22
-0
content-entry-preview.jpg
examples/cms-contentful/docs/content-entry-preview.jpg
+0
-0
content-entry-publish.jpg
examples/cms-contentful/docs/content-entry-publish.jpg
+0
-0
content-model-overview.jpg
examples/cms-contentful/docs/content-model-overview.jpg
+0
-0
content-preview-setup.jpg
examples/cms-contentful/docs/content-preview-setup.jpg
+0
-0
package.json
examples/cms-contentful/package.json
+3
-1
No files found.
examples/cms-contentful/README.md
View file @
98233b91
This diff is collapsed.
Click to expand it.
examples/cms-contentful/contentful/export.json
0 → 100644
View file @
98233b91
This diff is collapsed.
Click to expand it.
examples/cms-contentful/contentful/setup.js
0 → 100644
View file @
98233b91
const
spaceImport
=
require
(
'contentful-import'
)
const
exportFile
=
require
(
'./export.json'
)
const
[
CONTENTFUL_SPACE_ID
,
CONTENTFUL_MANAGEMENT_TOKEN
]
=
process
.
argv
.
slice
(
2
)
if
(
!
CONTENTFUL_SPACE_ID
||
!
CONTENTFUL_MANAGEMENT_TOKEN
)
{
throw
new
Error
(
[
'Parameters missing...'
,
'Please run the setup command as follows'
,
'CONTENTFUL_SPACE_ID=XXX CONTENTFUL_MANAGEMENT_TOKEN=CFPAT-XXX npm run setup'
,
].
join
(
'
\
n'
)
)
}
spaceImport
({
spaceId
:
CONTENTFUL_SPACE_ID
,
managementToken
:
CONTENTFUL_MANAGEMENT_TOKEN
,
content
:
exportFile
,
})
.
then
(()
=>
console
.
log
(
'The content model of your space is set up!'
))
.
catch
(
e
=>
console
.
error
(
e
))
examples/cms-contentful/docs/content-entry-preview.jpg
0 → 100644
View file @
98233b91
93.5 KB
examples/cms-contentful/docs/content-entry-publish.jpg
0 → 100644
View file @
98233b91
84.6 KB
examples/cms-contentful/docs/content-model-overview.jpg
0 → 100644
View file @
98233b91
107 KB
examples/cms-contentful/docs/content-preview-setup.jpg
0 → 100644
View file @
98233b91
446 KB
examples/cms-contentful/package.json
View file @
98233b91
...
@@ -4,7 +4,8 @@
...
@@ -4,7 +4,8 @@
"scripts"
:
{
"scripts"
:
{
"dev"
:
"next"
,
"dev"
:
"next"
,
"build"
:
"next build"
,
"build"
:
"next build"
,
"start"
:
"next start"
"start"
:
"next start"
,
"setup"
:
"node ./contentful/setup.js $CONTENTFUL_SPACE_ID $CONTENTFUL_MANAGEMENT_TOKEN"
},
},
"dependencies"
:
{
"dependencies"
:
{
"@contentful/rich-text-react-renderer"
:
"13.4.0"
,
"@contentful/rich-text-react-renderer"
:
"13.4.0"
,
...
@@ -17,6 +18,7 @@
...
@@ -17,6 +18,7 @@
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"@fullhuman/postcss-purgecss"
:
"^2.1.0"
,
"@fullhuman/postcss-purgecss"
:
"^2.1.0"
,
"contentful-import"
:
"^7.7.12"
,
"dotenv"
:
"8.2.0"
,
"dotenv"
:
"8.2.0"
,
"postcss-preset-env"
:
"^6.7.0"
,
"postcss-preset-env"
:
"^6.7.0"
,
"tailwindcss"
:
"^1.2.0"
"tailwindcss"
:
"^1.2.0"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment