Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

Commit

Permalink
Migrated to gatsby-source-prismic
Browse files Browse the repository at this point in the history
  • Loading branch information
pvpg committed Mar 1, 2021
0 parents commit 0216715
Show file tree
Hide file tree
Showing 87 changed files with 23,681 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"env": {
"browser": true,
"es6": true
},
"extends": [
"plugin:react/recommended",
"airbnb"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"no-underscore-dangle": "off",
"no-use-before-define": "off",
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"react/no-array-index-key": "off",
"react/prop-types": "off",
"semi": ["error", "never"],
"react/destructuring-assignment": "off",
"jsx-a11y/click-events-have-key-events":"off",
"jsx-a11y/no-static-element-interactions":"off",
"react/no-access-state-in-setstate":"off"
}
}
69 changes: 69 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# dotenv environment variables file
.env

# gatsby files
.cache/
public

# Mac files
.DS_Store

# Yarn
yarn-error.log
.pnp/
.pnp.js
# Yarn Integrity file
.yarn-integrity
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# registry.npmjs.org/:_authToken=${NPM_TOKEN}
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"endOfLine": "lf",
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5"
}
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2015 gatsbyjs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## Example website with Prismic and Gatsby

Example website demo that shows how to use the `gatsby-source-prismic` plugin.

It showcases how a website for a coffee store could be designed and built, as well as the techniques you will have to use to generate pages dynamically when using a Prismic repository as a data source, while also being able to use the **preview** and **release** features.

