docs: migrated images to cloudinary from imgur (#2569)

This commit is contained in:
Shahed Nasser
2022-11-09 16:30:41 +02:00
committed by GitHub
parent 0a31ea9d43
commit 9e7e8c6d51
56 changed files with 326 additions and 328 deletions
@@ -118,31 +118,31 @@ This runs the Contentful migration in that file and makes the necessary changes
To check if the above migration worked, in your Contentful Space dashboard go to Content Models from the navigation bar. You should see the new content model Rich Text.
![Rich Text can be found among content models](https://i.imgur.com/W5WzcTG.png)
![Rich Text can be found among content models](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001241/Medusa%20Docs/Contentful/W5WzcTG_vau6c9.png)
The above migration also allows you to add Rich Text content to pages. To test this out, go to Content from the navigation bar and choose Page in the select field next to the search bar. This shows the available pages in your Contentful Space.
![Filter content to only show pages by choosing Page in the Content Type select field](https://i.imgur.com/ht87z4e.png)
![Filter content to only show pages by choosing Page in the Content Type select field](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001251/Medusa%20Docs/Contentful/ht87z4e_gmbk6c.png)
Choose one of the pages. For example, the About page. Then, scroll down to the Add content button. If you click on it, you should be able to choose Rich Text under New Content.
![Click on add content and choose from the dropdown Rich Text](https://i.imgur.com/pJ5yM0m.png)
![Click on add content and choose from the dropdown Rich Text](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001261/Medusa%20Docs/Contentful/pJ5yM0m_dfb7vp.png)
Click on Rich Text and a new form will open to create new Rich Text content. It has the same fields that you defined in the migration file.
![The Rich Text form is filled with data](https://i.imgur.com/lAglhc9.png)
![The Rich Text form is filled with data](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001271/Medusa%20Docs/Contentful/lAglhc9_ejfs2i.png)
After adding the content you want, click on the Publish button on the right then go back to the About page editor.
![Click on the Publish button at the right](https://i.imgur.com/oYpQKsc.png)
![Click on the Publish button at the right](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001281/Medusa%20Docs/Contentful/oYpQKsc_piobfk.png)
Similarly, in the About page editor, click on the Publish Changes button on the right to view these changes later in the storefront.
![Click on the Publish changes button at the right](https://i.imgur.com/DIMo3hd.png)
![Click on the Publish changes button at the right](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001296/Medusa%20Docs/Contentful/DIMo3hd_ylxkr3.png)
Similarly, you can add Rich Text content to any product page.
![A rich text content is added to a product](https://i.imgur.com/wgI8mEB.png)
![A rich text content is added to a product](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001305/Medusa%20Docs/Contentful/wgI8mEB_wbukpd.png)
## Render New Content Models in the Storefront
@@ -238,7 +238,7 @@ npm run start
This runs the Gatsby storefront on `localhost:8000`. Go to the storefront in your browser and open the About page. You should see the Rich Text content you added.
![Rich Text content you added to the about page should be visible now](https://i.imgur.com/aQAY9Vz.png)
![Rich Text content you added to the about page should be visible now](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001320/Medusa%20Docs/Contentful/aQAY9Vz_yw4eop.png)
### Render Component in a Product Page
@@ -306,7 +306,7 @@ This loops over `contentModules` and if the type of the content is Rich Text, it
Restart the Gatsby storefront then open a product that you added Rich Text content to. You should see the Rich Text component at the end of the page.
![Rich Text content you added to the product should be visible at the end of the page](https://i.imgur.com/LGiVMxx.png)
![Rich Text content you added to the product should be visible at the end of the page](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001342/Medusa%20Docs/Contentful/LGiVMxx_rqsr2l.png)
## Whats Next
+15 -15
View File
@@ -52,15 +52,15 @@ Set the value for `CONTENTFUL_ENV` to `master`.
To retrieve the value of `CONTENTFUL_SPACE_ID`, go to your [Contentful Space dashboard](https://app.contentful.com/). Then, choose Settings in the navigation bar and select API keys from the dropdown.
![Click on Settings then select API keys from the dropdown](https://i.imgur.com/hvp6zo5.png)
![Click on Settings then select API keys from the dropdown](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001360/Medusa%20Docs/Contentful/hvp6zo5_uaqtmi.png)
On the APIs page, click Add API Key.
![Click on the Add API Key button](https://i.imgur.com/KlH2BDg.png)
![Click on the Add API Key button](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001375/Medusa%20Docs/Contentful/KlH2BDg_fiqd80.png)
In the form, enter a name for the API key and click Save.
![A form with the name of API key entered](https://i.imgur.com/hOG1RqM.png)
![A form with the name of API key entered](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001385/Medusa%20Docs/Contentful/hOG1RqM_tmctae.png)
Then, copy the value of Space ID and set it as the value of `CONTENTFUL_SPACE_ID`.
@@ -68,11 +68,11 @@ Then, copy the value of Space ID and set it as the value of `CONTENTFUL_SPACE_ID
Go back to the API Keys page and click on the Content management tokens tab.
![API Keys page with Content management tokens tab opened](https://i.imgur.com/7nWx1xk.png)
![API Keys page with Content management tokens tab opened](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001394/Medusa%20Docs/Contentful/7nWx1xk_co8ykw.png)
Click on Generate personal token. A pop-up will open where you have to enter a name for the token.
![Pop up model for Personal Access Token with token name entered](https://i.imgur.com/y6R81pH.png)
![Pop up model for Personal Access Token with token name entered](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001403/Medusa%20Docs/Contentful/y6R81pH_yhbg1u.png)
Once you click Generate, a personal access token will be generated. Use it to set the value of `CONTENTFUL_ACCESS_TOKEN`.
@@ -141,7 +141,7 @@ npm run migrate:contentful
Once this command finishes executing, in your Contentful Space dashboard click on Content Model in the navigation bar. You should see a list of new content models added.
![Content Model page filled with new content models](https://i.imgur.com/ZDJPNkr.png)
![Content Model page filled with new content models](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001419/Medusa%20Docs/Contentful/ZDJPNkr_avr7gy.png)
### Seed Content to Contentful
@@ -155,7 +155,7 @@ npm run seed:contentful
After this command finishes running, in your Contentful Space dashboard click on Content in the navigation bar. You should see a list of new content added.
![Content page filled with new content](https://i.imgur.com/bfgFxPg.png)
![Content page filled with new content](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001429/Medusa%20Docs/Contentful/bfgFxPg_jb4zok.png)
### (Optional) Seed Medusa Database
@@ -177,7 +177,7 @@ npm run start
If you seeded the database with demo data, you should see that events related to the products are triggered.
![Seed the database](https://i.imgur.com/ci4accp.png)
![Seed the database](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001440/Medusa%20Docs/Contentful/ci4accp_okaro3.png)
The Contentful integration ensures a two-way sync between the Medusa server and Contentful. So, when new products are added to Medusa, these products will be added to your Contentful Space as well.
@@ -195,7 +195,7 @@ To do that, open your Contentful Space Dashboard and click on Content in the Nav
Click on the checkbox at the top of the table to select all products then click Publish to publish these products.
![Select all products' checkboxes and click the publish button](https://i.imgur.com/3NrH5tJ.png)
![Select all products' checkboxes and click the publish button](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001452/Medusa%20Docs/Contentful/3NrH5tJ_f16iym.png)
### Added Featured Products
@@ -203,19 +203,19 @@ On the homepage of the storefront, theres a featured products tile that shows
To do that, open your Contentful Space Dashboard and click on Content in the Navigation bar. Make sure the select field next to the search bar is set to Any and search for Featured Products. You should find one content of the type Tile Section.
![Search for the featured products tile section](https://i.imgur.com/2gS0ozY.png)
![Search for the featured products tile section](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001462/Medusa%20Docs/Contentful/2gS0ozY_b2tpsb.png)
Click on it. You should find on the page an empty Tiles section where you can add tiles and products.
![On the content's page find the empty tiles section](https://i.imgur.com/inuN1OB.png)
![On the content's page find the empty tiles section](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001472/Medusa%20Docs/Contentful/inuN1OB_ipiszl.png)
Click on Add content then on Add existing content and pick some of the products you want to show on the homepage.
![Add at least 1 product as a tile](https://i.imgur.com/N5m4LbF.png)
![Add at least 1 product as a tile](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001500/Medusa%20Docs/Contentful/N5m4LbF_fb97tm.png)
Once youre done adding products, click on Publish changes in the right sidebar.
![Click on the publish changes button on the right](https://i.imgur.com/URNpkXq.png)
![Click on the publish changes button on the right](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001508/Medusa%20Docs/Contentful/URNpkXq_cb5ppp.png)
## Setup Gatsby Storefront
@@ -250,7 +250,7 @@ To retrieve the value of `CONTENTFUL_ACCESS_TOKEN`, on your Contentful Space das
You should find the field "Content Delivery API - access token”. Copy its value and set it as the value of `CONTENTFUL_ACCESS_TOKEN`.
![Copy the value of the Content Delivery API access token](https://i.imgur.com/a7dl7DI.png)
![Copy the value of the Content Delivery API access token](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001522/Medusa%20Docs/Contentful/a7dl7DI_mziogm.png)
### Start Storefront
@@ -262,7 +262,7 @@ npm run start
This starts the storefront at `localhost:8000`. Open it in your browser and you should see on the homepage the Featured Product section with the products you chose on Contentful.
![The storefront with the featured products section](https://i.imgur.com/f6xwYbS.png)
![The storefront with the featured products section](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001537/Medusa%20Docs/Contentful/f6xwYbS_w1v993.png)
## Make Changes to Content