• Stars
    star
    548
  • Rank 81,119 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Start and deploy your own statically rendered blog with create-react-app

npx create-react-blog

Create a blog with create-react-app, MDX, and Navi.
Themed after Gatsby's blog starter and Dan Abramov's overreacted.io.

See an example of the deployed app β†’

Comes with:

πŸ“‘ RSS feed generation
🏷️ Tagged posts
πŸš€ HTML files for each URL
πŸ“œ Smooth scrolling to hash links
πŸ”₯ Animated page loading transition
πŸ”— Easy code splitting with import()
⏩ Paginated index page
β›‘ TypeScript support

Getting started

The simplest way to get started is to use npx:

npx create-react-blog react-blog
cd react-blog
npm start

If you'd like to use TypeScript, just pass in a --typescript option:

npx create-react-blog react-blog --typescript

Alternatively, you can clone this repository yourself and use one of the templates yourself. If you take this approach, make sure to also run npm install:

git clone [email protected]:frontarm/create-react-blog.git
mv create-react-blog/template react-blog
cd react-blog
npm install
npm start

To statically build your blog and then start a local server for testing:

npm run build
npm run serve

The quickest and easiet way to deploy your blog is with Netlify, which is already set up and ready to go:

# Deploy to a test URL
npm run deploy

# Deploy to a production URL
npm run deploy:prod

Of course, since your site is just a bunch of HTML files, it can be deployed anywhere you'd like. Here's a couple alternatives:

How to...

To update the site's title, edit the metadata in src/siteMetadata.js.

To your bio and photo, edit the Bio component in src/components/Bio.js.

To change the site's colors, edit the :root block in src/index.module.css.

To create a new post, add a new directory to src/routes/posts that is prefixed with the new post's publication date, then create a post.js file inside it:

export default {
  title: `Learn How To Build This Blog From Scratch`,
  tags: ['react', 'navi'],
  spoiler: "An online course with loads of live demos and exercises.",
  getContent: () => import('./document.mdx'),
}

To set the maximum number of posts on an index page,, set the indexPageSize property of the object exported by src/siteMetadata.js.

To modify the generated HTML, update the src/renderPageToString.js file.

To add non-blog pages, just use Navi.createPage(), Navi.createSwitch() and Navi.createRedirect(). For an example, check the about page at src/routes/about/index.js. If you create a page, remember to add it to the root switch at src/routes/index.js.

To brush up on React's fundamentals, check out the React (without the buzzwords) and Asynchronous JavaScript courses.

More Repositories

1

starter-kit

Project boilerplate using React, Redux and Uniloc
JavaScript
467
star
2

gulp-rev-replace

Rewrite occurences of filenames which have been renamed by gulp-rev
JavaScript
388
star
3

govern

Component-based state management for JavaScript.
TypeScript
266
star
4

react-pacomo

Automatic Namespacing for your React className props
JavaScript
193
star
5

javascript-cheatsheets

A collection of cheatsheets for JavaScript
HTML
177
star
6

webpack-black-triangle

A minimal webpack/ES6 project template with a spinning black triangle
JavaScript
166
star
7

memamug-client

Memamug helps you remember faces. Written with React, Maxim & Rails.
JavaScript
109
star
8

react-zen

React utilities for working with APIs
TypeScript
108
star
9

uniloc

Universal JavaScript Route Parsing and Generation
JavaScript
95
star
10

raw-react-part-1

Learn Raw React - No JSX, Flux, ES6, Webpack, ...
JavaScript
74
star
11

memamug-server

Memamug helps you remember faces. Written with React, Maxim & Rails
Ruby
68
star
12

use-codemirror

CodeMirror support for React
JavaScript
66
star
13

retil

The React Utility Library
TypeScript
46
star
14

maxim

Maxim provides a simple way to structure JavaScript applications, letting you focus on the parts that matter.
JavaScript
45
star
15

pacomo

A Method For Structuring Stylesheets in React-based Applications
42
star
16

cura-firebase-example

A React/Firebase starter with serverless SSR, routing and styled components.
JavaScript
29
star
17

reactjs.tokyo

Source for reactjs.tokyo. Built with universal-react-scripts and Firebase.
JavaScript
28
star
18

raw-react-part-2

Solution for Learn Raw React: Ridiculously Simple Forms
JavaScript
26
star
19

react-black-triangle

An opiniated React starter kit. Clone, follow the README, and have a working app in under two minutes.
JavaScript
26
star
20

sitepack

A JavaScript tool for building static web sites.
JavaScript
25
star
21

react-cx

Combine styles from CSS Modules with a `cx` prop.
JavaScript
24
star
22

react-base

Higher order component to handle merging callbacks, prefixing classnames and props passthrough.
JavaScript
21
star
23

raw-react-part-3

Learn Raw React - Routing
JavaScript
19
star
24

armo-breadboard

Themeable live coding for React.
JavaScript
16
star
25

popup-trigger

A helper for triggering popups on focus, hover, and selection.
TypeScript
15
star
26

memcord

Memcords let you pass Records as React props without breaking PureComponent.
TypeScript
14
star
27

mdx-loader

Webpack loader for MDX (i.e. JSX-infused Markdown) using mdx-it
JavaScript
14
star
28

react-typescript-firebase-navi

A starter kit to get you started faster than all the other starter kits πŸš…πŸ”₯πŸš€πŸ’
TypeScript
13
star
29

vouch.chat

JavaScript
11
star
30

derby-i18n

i18n support for derby.js
JavaScript
10
star
31

numbat-ui

CSS
10
star
32

use-promised-state

A state hook for React that doesn't whinge if used once used after unmount.
JavaScript
9
star
33

react-controllers

Utilities for creating React controller components
TypeScript
9
star
34

react-c

An implementation of Pacomo, a system to help structure your React stylesheets.
JavaScript
9
star
35

universal-react-app

A server-rendered starter forked from create-react-app
JavaScript
8
star
36

use-sx

Composable styles for React
TypeScript
8
star
37

node-joyo-kanji

A list of the Joyo Kanji packaged for node.js
8
star
38

react-routing-library

Concurrent routing that grows with your app.
TypeScript
7
star
39

firebase-react-demo

A simple demo of adding Firebase Functions/Hosting to a Create React App project
JavaScript
6
star
40

react-elemap

A tool for transforming React elements.
JavaScript
5
star
41

react-armory-helpers

Packages that can used with ES6 `import` within React Armory guides
4
star
42

static-directory-loader

Copy files into your public directory with a webpack import
JavaScript
4
star
43

react-junctions

JavaScript
3
star
44

meteor-yaml

Meteor smart package for YAML parsing/generation
JavaScript
2
star
45

mdx-cra-demo

JavaScript
2
star
46

junctions-react-app

A demo project using Junctions in the structure generated by Create React App
JavaScript
2
star
47

react-base-control

Higher order component to manage control-related events and state.
JavaScript
2
star
48

numbat-ui-example

JavaScript
1
star
49

angular-deputy

Resources with associations, computed values and offline support for AngularJS
CoffeeScript
1
star
50

m-and-c-in-mvc-talk

CSS
1
star
51

now-cura

Now builder for Create Universal React App
TypeScript
1
star
52

junctions-tutorial

Companion repo for the Junctions tutorial
JavaScript
1
star
53

armo

React stuff
JavaScript
1
star
54

vouch-landing

A landing page built in 2 hours with React and Firebase
JavaScript
1
star