For more information, refer to the [official Prismic and Gatsby documentation](https://prismic.io/docs/technologies/gatsby).

#
## Demo website

A deployment demo is available in Netlify: https://gatsby-coffee-demo.netlify.com/
#
## 1. Launch the project

### Install the CLI
```
npm install -g prismic-cli
```

### Run the theme command
navigate where you want to create your new project folder and run the following command:
```
prismic theme --theme-url https://github.com/prismicio/prismic-gatsby-coffee-sample --conf prismic-configuration.js
```
This will create a new Prismic content repository, set up the custom types, create a few documents, and install the project code.

## 1. Run the project
```
gatsby develop
```
Your site should now be running locally at [http://localhost:8000](http://localhost:8000)!
#
### Building

```
gatsby build
```

### Serving built folder
```
gatsby serve
```
1 change: 1 addition & 0 deletions custom_types/author.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Main":{"name":{"type":"StructuredText","config":{"single":"paragraph","label":"Name"}},"bio":{"type":"StructuredText","config":{"single":"paragraph","label":"Bio"}},"picture":{"type":"Image","config":{"constraint":{},"thumbnails":[],"label":"Picture"}}}}
1 change: 1 addition & 0 deletions custom_types/blog_home.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"SEO & Social":{"meta_title":{"type":"StructuredText","config":{"single":"heading1","label":"Meta title","placeholder":"Meta title"}},"meta_description":{"type":"StructuredText","config":{"single":"paragraph","label":"Meta description","placeholder":"Meta description"}},"canonical_url":{"type":"StructuredText","config":{"label":"Canonical URL","placeholder":"Canonical URL"}},"body1":{"type":"Slices","fieldset":"Slice zone","config":{"choices":{"twitter_card":{"type":"Slice","fieldset":"Twitter card","description":"Fields you need to customize the Twitter Card","icon":"adjust","display":"list","non-repeat":{"card_title":{"type":"Text","config":{"label":"Title","placeholder":"Title for Twitter"}},"card_description":{"type":"Text","config":{"label":"Description","placeholder":"Description for Twitter"}},"card_image":{"type":"Image","config":{"constraint":{"width":1200,"height":630},"thumbnails":[],"label":"Image"}}},"repeat":{}},"facebook__open_graph_":{"type":"Slice","fieldset":"Facebook (Open Graph)","description":"Fields to customize OG cards","icon":"thumb_up","display":"list","non-repeat":{},"repeat":{}}}}}}}
1 change: 1 addition & 0 deletions custom_types/blog_post.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Main":{"title":{"type":"StructuredText","config":{"single":"heading1","label":"Title"}},"image":{"type":"Image","config":{"constraint":{},"thumbnails":[],"label":"Image"}},"rich_content":{"type":"StructuredText","config":{"multi":"paragraph, heading2, strong, em, hyperlink, image","allowTargetBlank":true,"label":"Rich content"}}},"SEO & Social":{"uid":{"type":"UID","config":{"label":"UID"}},"meta_title":{"type":"StructuredText","config":{"single":"heading1","label":"Meta title","placeholder":"Meta title"}},"meta_description":{"type":"StructuredText","config":{"single":"paragraph","label":"Meta description","placeholder":"Meta description"}},"canonical_url":{"type":"StructuredText","config":{"label":"Canonical URL","placeholder":"Canonical URL"}},"author":{"type":"Link","config":{"select":"document","customtypes":["author"],"label":"Author","placeholder":"Johnny McJohn"}},"body1":{"type":"Slices","fieldset":"Slice zone","config":{"choices":{"twitter_card":{"type":"Slice","fieldset":"Twitter card","description":"Fields you need to customize the Twitter Card","icon":"adjust","display":"list","non-repeat":{"card_title":{"type":"Text","config":{"label":"Title","placeholder":"Title for Twitter"}},"card_description":{"type":"Text","config":{"label":"Description","placeholder":"Description for Twitter"}},"card_image":{"type":"Image","config":{"constraint":{"width":1200,"height":630},"thumbnails":[],"label":"Image"}}},"repeat":{}},"facebook__open_graph_":{"type":"Slice","fieldset":"Facebook (Open Graph)","description":"Fields to customize OG cards","icon":"thumb_up","display":"list","non-repeat":{},"repeat":{}}}}}}}
1 change: 1 addition & 0 deletions custom_types/homepage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Main":{"title":{"type":"StructuredText","config":{"single":"heading1, strong","label":"Title","placeholder":"Title of the homepage"}},"banner_image":{"type":"Image","config":{"constraint":{},"thumbnails":[],"label":"Banner image"}},"banner_text":{"type":"StructuredText","config":{"multi":"paragraph, strong","label":"Banner text","placeholder":"Coffee, reimagined. Enjoy your coffee like you never did before..."}},"body":{"type":"Slices","fieldset":"Slice zone","config":{"choices":{"featured_items":{"type":"Slice","fieldset":"Featured items","description":"Set of featured items with illustration, title, description and CTA","icon":"star","display":"grid","non-repeat":{"section_title":{"type":"StructuredText","config":{"single":"heading2","label":"Section title","placeholder":"Our smart algorithms picks ..."}},"button_label":{"type":"StructuredText","config":{"single":"paragraph","label":"Button Label","placeholder":"Visit Shop"}},"button_link":{"type":"Link","config":{"label":"Button Link","placeholder":"Choose your link"}}},"repeat":{"link_to_product":{"type":"Link","config":{"select":"document","customtypes":["product"],"label":"Link to product","placeholder":"Select a product"}}}},"cta_banner":{"type":"Slice","fieldset":"CTA Banner","description":"A wide banner with text and button","icon":"chrome_reader_mode","display":"list","non-repeat":{"image_banner":{"type":"Image","config":{"constraint":{},"thumbnails":[],"label":"Image Banner"}},"banner_title":{"type":"StructuredText","config":{"single":"heading2","label":"Banner title","placeholder":"Our story"}},"banner_text":{"type":"StructuredText","config":{"single":"paragraph","label":"Banner text","placeholder":"It all started in 1999 ..."}},"cta_label":{"type":"Text","config":{"label":"CTA label","placeholder":"You'll never guess ...."}},"cta_link":{"type":"Link","config":{"label":"CTA link","placeholder":"CTA link","allowTargetBlank":true}}},"repeat":{}},"big_bullet_item":{"type":"Slice","fieldset":"Item with numbers","description":"1 number and description in a grid layout","icon":"filter_1","display":"grid","non-repeat":{"title_section":{"type":"StructuredText","config":{"single":"heading2","label":"Title Section","placeholder":"How it works ..."}}},"repeat":{"description_paragraph":{"type":"StructuredText","config":{"multi":"paragraph, strong, em","label":"Description paragraph","placeholder":"Select some amazing coffee"}}}},"text_block":{"type":"Slice","fieldset":"Text block","description":"Text block","icon":"text_fields","display":"list","non-repeat":{"title1":{"type":"StructuredText","config":{"single":"heading2","label":"Title","placeholder":"Philosophy"}},"paragraph":{"type":"StructuredText","config":{"multi":"paragraph","label":"Paragraph","placeholder":"We believe that having a good cup of coffee ..."}}},"repeat":{}},"separator":{"type":"Slice","fieldset":"Separator","description":"Separator","icon":"remove","display":"list","non-repeat":{},"repeat":{}}}}}},"SEO & Social":{"display_name":{"type":"StructuredText","config":{"useAsTitle":true,"single":"paragraph","label":"Display name","placeholder":"Display name"}},"meta_title":{"type":"StructuredText","config":{"single":"heading1","label":"Meta title","placeholder":"Meta title"}},"meta_description":{"type":"StructuredText","config":{"single":"paragraph","label":"Meta description","placeholder":"Meta description"}},"canonical_url":{"type":"StructuredText","config":{"label":"Canonical URL","placeholder":"Canonical URL"}},"body1":{"type":"Slices","fieldset":"Slice zone","config":{"choices":{"twitter_card":{"type":"Slice","fieldset":"Twitter card","description":"Fields you need to customize the Twitter Card","icon":"adjust","display":"list","non-repeat":{"card_title":{"type":"Text","config":{"label":"Title","placeholder":"Title for Twitter"}},"card_description":{"type":"Text","config":{"label":"Description","placeholder":"Description for Twitter"}},"card_image":{"type":"Image","config":{"constraint":{"width":1200,"height":630},"thumbnails":[],"label":"Image"}}},"repeat":{}},"facebook__open_graph_":{"type":"Slice","fieldset":"Facebook (Open Graph)","description":"Fields to customize OG cards","icon":"thumb_up","display":"list","non-repeat":{},"repeat":{}}}}}}}
1 change: 1 addition & 0 deletions custom_types/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"id":"landing_page","name":"Landing Page","repeatable":true,"value":"landing_page.json"},{"id":"homepage","name":"Homepage","repeatable":false,"value":"homepage.json"},{"id":"product","name":"Product","repeatable":true,"value":"product.json"},{"id":"layout","name":"Layout","repeatable":false,"value":"layout.json"},{"id":"author","name":"Author","repeatable":true,"value":"author.json"},{"id":"products","name":"Products List","repeatable":false,"value":"products.json"},{"id":"blog_post","name":"Blog Post","repeatable":true,"value":"blog_post.json"},{"id":"blog_home","name":"Blog Home Metadata","repeatable":false,"value":"blog_home.json"}]
1 change: 1 addition & 0 deletions custom_types/landing_page.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Main":{"title":{"type":"StructuredText","config":{"single":"heading1, strong","label":"Title","placeholder":"Title"}},"body":{"type":"Slices","fieldset":"Slice zone","config":{"labels":{"product_quote":[{"name":"normal","display":"Text left - Image right (default)"},{"name":"reverse","display":"Text right - Image left"}]},"choices":{"big_bullet_item":{"type":"Slice","fieldset":"Item with numbers","description":"1 number and description in a grid layout","icon":"filter_1","display":"grid","non-repeat":{"title_section":{"type":"StructuredText","config":{"single":"heading2","label":"Title Section","placeholder":"How it works ..."}}},"repeat":{"description_paragraph":{"type":"StructuredText","config":{"multi":"paragraph, strong, em","label":"Description paragraph","placeholder":"Select some amazing coffee"}}}},"banner_split":{"type":"Slice","fieldset":"Banner split","description":"Banner image with splitted text","icon":"image","display":"list","non-repeat":{"banner_image":{"type":"Image","config":{"constraint":{},"thumbnails":[],"label":"Image"}},"banner_title":{"type":"StructuredText","config":{"single":"heading2","label":"Title"}},"banner_text":{"type":"StructuredText","config":{"single":"paragraph","label":"Text"}}},"repeat":{}},"product_quote":{"type":"Slice","fieldset":"Product + quote","description":"Product + quote","icon":"format_quote","display":"list","non-repeat":{"quote_background":{"type":"Image","config":{"constraint":{},"thumbnails":[],"label":"Quote background"}},"quote_text":{"type":"StructuredText","config":{"single":"paragraph","label":"Quote text"}},"quote_author":{"type":"StructuredText","config":{"single":"paragraph","label":"Quote author"}},"product_image":{"type":"Image","config":{"constraint":{},"thumbnails":[],"label":"Product image"}},"product_description":{"type":"StructuredText","config":{"single":"paragraph","label":"Product description"}}},"repeat":{}}}}}},"SEO & Social":{"uid":{"type":"UID","config":{"label":"Slug for url","placeholder":"uid"}},"meta_title":{"type":"StructuredText","config":{"single":"heading1","label":"Meta title","placeholder":"Meta title"}},"meta_description":{"type":"StructuredText","config":{"single":"paragraph","label":"Meta description","placeholder":"Meta description"}},"canonical_url":{"type":"StructuredText","config":{"label":"Canonical URL","placeholder":"Canonical URL"}},"body1":{"type":"Slices","fieldset":"Slice zone","config":{"choices":{"twitter_card":{"type":"Slice","fieldset":"Twitter card","description":"Fields you need to customize the Twitter Card","icon":"adjust","display":"list","non-repeat":{"card_title":{"type":"Text","config":{"label":"Title","placeholder":"Title for Twitter"}},"card_description":{"type":"Text","config":{"label":"Description","placeholder":"Description for Twitter"}},"card_image":{"type":"Image","config":{"constraint":{"width":1200,"height":630},"thumbnails":[],"label":"Image"}}},"repeat":{}},"facebook__open_graph_":{"type":"Slice","fieldset":"Facebook (Open Graph)","description":"Fields to customize OG cards","icon":"thumb_up","display":"list","non-repeat":{},"repeat":{}}}}}}}
1 change: 1 addition & 0 deletions custom_types/layout.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Header":{"site_name":{"type":"Text","config":{"label":"Site name"}},"header_nav_items":{"type":"Group","config":{"fields":{"text":{"type":"Text","config":{"label":"Text"}},"link":{"type":"Link","config":{"label":"Link"}}},"label":"Header navigation items"}}},"Footer":{"footer_nav_items":{"type":"Group","config":{"fields":{"text":{"type":"Text","config":{"label":"Text"}},"link":{"type":"Link","config":{"label":"Link"}}},"label":"Footer navigation items"}},"footer_social_items":{"type":"Group","config":{"fields":{"icon":{"type":"Image","config":{"constraint":{},"thumbnails":[],"label":"Icon"}},"link":{"type":"Link","config":{"allowTargetBlank":true,"label":"Link"}}},"label":"Footer social items"}}}}
1 change: 1 addition & 0 deletions custom_types/product.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Main":{"product_image":{"type":"Image","config":{"constraint":{},"thumbnails":[],"label":"Product Image"}},"product_name":{"type":"StructuredText","config":{"single":"heading1","label":"Product Name","placeholder":"Thought Leader's Coffee"}},"rich_content":{"type":"StructuredText","config":{"multi":"paragraph, heading2, list-item","label":"Rich content"}},"button_label":{"type":"StructuredText","config":{"single":"paragraph","label":"Button Label","placeholder":"Add to cart"}},"button_link":{"type":"Link","config":{"label":"Button Link"}},"sub_title":{"type":"StructuredText","config":{"single":"heading2","label":"Sub title","placeholder":"Kenya"}}},"Product Description":{"title":{"type":"StructuredText","config":{"single":"heading2","label":"Title","placeholder":"What we like"}},"product_description":{"type":"StructuredText","config":{"multi":"paragraph, heading3, heading4, heading5, strong, em, hyperlink, list-item, o-list-item, o-list-item","allowTargetBlank":true,"label":"Product description","placeholder":"This coffee guarantees a rather complex set of flavors"}}},"Related Product":{"related_products_title":{"type":"StructuredText","config":{"single":"heading2","label":"Title"}},"related_products":{"type":"Group","config":{"fields":{"product1":{"type":"Link","config":{"select":"document","customtypes":["product"],"label":"Product","placeholder":"Select a product"}}},"label":"Related products"}}},"SEO & Social":{"uid":{"type":"UID","config":{"label":"Slug for url","placeholder":"uid"}},"meta_title":{"type":"StructuredText","config":{"single":"heading1","label":"Meta title","placeholder":"Meta title"}},"meta_description":{"type":"StructuredText","config":{"single":"paragraph","label":"Meta description","placeholder":"Meta description"}},"canonical_url":{"type":"StructuredText","config":{"label":"Canonical URL","placeholder":"Canonical URL"}},"body1":{"type":"Slices","fieldset":"Slice zone","config":{"choices":{"twitter_card":{"type":"Slice","fieldset":"Twitter card","description":"Fields you need to customize the Twitter Card","icon":"adjust","display":"list","non-repeat":{"card_title":{"type":"Text","config":{"label":"Title","placeholder":"Title for Twitter"}},"card_description":{"type":"Text","config":{"label":"Description","placeholder":"Description for Twitter"}},"card_image":{"type":"Image","config":{"constraint":{"width":1200,"height":630},"thumbnails":[],"label":"Image"}}},"repeat":{}},"facebook__open_graph_":{"type":"Slice","fieldset":"Facebook (Open Graph)","description":"Fields to customize OG cards","icon":"thumb_up","display":"list","non-repeat":{},"repeat":{}}}}}}}
Loading

0 comments on commit 0216715

Please sign in to comment.