GithubHelp home page GithubHelp logo

wardpeet / luke-gatsby-starter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lukethacoder/luke-gatsby-starter

0.0 2.0 0.0 3.12 MB

opinonated gatsby starter using typescript, styled components, react hooks and a tiny bit of react-spring

Home Page: https://gatsby-starter-luke.netlify.com

JavaScript 5.43% TypeScript 94.57%

luke-gatsby-starter's Introduction

Luke Gatsby Starter

Kick off your project with this opinionated boilerplate. This barebones starter ships with the main Gatsby configuration files you might need. This starter was inspired by ueno-gatsby-starter

Installation

Install:

make sure GatsbyJS is globally installed

# yarn
yarn global add gatsby-cli

# npm
npm install -g gatsby-cli
gatsby new my-app "https://github.com/lukethacoder/luke-gatsby-starter#master --recursive"

Development Environment:

# yarn
yarn dev

# npm
npm run dev

Things to know

There are couple of things that are good to know about this starter, compared to the default gatsby starter.

TypeScript

We encourage TypeScript usage and have included basic linting.

  • Avoid export default ... - the only place you absolutely need to do this is in ./pages/*. Rather export const Module = ... and import { Module } from './file' (details)

See the TypeScript Handbook for more tips and tricks

Naming Conventions & Folder Structure

Components

Component files and folders should be named using kebab-case and follow the folder structure of:

...
└── components
|   └── header
|   |   ├── index.tsx // export { Header } from './header'
|   |   ├── header.tsx // main component view and logic
|   |   └── style.ts // component specific styled components
...

Font Awesome

Font Awesome is home to more than 5,000 icons and are an easy way to get up and running with icons on your site. The gatsby-browser.js file is home to the root of the font awesome magic. import any icons you wish to use here, and append them to library.add(...).

import { library } from "@fortawesome/fontawesome-svg-core"
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import { fab } from "@fortawesome/free-brands-svg-icons"

library.add(fab)

export default () => <FontAwesomeIcon icon={["fab", "github"]} />

See the Font Awesome React Docs for more info.

SVG

You can import SVG files as React components by placing them in the ./src/assets/svg folder.

Usage:

import React from "react"
import Logo from "assets/svg/logo.svg"

export const Header = () => (
	<header>
		<Logo style={{ fill: "peru" }} />
	</header>
)

Developer Mode

Dev mode is enabled by clicking ctrl + ,;

make sure you have an .env file with NODE_ENV set to development

TODO

  • example of pulling data from various data sources

luke-gatsby-starter's People

Contributors

lukethacoder avatar dependabot-preview[bot] 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.