Coder Social home page Coder Social logo

makerfox's Introduction

Builder.io Gatsby Starter

Gatsby starter with drag + drop page building with your React components via Builder.io's visual headless CMS

Editor example

Quick Start

  1. Sign up to Builder.io and Create a Gatsby site.

    • Clone this repository or use gatsby new
    # create a new Gatsby site using this starter
    gatsby new my-builder-site https://github.com/BuilderIO/gatsby-starter-builder
    • Grab a free account at builder.io, this link will set you up with all the models used in the starter and some sample content to get you started.

    • Find your public API key and add it to the src/config.js

  2. Start developing.

    Navigate into your new site’s directory and start it up.

    cd my-default-starter/
    gatsby develop

    Then start building pages in Builder! Use the pre-built templates, and components to create exactly what you want. This starter uses @builder.io/gatsby plugin to fetch all your published pages and add them to your Gatsby build.

🧐 What's inside?

This starter demonstrates creating dynamic pages in Builder.io on new URLs and generating them with Gatsby, as well as rendering specific parts of your site with Builder.io content via GraphQL queries (e.g. for pages, header, footer, etc)

See:

Using your custom components in the editor

πŸ‘‰Tip: want to limit page building to only your components? Try components only mode

Register a component

import { Builder } from '@builder.io/react';

class SimpleText extends React.Component {
  render() {
    return <h1>{this.props.text}</h1>;
  }
}

Builder.registerComponent(SimpleText, {
  name: 'Simple Text',
  inputs: [{ name: 'text', type: 'string' }],
})

Then import it in the template or in your (builder-settings.js)[src/builder-settings.js]

import './components/simple-text'
// ...

See:

Mixed Content errors when hosting on insecure http

Our editor uses the preview URL you supply for live editing. Because the editor is on https, the preview might not work correctly if your development setup uses http. To fix this, change your development set up to serve using https. Or, as a workaround, on Chrome you can allow insecure content on localhost, by toggling the insecure content option here chrome://settings/content/siteDetails?site=http%3A%2F%2Flocalhost%3A9009

Prerequisites

Available scripts

build

Build the static files into the public folder

Usage

$ npm run build

clean

Runs gatsby clean command.

Usage

npm run clean

develop or start

Runs the clean script and starts the gatsby develop server using the command gatsby develop.

Usage

npm run develop

format

Formats code and docs according to our style guidelines using prettier

Usage

npm run format

CONTRIBUTING

Contributions are always welcome, no matter how large or small.

Learn more

makerfox's People

Contributors

teleaziz avatar steve8708 avatar matthewlal avatar

Watchers

James Cloos avatar  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.