gatsby-shopify-starter | Simple starter to build a blazing fast Shopify store | Ecommerce library
kandi X-RAY | gatsby-shopify-starter Summary
kandi X-RAY | gatsby-shopify-starter Summary
Simple starter to build a blazing fast Shopify store with Gatsby.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- The SEO page query
gatsby-shopify-starter Key Features
gatsby-shopify-starter Examples and Code Snippets
Community Discussions
Trending Discussions on gatsby-shopify-starter
QUESTION
I read https://www.gatsbyjs.org/docs/path-prefix/ and I added the following to gatsby-configs.js.
...ANSWER
Answered 2020-Aug-06 at 18:18Gatsby's pathPrefix
only prepends a string to your projects routes (url). Your deployment script(s) should handle where the public folder ends up on your server. If you really want to publish your gatsby project to somewhere other than /public
(locally) You will propbably need to do something like use fs
and path
in onPostBuild
in gatsby-node.js to move everything over to another directory. At the time or writing this, Gatsby doesn't directly support alternative build directories so you are on your own when using gatsby develop or gatsby serve to view this locally.
Try something like this in gatsby-node.js but change the paths to serve your needs. This example will publish your project to /public/blog
rather than the default /public
and is just a proof of concept but I tested it and it works:
QUESTION
So, I'm struggling to understand how Gatsby works. I'm using the https://www.gatsbyjs.org/starters/AlexanderProd/gatsby-shopify-starter/ which uses a Gatsby plugin called gatsby-source-shopify
. The plugin takes two params: shopName
and accessToken
. It looks like this in gatsby-config.js
:
ANSWER
Answered 2020-Mar-28 at 17:37As the code shows, it uses process.env.SHOP_NAME
where SHOP_NAME
is the name of the environment variable. Those files are declared at the root of the project using some naming such as .env.domain1.com
. In this file, you can store any desired variable to use it in your Gatsby configurations. When dealing with delicate variables (API keys, tokens, passwords, etc) it's recommended to use that way and ignore all .env
files in your .gitignore
.
When you trigger a command in Gatsby, you can pass it some variables, for example:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gatsby-shopify-starter
Create a Gatsby site. Use the Gatsby CLI to create a new site, specifying this starter. # create a new Gatsby site using this starter gatsby new my-shopify-store https://github.com/AlexanderProd/gatsby-shopify-starter
Start developing. Navigate into your new site’s directory and start it up. cd my-shopify-store/ gatsby develop
Open the source code and start editing! Your site is now running at http://localhost:8000! Note: You'll also see a second link: http://localhost:8000/___graphql. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the Gatsby tutorial. Open the my-shopify-store directory in your code editor of choice and edit src/pages/index.js. Save your changes and the browser will update in real time!
Connect your own Shopify store. Open both .env files located in the root directory of your page end replace the credentials with your own. Don't forget to restart Gatsby for your store to be loaded! ⚠️ Make sure to use the Shopify storefront API credentials, not the regular Shopify API!
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page