Git Product home page Git Product logo

gatsby-reasonml-site's Introduction

gatsby-starter-reason

A Gatsby starter for writing your site in ReasonML

Installation

Installation using the gatsby cli

gatsby new my-reasonml-site https://github.com/jtberglund/gatsby-starter-reason

Usage

Check the docs for gatsby-plugin-reason for more details on configuration options.

Pages

gatsby-plugin-reason offers an option to derive page routes from the page component's name (instead of the file name like gatsby usually uses), which is in use in this starter (see the plugin configuration in gatsby-config.js).

I prefer using this option for two reasons:

  1. ReasonML/ocaml has fairly strict rules for files names since file names automatically map to module names, meaning file names for page components such as about-me.re or 404.re are not allowing.
  2. I like to uppercase my component names and I don't like having two naming conventions going on at once (e.g. having src/components/Header.re alongside src/pages/my_page.re).

This allows you to create a page component called AboutMe.re and map it to the route /about-me by setting the name of your component to "about-me" as shown below:

let component = ReasonReact.statelessComponent("about-me");

GraphQL

WIP

Troubleshooting

If there are issues compiling your ReasonML code and you're sure its not a syntax error, often re-compiling will fix the error

bsb -clean-world
bsb -make-world

gatsby-reasonml-site's People

Contributors

0x80 avatar

Watchers

 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.