Skip to content

Commit 3481756

Browse files
committed
build examples in gh-pages
this commit will build the example repos when possible (not universal) to be compatible with the gh-pages and link to them in the header of each example in the "Examples" section of the gitbook
1 parent 4b4dcd5 commit 3481756

File tree

15 files changed

+24
-20
lines changed

15 files changed

+24
-20
lines changed

docs/introduction/Examples.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Redux is distributed with a few examples in its [source code](https://github.com
55
>##### Note on Copying
66
>If you copy Redux examples outside their folders, you can delete some lines at the end of their `webpack.config.js` files. They follow a “You can safely delete these lines in your project.” comment.
77
8-
## Counter
8+
## [Counter](examples/counter)
99

1010
Run the [Counter](https://github.com/rackt/redux/tree/master/examples/counter) example:
1111

@@ -24,7 +24,7 @@ It covers:
2424
* Basic Redux flow
2525
* Testing
2626

27-
## TodoMVC
27+
## [TodoMVC](examples/todomvc)
2828

2929
Run the [TodoMVC](https://github.com/rackt/redux/tree/master/examples/todomvc) example:
3030

@@ -44,7 +44,7 @@ It covers:
4444
* Updating nested data
4545
* Testing
4646

47-
## Todos with Undo
47+
## [Todos with Undo](examples/todos-with-undo)
4848

4949
Run the [todos-with-undo](https://github.com/rackt/redux/tree/master/examples/todos-with-undo) example:
5050

@@ -63,7 +63,7 @@ It covers:
6363
* Redux flow with two reducers
6464
* Undo/Redo functionality in Redux with [redux-undo](https://github.com/omnidan/redux-undo)
6565

66-
## Async
66+
## [Async](examples/async)
6767

6868
Run the [Async](https://github.com/rackt/redux/tree/master/examples/async) example:
6969

@@ -103,7 +103,7 @@ It covers:
103103
* Prefetching state based on input and via asynchronous fetches.
104104
* Passing state from the server to the client
105105

106-
## Real World
106+
## [Real World](examples/real-world)
107107

108108
Run the [Real World](https://github.com/rackt/redux/tree/master/examples/real-world) example:
109109

@@ -126,7 +126,7 @@ It covers:
126126
* Pagination
127127
* Routing
128128

129-
## Shopping Cart
129+
## [Shopping Cart](examples/shopping-cart)
130130

131131
Run the [Shopping Cart](https://github.com/rackt/redux/tree/master/examples/shopping-cart) example:
132132

examples/async/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
<body>
77
<div id="root">
88
</div>
9-
<script src="/static/bundle.js"></script>
9+
<script src="./static/bundle.js"></script>
1010
</body>
1111
</html>

examples/async/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
'./index'
99
],
1010
output: {
11-
path: path.join(__dirname, 'dist'),
11+
path: path.join(__dirname, 'static'),
1212
filename: 'bundle.js',
1313
publicPath: '/static/'
1414
},

examples/counter/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
<body>
77
<div id="root">
88
</div>
9-
<script src="/static/bundle.js"></script>
9+
<script src="./static/bundle.js"></script>
1010
</body>
1111
</html>

examples/counter/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
'./index'
99
],
1010
output: {
11-
path: path.join(__dirname, 'dist'),
11+
path: path.join(__dirname, 'static'),
1212
filename: 'bundle.js',
1313
publicPath: '/static/'
1414
},

examples/real-world/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
<body>
77
<div id="root">
88
</div>
9-
<script src="/static/bundle.js"></script>
9+
<script src="./static/bundle.js"></script>
1010
</body>
1111
</html>

examples/real-world/routes.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import { Route } from 'react-router'
2+
import { Route, Redirect } from 'react-router'
33
import App from './containers/App'
44
import UserPage from './containers/UserPage'
55
import RepoPage from './containers/RepoPage'
@@ -10,5 +10,9 @@ export default (
1010
component={RepoPage} />
1111
<Route path="/:login"
1212
component={UserPage} />
13+
14+
{/* needed to get github pages to work */}
15+
<Redirect from="*" to="/" />
16+
1317
</Route>
1418
)

examples/real-world/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
'./index'
99
],
1010
output: {
11-
path: path.join(__dirname, 'dist'),
11+
path: path.join(__dirname, 'static'),
1212
filename: 'bundle.js',
1313
publicPath: '/static/'
1414
},

examples/shopping-cart/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
<body>
77
<div id="root">
88
</div>
9-
<script src="/static/bundle.js"></script>
9+
<script src="./static/bundle.js"></script>
1010
</body>
1111
</html>

examples/shopping-cart/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
'./index'
99
],
1010
output: {
11-
path: path.join(__dirname, 'dist'),
11+
path: path.join(__dirname, 'static'),
1212
filename: 'bundle.js',
1313
publicPath: '/static/'
1414
},

examples/todomvc/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
<body>
77
<div class="todoapp" id="root">
88
</div>
9-
<script src="/static/bundle.js"></script>
9+
<script src="./static/bundle.js"></script>
1010
</body>
1111
</html>

examples/todomvc/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
'./index'
99
],
1010
output: {
11-
path: path.join(__dirname, 'dist'),
11+
path: path.join(__dirname, 'static'),
1212
filename: 'bundle.js',
1313
publicPath: '/static/'
1414
},

examples/todos-with-undo/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
<body>
77
<div id="root">
88
</div>
9-
<script src="/static/bundle.js"></script>
9+
<script src="./static/bundle.js"></script>
1010
</body>
1111
</html>

examples/todos-with-undo/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
'./index'
99
],
1010
output: {
11-
path: path.join(__dirname, 'dist'),
11+
path: path.join(__dirname, 'static'),
1212
filename: 'bundle.js',
1313
publicPath: '/static/'
1414
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"build:umd": "webpack src/index.js dist/redux.js --config webpack.config.development.js",
2222
"build:umd:min": "webpack src/index.js dist/redux.min.js --config webpack.config.production.js",
2323
"build:examples": "babel-node examples/buildAll.js",
24-
"build": "npm run build:lib && npm run build:umd && npm run build:umd:min",
24+
"build": "npm run build:lib && npm run build:umd && npm run build:umd:min && npm run build:examples",
2525
"preversion": "npm run clean && npm run check",
2626
"version": "npm run build",
2727
"postversion": "git push && git push --tags && npm run clean && npm run docs:publish",

0 commit comments

Comments
 (0)