Skip to content

Commit 011ac72

Browse files
BSKYmarkerikson
andcommitted
Migrate website to Docusaurus 2 (#3635)
* Migrate website to Docusaurus 2 * Tweak styling to better match original site - Shrank padding and border radius for code snippets - Made category chevrons closed=right and open=down - Added transition for category chevrons - Forced links in code snippets to inherit link color * Restructure index page sales pitch content based on RTK layout Co-authored-by: Mark Erikson <[email protected]>
1 parent c270330 commit 011ac72

File tree

96 files changed

+21793
-9260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+21793
-9260
lines changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# <a href='http://redux.js.org'><img src='https://assets-git-camo.f3mw1.com/f28b5bc7822f1b7bb28a96d8d09e7d79169248fc/687474703a2f2f692e696d6775722e636f6d2f4a65567164514d2e706e67' height='60' alt='Redux Logo' aria-label='redux.js.org' /></a>
22

3-
Redux is a predictable state container for JavaScript apps.
3+
Redux is a predictable state container for JavaScript apps.
44
(Not to be confused with a WordPress framework – [Redux Framework](https://reduxframework.com/).)
55

66
It helps you write applications that behave consistently, run in different environments (client, server, and native), and are easy to test. On top of that, it provides a great developer experience, such as [live code editing combined with a time traveling debugger](https://github.com/reduxjs/redux-devtools).
77

8-
You can use Redux together with [React](https://reactjs.org), or with any other view library.
8+
You can use Redux together with [React](https://reactjs.org), or with any other view library.
99
It is tiny (2kB, including dependencies).
1010

1111
> **Note**: We are currently planning a rewrite of the Redux docs. Please take some time to **[fill out this survey on what content is most important in a docs site](https://docs.google.com/forms/d/e/1FAIpQLSfzIkY3fXZ8PrQKScYMK0YoEgALfAK2qQ0mOj1_ibKv2qDTuQ/viewform)**. Thanks!
@@ -85,7 +85,7 @@ Dan Abramov (author of Redux) wrote Redux while working on his React Europe talk
8585

8686
## Influences
8787

88-
Redux evolves the ideas of [Flux](http://facebook.github.io/flux/), but avoids its complexity by taking cues from [Elm](https://github.com/evancz/elm-architecture-tutorial/).
88+
Redux evolves the ideas of [Flux](http://facebook.github.io/flux/), but avoids its complexity by taking cues from [Elm](https://github.com/evancz/elm-architecture-tutorial/).
8989
Even if you haven't used Flux or Elm, Redux only takes a few minutes to get started with.
9090

9191
## Installation
@@ -119,8 +119,8 @@ Note that unlike Redux itself, many packages in the Redux ecosystem don't provid
119119

120120
## The Gist
121121

122-
The whole state of your app is stored in an object tree inside a single _store_.
123-
The only way to change the state tree is to emit an _action_, an object describing what happened.
122+
The whole state of your app is stored in an object tree inside a single _store_.
123+
The only way to change the state tree is to emit an _action_, an object describing what happened.
124124
To specify how the actions transform the state tree, you write pure _reducers_.
125125

126126
That's it!
@@ -185,19 +185,19 @@ This architecture might seem like an overkill for a counter app, but the beauty
185185

186186
**[Getting Started with Redux](https://egghead.io/series/getting-started-with-redux)** is a video course consisting of 30 videos narrated by [Dan Abramov](https://twitter.com/dan_abramov), author of Redux. It is designed to complement the “Basics” part of the docs while bringing additional insights about immutability, testing, Redux best practices, and using Redux with React. **This course is free and will always be.**
187187

188-
> [“Great course on egghead.io by @dan_abramov - instead of just showing you how to use #redux, it also shows how and why redux was built!”](https://twitter.com/sandrinodm/status/670548531422326785)
188+
> [“Great course on egghead.io by @dan_abramov - instead of just showing you how to use #redux, it also shows how and why redux was built!”](https://twitter.com/sandrinodm/status/670548531422326785)
189189
> Sandrino Di Mattia
190190
191-
> [“Plowing through @dan_abramov 'Getting Started with Redux' - its amazing how much simpler concepts get with video.”](https://twitter.com/chrisdhanaraj/status/670328025553219584)
191+
> [“Plowing through @dan_abramov 'Getting Started with Redux' - its amazing how much simpler concepts get with video.”](https://twitter.com/chrisdhanaraj/status/670328025553219584)
192192
> Chris Dhanaraj
193193
194-
> [“This video series on Redux by @dan_abramov on @eggheadio is spectacular!”](https://twitter.com/eddiezane/status/670333133242408960)
194+
> [“This video series on Redux by @dan_abramov on @eggheadio is spectacular!”](https://twitter.com/eddiezane/status/670333133242408960)
195195
> Eddie Zaneski
196196
197-
> [“Come for the name hype. Stay for the rock solid fundamentals. (Thanks, and great job @dan_abramov and @eggheadio!)”](https://twitter.com/danott/status/669909126554607617)
197+
> [“Come for the name hype. Stay for the rock solid fundamentals. (Thanks, and great job @dan_abramov and @eggheadio!)”](https://twitter.com/danott/status/669909126554607617)
198198
> Dan
199199
200-
> [“This series of videos on Redux by @dan_abramov is repeatedly blowing my mind - gunna do some serious refactoring”](https://twitter.com/gelatindesign/status/669658358643892224)
200+
> [“This series of videos on Redux by @dan_abramov is repeatedly blowing my mind - gunna do some serious refactoring”](https://twitter.com/gelatindesign/status/669658358643892224)
201201
> Laurence Roberts
202202
203203
So, what are you waiting for?
@@ -274,13 +274,13 @@ If you're new to the NPM ecosystem and have troubles getting a project up and ru
274274

275275
## Testimonials
276276

277-
> [“Love what you're doing with Redux”](https://twitter.com/jingc/status/616608251463909376)
277+
> [“Love what you're doing with Redux”](https://twitter.com/jingc/status/616608251463909376)
278278
> Jing Chen, creator of Flux
279279
280-
> [“I asked for comments on Redux in FB's internal JS discussion group, and it was universally praised. Really awesome work.”](https://twitter.com/fisherwebdev/status/616286955693682688)
280+
> [“I asked for comments on Redux in FB's internal JS discussion group, and it was universally praised. Really awesome work.”](https://twitter.com/fisherwebdev/status/616286955693682688)
281281
> Bill Fisher, author of Flux documentation
282282
283-
> [“It's cool that you are inventing a better Flux by not doing Flux at all.”](https://twitter.com/andrestaltz/status/616271392930201604)
283+
> [“It's cool that you are inventing a better Flux by not doing Flux at all.”](https://twitter.com/andrestaltz/status/616271392930201604)
284284
> André Staltz, creator of Cycle
285285
286286
## Thanks
@@ -304,12 +304,12 @@ You can find the official logo [on GitHub](https://github.com/reduxjs/redux/tree
304304

305305
## Change Log
306306

307-
This project adheres to [Semantic Versioning](http://semver.org/).
307+
This project adheres to [Semantic Versioning](http://semver.org/).
308308
Every release, along with the migration instructions, is documented on the GitHub [Releases](https://github.com/reduxjs/redux/releases) page.
309309

310310
## Patrons
311311

312-
The work on Redux was [funded by the community](https://www.patreon.com/reactdx).
312+
The work on Redux was [funded by the community](https://www.patreon.com/reactdx).
313313
Meet some of the outstanding companies that made it possible:
314314

315315
- [Webflow](https://github.com/webflow)

netlify.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[build]
2+
base = "website"
3+
publish = "website/build"
4+
command = "npm run build"

website/.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# dependencies
2+
/node_modules
3+
4+
# production
5+
/build
6+
7+
# generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

website/README.md

100644100755
Lines changed: 13 additions & 178 deletions
Original file line numberDiff line numberDiff line change
@@ -1,198 +1,33 @@
1-
This website was created with [Docusaurus](https://docusaurus.io/).
1+
# Website
22

3-
# What's In This Document
3+
This website is built using Docusaurus 2, a modern static website generator.
44

5-
- [Get Started in 5 Minutes](#get-started-in-5-minutes)
6-
- [Directory Structure](#directory-structure)
7-
- [Editing Content](#editing-content)
8-
- [Adding Content](#adding-content)
9-
- [Full Documentation](#full-documentation)
5+
### Installation
106

11-
# Get Started in 5 Minutes
12-
13-
1. Make sure all the dependencies for the website are installed:
14-
15-
```sh
16-
# Install dependencies
17-
$ yarn
18-
```
19-
20-
2. Run your dev server:
21-
22-
```sh
23-
# Start the site
24-
$ yarn start
25-
```
26-
27-
## Directory Structure
28-
29-
Your project file structure should look something like this
30-
31-
```
32-
my-docusaurus/
33-
docs/
34-
doc-1.md
35-
doc-2.md
36-
doc-3.md
37-
website/
38-
blog/
39-
2016-3-11-oldest-post.md
40-
2017-10-24-newest-post.md
41-
core/
42-
node_modules/
43-
pages/
44-
static/
45-
css/
46-
img/
47-
package.json
48-
sidebar.json
49-
siteConfig.js
507
```
51-
52-
# Editing Content
53-
54-
## Editing an existing docs page
55-
56-
Edit docs by navigating to `docs/` and editing the corresponding document:
57-
58-
`docs/doc-to-be-edited.md`
59-
60-
```markdown
61-
---
62-
id: page-needs-edit
63-
title: This Doc Needs To Be Edited
64-
---
65-
66-
Edit me...
67-
```
68-
69-
For more information about docs, click [here](https://docusaurus.io/docs/en/navigation)
70-
71-
## Editing an existing blog post
72-
73-
Edit blog posts by navigating to `website/blog` and editing the corresponding post:
74-
75-
`website/blog/post-to-be-edited.md`
76-
77-
```markdown
78-
---
79-
id: post-needs-edit
80-
title: This Blog Post Needs To Be Edited
81-
---
82-
83-
Edit me...
8+
$ yarn
849
```
8510

86-
For more information about blog posts, click [here](https://docusaurus.io/docs/en/adding-blog)
87-
88-
# Adding Content
89-
90-
## Adding a new docs page to an existing sidebar
91-
92-
1. Create the doc as a new markdown file in `/docs`, example `docs/newly-created-doc.md`:
93-
94-
```md
95-
---
96-
id: newly-created-doc
97-
title: This Doc Needs To Be Edited
98-
---
11+
### Local Development
9912

100-
My new content here..
10113
```
102-
103-
1. Refer to that doc's ID in an existing sidebar in `website/sidebar.json`:
104-
105-
```javascript
106-
// Add newly-created-doc to the Getting Started category of docs
107-
{
108-
"docs": {
109-
"Getting Started": [
110-
"quick-start",
111-
"newly-created-doc" // new doc here
112-
],
113-
...
114-
},
115-
...
116-
}
14+
$ yarn start
11715
```
11816

119-
For more information about adding new docs, click [here](https://docusaurus.io/docs/en/navigation)
17+
This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.
12018

121-
## Adding a new blog post
19+
### Build
12220

123-
1. Make sure there is a header link to your blog in `website/siteConfig.js`:
124-
125-
`website/siteConfig.js`
126-
127-
```javascript
128-
headerLinks: [
129-
...
130-
{ blog: true, label: 'Blog' },
131-
...
132-
]
13321
```
134-
135-
2. Create the blog post with the format `YYYY-MM-DD-My-Blog-Post-Title.md` in `website/blog`:
136-
137-
`website/blog/2018-05-21-New-Blog-Post.md`
138-
139-
```markdown
140-
---
141-
author: Frank Li
142-
authorURL: https://twitter.com/foobarbaz
143-
authorFBID: 503283835
144-
title: New Blog Post
145-
---
146-
147-
Lorem Ipsum...
22+
$ yarn build
14823
```
14924

150-
For more information about blog posts, click [here](https://docusaurus.io/docs/en/adding-blog)
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
15126

152-
## Adding items to your site's top navigation bar
27+
### Deployment
15328

154-
1. Add links to docs, custom pages or external links by editing the headerLinks field of `website/siteConfig.js`:
155-
156-
`website/siteConfig.js`
157-
158-
```javascript
159-
{
160-
headerLinks: [
161-
...
162-
/* you can add docs */
163-
{ doc: 'my-examples', label: 'Examples' },
164-
/* you can add custom pages */
165-
{ page: 'help', label: 'Help' },
166-
/* you can add external links */
167-
{ href: 'https://github.com/facebook/Docusaurus', label: 'GitHub' },
168-
...
169-
],
170-
...
171-
}
17229
```
173-
174-
For more information about the navigation bar, click [here](https://docusaurus.io/docs/en/navigation)
175-
176-
## Adding custom pages
177-
178-
1. Docusaurus uses React components to build pages. The components are saved as .js files in `website/pages/en`:
179-
1. If you want your page to show up in your navigation header, you will need to update `website/siteConfig.js` to add to the `headerLinks` element:
180-
181-
`website/siteConfig.js`
182-
183-
```javascript
184-
{
185-
headerLinks: [
186-
...
187-
{ page: 'my-new-custom-page', label: 'My New Custom Page' },
188-
...
189-
],
190-
...
191-
}
30+
$ GIT_USER=<Your GitHub username> USE_SSH=1 yarn deploy
19231
```
19332

194-
For more information about custom pages, click [here](https://docusaurus.io/docs/en/custom-pages).
195-
196-
# Full Documentation
197-
198-
Full documentation can be found on the [website](https://docusaurus.io/).
33+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

0 commit comments

Comments
 (0)