Code Monkey home page Code Monkey logo

partner-demo-ninetailed's Introduction

A New Stackbit Project

Welcome to your new project created with Stackbit!

Here are a few useful tips & links:

Set up

  1. If you haven't yet transferred this project to your GitHub account, click on the Gear icon in the visual editor to open Project Settings and start the transfer. Learn More.
  2. Once the repository is in your account, the Project Settings window will show you the commands to run for setting up your local environment. Learn More.

Develop with Stackbit Locally

To spin up local dev, run:

  1. In terminal 1:\

    1. git clone
    2. npm install
    3. Add the Contentful tokens to the .env file (see .env.example for reference)
    4. npm run dev
  2. In terminal 2:
    sudo npm i -g @stackbit/cli@latest

stackbit dev \
    -c contentful \
    --contentful-space-id <space_id> \
    --contentful-preview-token <preview_token> \
    --contentful-access-token <access_token>

Learn the basics

  1. It's a good idea to go through our Getting Started tutorial. It will give you a small taste of component development as well, and links for further reading.
  2. To go deeper into how things work, head to the Conceptual Guides.
  3. For more concise, practical information see the How-to Guides.

Get answers

Join us on Discord for community support.

Building for production ๐Ÿ—

To build a static site for production, run the following command

npm run build

The generated site will be written to the out folder. The contents of this folder can be deployed by a serverless deployment platform such as Netlify. You can start a local server serving the static files from the out folder, for example, by installing and running http-server:

npm install http-server -g
http-server out

Contributing ๐Ÿ™

To contribute to this theme, please follow the following steps:

  1. Clone this repository locally

  2. Create a new Space in Contentful

  3. Create new Contentful Personal Access Tokens here

  4. Install dependencies

    npm install
  5. Import the Contentful data stored in the contentful/export.json file to the new space by running the following command. Replace the <management_token> with your Personal Access Token and the <space_id> with the new space ID.

    ./contentful/import.js <management_token> <space_id>
  6. Create "Content Preview API - Access Token" for the new space via Contentful app "Settings" => "API Keys" => "Content delivery / preview tokens" => "Add API Key".

  7. Define the following environment variables to allow Next.js to fetch the content from Contentful when developing or building the site. Replace the {SPACE_ID} with your Space ID and the {CPA} with the new Content Preview API - Access Token.

    export CONTENTFUL_SPACE_ID={SPACE_ID}
    export CONTENTFUL_PREVIEW_TOKEN={CPA}
  8. Lastly, run the Next.js development server:

    npm run dev

    Navigate to http://localhost:3000 to see the site.

  9. Now you can update site code, and the content in Contentful. The browser will automatically live-update your changes.

  10. Once you finish updating the code and contents, export the contents back to the contentful/export.json file by running the following command. Replace the <management_token> with your Personal Access Token and the <space_id> with the new space ID.

    ./contentful/export.js <management_token> <space_id>
  11. Commit, push and submit a pull-request ๐ŸŽ‰

Learn More ๐Ÿ“š

To learn more about Stackbit, take a look at the following resources:

To learn more about Next.js, take a look at the following resources:

To learn more about Contentful, take a look at the following resources:

To learn more about Netlify, take a look at the following resources:

partner-demo-ninetailed's People

Contributors

stackbit-projects avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.