Skip to content

Commit bdfc82a

Browse files
committed
Initial commit
0 parents  commit bdfc82a

30 files changed

+759
-0
lines changed

.babelrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"stage": 0
3+
}

.editorconfig

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# http://editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
9+
# Change these settings to your own preference
10+
indent_style = space
11+
indent_size = 2
12+
13+
# We recommend you to keep these unchanged
14+
end_of_line = lf
15+
charset = utf-8
16+
trim_trailing_whitespace = true
17+
insert_final_newline = true
18+
19+
[*.md]
20+
trim_trailing_whitespace = false

.eslintrc

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"parser": "babel-eslint",
3+
"plugins": [
4+
"react"
5+
],
6+
"env": {
7+
"browser": true,
8+
"node": true,
9+
"es6": true
10+
},
11+
"globals": {
12+
"__DEV__": true
13+
},
14+
"ecmaFeatures": {
15+
"jsx": true
16+
},
17+
"rules": {
18+
// Strict mode
19+
"strict": [2, "never"],
20+
21+
// Code style
22+
"indent": [2, 2],
23+
"quotes": [2, "single"]
24+
}
25+
}

.gitattributes

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Automatically normalize line endings for all text-based files
2+
# http://git-scm.com/docs/gitattributes#_end_of_line_conversion
3+
* text=auto
4+
5+
# For the following file types, normalize line endings to LF on
6+
# checkin and prevent conversion to CRLF when they are checked out
7+
# (this is required in order to prevent newline related issues like,
8+
# for example, after the build script is run)
9+
.* text eol=lf
10+
*.css text eol=lf
11+
*.html text eol=lf
12+
*.jade text eol=lf
13+
*.js text eol=lf
14+
*.json text eol=lf
15+
*.less text eol=lf
16+
*.md text eol=lf
17+
*.sh text eol=lf
18+
*.txt text eol=lf
19+
*.xml text eol=lf

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Include your project-specific ignores in this file
2+
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files
3+
4+
build
5+
node_modules
6+
npm-debug.log

LICENSE.txt

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) Konstantin Tarkus (@koistya) | MIT License
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

