Skip to content
This repository was archived by the owner on Feb 24, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ before_cache:
env:
global:
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer
- secure: "UDM1SACHM7XVf6oG8oFTe2A8Jd5Drsd8HCwMvlOkkeab02KO+0sS9myTRrDicvvEoKB8gNG1u1S74KH43mPScT58qgwYQMDkGl4IkSTyfZPnukbErQGyRoFlL8OY8G33ksjav/O0hnQyhWLtKXcFL/NL0AF0xavzmLBTP6jyi9k="

branches:
except:
Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,22 @@ INSTALLED_FLAG := $(VENDOR_DIR)/.installed
install: $(INSTALLED_FLAG)
$(INSTALLED_FLAG): Gemfile Gemfile.lock Makefile
bundle install --path $(VENDOR_DIR)
npm install react-tools
npm install -g webpack
npm install
@ touch $(INSTALLED_FLAG) # indicate that dependencies are installed

.PHONY: update
update: install
bundle update
npm update react-tools
npm update webpack
npm update
@ touch $(INSTALLED_FLAG) # indicate that dependencies are installed

# BUILD ########################################################################

.PHONY: build
build: install
jsx _src/ dist/js/ --no-cache-dir
webpack
bundle exec jekyll build --quiet
echo ${URL} > _site/CNAME
bundle exec htmlproof _site --href-ignore "#"
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ Based on the Code for Virginia Beach landing page (http://code4hr.org/)

* Ruby 2.1.2: `$ rbenv install 2.1.2`
* Bundler: `$ gem install bundler`
* Node: [Download Node](https://nodejs.org/en/)

### Running locally

```
$ make build
$ make run
```

Expand Down
9 changes: 9 additions & 0 deletions _src/app.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';
import { render } from 'react-dom';

import GithubProjectList from './containers/GithubProjectList';

render(
<GithubProjectList source='https://api.github.com/orgs/friendlycode/repos' />,
document.getElementById('github-projects')
);
15 changes: 15 additions & 0 deletions _src/components/GithubRepositoryItem.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';

export default class GithubRepositoryItem extends React.Component {
render() {
return (
<li className="project">
<div>
<h3>{this.props.repo.name}</h3>
<p>{this.props.repo.description}</p>
<a className="btn" href={this.props.repo.html_url} target="_blank">View on Github</a>
</div>
</li>
);
}
};
27 changes: 6 additions & 21 deletions _src/github-projects.js → _src/containers/GithubProjectList.jsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
var GithubRepositoryItem = React.createClass({
render: function() {
return (
<li className="project">
<div>
<h3>{this.props.repo.name}</h3>
<p>{this.props.repo.description}</p>
<a className="btn" href={this.props.repo.html_url} target="_blank">View on Github</a>
</div>
</li>
);
}
});
import React from 'react';

var GithubRepositoryList = React.createClass({
render: function() {
import GithubRepositoryItem from '../components/GithubRepositoryItem'

export default class GithubProjectList extends React.Component {
render() {
var repos = [];

jQuery.ajax({
Expand All @@ -39,9 +29,4 @@ var GithubRepositoryList = React.createClass({
</div>
);
}
});

React.render(
<GithubRepositoryList source='https://api.github.com/orgs/friendlycode/repos' />,
document.getElementById('github-projects')
);
}
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
// do it
LZLD.lazyLoadImages();
</script>
<script src="https://fb.me/react-0.13.3.min.js"></script>
<script src="dist/js/github-projects.js"></script>
<script src="dist/js/vendors.js"></script>
<script src="dist/js/app.js"></script>
</body>
</html>
26 changes: 26 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "friendlycode.homepage",
"description": "front end task runner for bundling and building the FriendColde hompage ui",
"dependencies": {
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"history": "^1.17.0",
"i": "^0.3.4",
"npm": "^3.5.3",
"react": "^0.14.6",
"react-addons-transition-group": "^0.14.6",
"react-dom": "^0.14.6"
},
"devDependencies": {
"babel-core": "^6.4.0",
"babel-loader": "^6.2.1",
"react-hot-loader": "^1.3.0",
"style-loader": "^0.13.0",
"webpack": "^1.12.10",
"webpack-dev-server": "^1.14.0"
},
"scripts": {
"dev-server": "webpack-dev-server --inline --hot --progress --colors --content-base dist/",
"dev": "webpack --progress --colors --watch"
}
}
38 changes: 38 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
var webpack = require('webpack');

module.exports = {
entry: {
app: './_src/app.jsx',
vendors: ['react', 'react-dom', 'react-addons-transition-group']
},
output: {
path: './dist/js/',
publicPath: '/js/',
filename: 'app.js'
},
module: {
loaders: [
{
test: /\.jsx?$/,
loader: 'babel',
exclude: '/node_modules/',
query: {
cacheDirectory: true,
presets: ['react', 'es2015']
}
}
]
},
resolve: {
extensions: ['', '.js', '.jsx']
},
devServer: {
historyApiFallback: true
},
plugins: [
new webpack.optimize.CommonsChunkPlugin('vendors', 'vendors.js'),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
minimize: true})
]
};