Skip to content

Commit

Permalink
start
Browse files Browse the repository at this point in the history
  • Loading branch information
snahedis committed Mar 7, 2017
0 parents commit 4a11b6c
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.DS_Store
npm-debug.log
node_modules
.gatsby-context.js
public
_sample
3 changes: 3 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
siteTitle="VS insoumis"
siteDescription="Le comparateur des Insoumis"
linkPrefix = ""
38 changes: 38 additions & 0 deletions html.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React from "react";
import { prefixLink } from "gatsby-helpers";
import Helmet from "react-helmet";

const BUILD_TIME = new Date().getTime();

const HTML = ({ body }) => {
const head = Helmet.rewind();

let css;
if (process.env.NODE_ENV === "production") {
css = <style dangerouslySetInnerHTML={{ __html: require("!raw!./public/styles.css") }} />;
}

return (
<html lang="fr">
<head>
<meta charSet="utf-8" />
<meta httpEquiv="x-ua-compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

{head.title.toComponent()}
{head.meta.toComponent()}
{css}
</head>
<body>
<div id="react-mount" dangerouslySetInnerHTML={{ __html: body }} />
<script src={prefixLink(`/bundle.js?t=${BUILD_TIME}`)} />
</body>
</html>
);
}

HTML.propTypes = {
body: React.PropTypes.string,
};

export default HTML;
46 changes: 46 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "vs-insoumis",
"private": true,
"dependencies": {
"react": "^15.4.2",
"react-helmet": "^4.0.0"
},
"devDependencies": {
"babel-eslint": "^7.1.1",
"eslint": "^3.14.1",
"eslint-plugin-react": "^6.9.0",
"gatsby": "^0.12.38"
},
"scripts": {
"start": "gatsby develop",
"build": "gatsby build",
"build:serve": "gatsby serve-build",
"deploy": "gatsby build --prefix-links && gh-pages -d public"
},
"eslintConfig": {
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true,
"es6": true
},
"extends": ["eslint:recommended", "plugin:react/recommended"],
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"semi": ["error", "always"],
"no-console": "warn"
}
}
}
6 changes: 6 additions & 0 deletions pages/404.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
path: /404.html
---
# 404 NOT FOUND

Oops, voilà qui est étrange !
11 changes: 11 additions & 0 deletions pages/_template.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';

const Template = ({ children }) => (
<div>
<header>La France Insoumise VS</header>
<nav>Liens</nav>
<div>{children}</div>
</div>
);

export default Template;
7 changes: 7 additions & 0 deletions pages/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react';

const Index = () => (
<div>Index</div>
);

export default Index;
6 changes: 6 additions & 0 deletions wrappers/md.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from 'react';

const Markdown = ({ route }) =>
<div dangerouslySetInnerHTML={{ __html: route.page.data.body }} />;

export default Markdown;

0 comments on commit 4a11b6c

Please sign in to comment.