README.md

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# React Static Boilerplate
2+
3+
> Static website generator built on top of React.js and Gulp/Webpack
4+
5+
<em>**NOTE**: It's still in early preview! Feel free to join the project :+1:</em>
6+
7+
### Features
8+
9+
&nbsp; &nbsp; ✓ Generates static `.html` pages from [React](http://facebook.github.io/react/) components<br>
10+
&nbsp; &nbsp; ✓ Next generation JavaScript with [Babel](https://github.com/babel/babel)<br>
11+
&nbsp; &nbsp; ✓ Next generation CSS with [postCSS](https://github.com/postcss/postcss) and [cssnext](http://cssnext.io/)<br>
12+
&nbsp; &nbsp; ✓ Development web-server with [React Hot Loader](http://gaearon.github.io/react-hot-loader/)<br>
13+
&nbsp; &nbsp; ✓ Bundling and optimization with [Gulp](http://gulpjs.com/)/[Webpack](http://webpack.github.io/)<br>
14+
&nbsp; &nbsp;[Code-splitting](https://github.com/webpack/docs/wiki/code-splitting) and async chunk loading<br>
15+
&nbsp; &nbsp; ✓ Easy deployment to [GitHub Pages](https://pages.github.com/) or [Amazon S3](http://davidwalsh.name/hosting-website-amazon-s3)<br>
16+
17+
### Getting Started
18+
19+
Just clone the repo, install Node.js modules and run `npm start`:
20+
21+
```
22+
$ git clone -o upstream https://github.com/koistya/react-static-boilerplate MyApp
23+
$ cd MyApp
24+
$ npm install
25+
$ npm start
26+
```
27+
28+
Then open [http://localhost:3000/](http://localhost:3000/) in your browser.
29+
30+
### Directory Layout
31+
32+
```
33+
.
34+
├── /build/ # The folder for compiled output
35+
├── /components/ # React.js components
36+
├── /content/ # React.js-based web pages and other assets
37+
├── /node_modules/ # 3rd-party libraries and utilities
38+
├── /scripts/ # JavaScript code
39+
│ ├── /app.js # Startup script
40+
│ ├── /pages.js # Utility to generate html pages during a build
41+
│ └── /routes-loader.js # Webpack loader to generate the list of URLs
42+
│── gulpfile.babel.js # Build automation script(s)
43+
│── package.json # The list of 3rd party libraries and utilities
44+
└── webpack.config.js # Configuration for bundling and optimization
45+
```
46+
47+
### How to Test
48+
49+
The unit tests are powered by [chai](http://chaijs.com/) and [mocha](http://mochajs.org/).
50+
51+
```
52+
$ npm test
53+
```
54+
55+
### How to Deploy
56+
57+
```shell
58+
$ npm run build -- --release # Builds the project in release mode
59+
$ npm run deploy # Deploys the project to GitHub Pages
60+
```
61+
62+
### How to Update
63+
64+
You can always fetch and merge the recent changes from this repo back into
65+
your own project:
66+
67+
```shell
68+
$ git checkout master
69+
$ git fetch upstream
70+
$ git merge upstream/master
71+
$ npm install
72+
```
73+
### Related Projects
74+
75+
* [React Starter Kit](https://github.com/kriasoft/react-starter-starter)
76+
77+
### Learn More
78+
79+
* [Getting Started with React.js](http://facebook.github.io/react/)
80+
* [React.js Wiki on GitHub](https://github.com/facebook/react/wiki)
81+
* [React.js Questions on StackOverflow](http://stackoverflow.com/questions/tagged/reactjs)
82+
* [React.js Discussion Board](https://discuss.reactjs.org/)
83+
* [Learn ES6](https://babeljs.io/docs/learn-es6/), [ES6 Features](https://github.com/lukehoban/es6features#readme)
84+
85+
---
86+
Copyright (c) Konstantin Tarkus ([@koistya](https://twitter.com/koistya)) | MIT License

components/Layout/Layout.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.Layout {
2+
3+
}

components/Layout/Layout.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react'; // eslint-disable-line no-unused-vars
2+
3+
class Layout {
4+
5+
render() {
6+
return (
7+
<div className="Layout">
8+
</div>
9+
);
10+
}
11+
12+
}
13+
14+
export default Layout;

components/Layout/package.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "Layout",
3+
"main": "./Layout.js"
4+
}

components/Navigation/Navigation.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.Navigation {
2+
3+
}

components/Navigation/Navigation.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react'; // eslint-disable-line no-unused-vars
2+
3+
export default class {
4+
5+
render() {
6+
return (
7+
<ul className="Navigation" role="menu">
8+
<li><a href="#/">Home</a></li>
9+
<li><a href="#/about">About</a></li>
10+
</ul>
11+
);
12+
}
13+
14+
}

components/Navigation/package.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "Navigation",
3+
"main": "./Navigation.js"
4+
}

content/404.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* React Static Boilerplate
3+
* Copyright (c) Konstantin Tarkus | MIT License
4+
*/
5+
6+
import React from 'react'; // eslint-disable-line no-unused-vars
7+
8+
export default class {
9+
10+
render() {
11+
return (
12+
<div>
13+
<h1>Not Found</h1>
14+
<p>The page you're looking for was not found.</p>
15+
</div>
16+
);
17+
}
18+
19+
};

content/500.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* React Static Boilerplate
3+
* Copyright (c) Konstantin Tarkus | MIT License
4+
*/
5+
6+
import React from 'react'; // eslint-disable-line no-unused-vars
7+
8+
export default class {
9+
10+
render() {
11+
return (
12+
<div>
13+
<h1>Error</h1>
14+
<p>An error occurred.</p>
15+
</div>
16+
);
17+
}
18+
19+
};

content/about.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* React Static Boilerplate
3+
* Copyright (c) Konstantin Tarkus | MIT License
4+
*/
5+
6+
import React from 'react'; // eslint-disable-line no-unused-vars
7+
8+
export default class {
9+
10+
render() {
11+
return (
12+
<div>
13+
<h1>About Us</h1>
14+
<p>Coming soon.</p>
15+
</div>
16+
);
17+
}
18+
19+
};

content/blog/index.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* React Static Boilerplate
3+
* Copyright (c) Konstantin Tarkus | MIT License
4+
*/
5+
6+
import React from 'react'; // eslint-disable-line no-unused-vars
7+
8+
export default class Page {
9+
10+
render() {
11+
return (
12+
<div>
13+
<h1>Blog</h1>
14+
<p>Coming soon.</p>
15+
</div>
16+
);
17+
}
18+
19+
};

content/blog/test-article-one.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* React Static Boilerplate
3+
* Copyright (c) Konstantin Tarkus | MIT License
4+
*/
5+
6+
import React from 'react'; // eslint-disable-line no-unused-vars
7+
8+
export default class {
9+
10+
render() {
11+
return (
12+
<div>
13+
<h1>Test Article 1</h1>
14+
<p>Coming soon.</p>
15+
</div>
16+
);
17+
}
18+
19+
};

content/blog/test-article-two.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* React Static Boilerplate
3+
* Copyright (c) Konstantin Tarkus | MIT License
4+
*/
5+
6+
import React from 'react'; // eslint-disable-line no-unused-vars
7+
8+
export default class {
9+
10+
render() {
11+
return (
12+
<div>
13+
<h1>Test Article 2</h1>
14+
<p>Coming soon.</p>
15+
</div>
16+
);
17+
}
18+
19+
};

content/index.html

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!doctype html>
2+
<html class="no-js" lang="">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="x-ua-compatible" content="ie=edge">
6+
<title><%- title %></title>
7+
<meta name="description" content="">
8+
<meta name="viewport" content="width=device-width, initial-scale=1">
9+
<link rel="apple-touch-icon" href="apple-touch-icon.png">
10+
</head>
11+
<body>
12+
<div id="app"><%= body %></div>
13+
<script src="/app.js"></script>
14+
<script>
15+
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
16+
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
17+
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
18+
e.src='https://www.google-analytics.com/analytics.js';
19+
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
20+
ga('create','UA-XXXXX-X','auto');ga('send','pageview');
21+
</script>
22+
</body>
23+
</html>

content/index.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* React Static Boilerplate
3+
* Copyright (c) Konstantin Tarkus | MIT License
4+
*/
5+
6+
import React from 'react'; // eslint-disable-line no-unused-vars
7+
8+
export default class {
9+
10+
render() {
11+
return (
12+
<div>
13+
<h1>Home page</h1>
14+
<p>Coming soon.</p>
15+
</div>
16+
);
17+
}
18+
19+
};

0 commit comments

Comments
 (0)