Skip to content

Commit

Permalink
Start of migration.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vagr9K committed Jul 2, 2017
1 parent 940439a commit 1e89c1f
Show file tree
Hide file tree
Showing 47 changed files with 1,747 additions and 1,788 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Expand Up @@ -14,7 +14,7 @@
},
"settings": {
"import/resolver": "webpack",
"import/core-modules": ["gatsby-helpers", "config"]
"import/core-modules": []
},
"env": {
"browser": true
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -50,6 +50,7 @@ jspm_packages

# Build Files
public/
.cache/

# Gatsby context
.gatsby-context.js
Expand Down
24 changes: 0 additions & 24 deletions config.toml

This file was deleted.

10 changes: 0 additions & 10 deletions gatsby-browser.js

This file was deleted.

22 changes: 22 additions & 0 deletions gatsby-config.js
@@ -0,0 +1,22 @@
module.exports = {
siteMetadata: {
siteTitle: 'Gatsby Material Starter',
linkPrefix: '/gatsby-material-starter',
googleAnalyticsID: 'UA-47311644-4',
disqusShortname: 'https-vagr9k-github-io-gatsby-material-starter',
postDefaultCategoryID: '12121212',
userName: 'Material User',
userLocation: 'Yerevan, Armenia',
userAvatar: 'https://api.adorable.io/avatars/150/test.png',
userDescription: "Yeah, I like animals better than people sometimes... Especially dogs. Dogs are the best. Every time you come home, they act like they haven't seen you in a year. And the good thing about dogs... is they got different dogs for different people.",
userLinks: [
['Website', '//mywebsite.example.local', 'fa fa-link'],
['GitHub', '//github.com.local/USER', 'fa fa-github'],
['Twitter', '//twitter.local/USER', 'fa fa-twitter'],
['Instagram', '//instagram.local/USER', 'fa fa-instagram'],
['Facebook', '//facebook.com.local/USER', 'fa fa-facebook'],
['Email', 'mailto:gmail.com.local/USER', 'fa fa-envelope'],
],
copyright: 'Copyright © 2017. Material User',
},
};
7 changes: 3 additions & 4 deletions package.json
Expand Up @@ -5,10 +5,9 @@
"author": "Ruben Harutyunyan",
"dependencies": {
"font-awesome": "^4.7.0",
"gatsby": "^0.12.45",
"gatsby": "next",
"gatsby-link": "next",
"react-disqus-comments": "^1.0.3",
"react-ga": "^2.2.0",
"react-helmet": "^5.0.3",
"react-md": "^1.1.0-alpha-5"
},
"devDependencies": {
Expand Down Expand Up @@ -36,4 +35,4 @@
"lint": "eslint --ext .js,.jsx --ignore-pattern public .",
"gh-deploy": "npm run clean && npm run build-pl && gh-pages -d public"
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,15 +1,14 @@
import React from 'react';
import FontIcon from 'react-md/lib/FontIcons';
import { browserHistory } from 'react-router';
import { prefixLink } from 'gatsby-helpers';
import { browserHistory } from 'gatsby-link';
import { config } from 'config';

const NavList = [{
divider: false,
subheader: false,
primaryText: 'Home',
leftIcon: <FontIcon>home</FontIcon>,
onClick: () => browserHistory.push(prefixLink('/')),
onClick: () => browserHistory.push('/'),
}, {
divider: true,
},
Expand Down Expand Up @@ -37,8 +36,10 @@ NavList.push(
subheader: false,
primaryText: 'About',
leftIcon: <FontIcon>person</FontIcon>,
onClick: () => browserHistory.push(prefixLink('/about/')),
onClick: () => browserHistory.push('/about/'),
},
);

export default NavList;

// TODO: Does browserhistory have prefixLink?
File renamed without changes.
File renamed without changes.
Expand Up @@ -4,8 +4,7 @@ import CardTitle from 'react-md/lib/Cards/CardTitle';
import Button from 'react-md/lib/Buttons';
import Avatar from 'react-md/lib/Avatars';
import FontIcon from 'react-md/lib/FontIcons';
import { Link } from 'react-router';
import { prefixLink } from 'gatsby-helpers';
import { Link } from 'gatsby-link';
import Media, { MediaOverlay } from 'react-md/lib/Media';
import PostTags from '../PostTags/PostTags.jsx';

Expand All @@ -15,7 +14,7 @@ class PostPreview extends Component {
const { postInfo } = this.props;
return (
<Card key={postInfo.path} raise className="md-grid md-cell md-cell--4">
<Link style={{ textDecoration: 'none' }} to={prefixLink(postInfo.path)}>
<Link style={{ textDecoration: 'none' }} to={postInfo.path}>
<Media>
<img src={postInfo.cover} alt={postInfo.title} />
<MediaOverlay>
Expand Down
@@ -1,6 +1,5 @@
import React, { Component } from 'react';
import { Link } from 'react-router';
import { prefixLink } from 'gatsby-helpers';
import { Link } from 'gatsby-link';
import Chip from 'react-md/lib/Chips';
import './PostTags.scss';

Expand All @@ -11,7 +10,7 @@ class PostTags extends Component {
<div>
{
tags && tags.map(tag =>
<Link key={tag} style={{ textDecoration: 'none' }} to={prefixLink('/tags/')}>
<Link key={tag} style={{ textDecoration: 'none' }} to={'/tags/'}>
<Chip label={tag} className="post-preview-tags" />
</Link>)
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 6 additions & 5 deletions html.jsx → src/html.jsx
Expand Up @@ -3,9 +3,6 @@
/* eslint global-require:"off" */
import React from 'react';
import Helmet from 'react-helmet';
import { prefixLink } from 'gatsby-helpers';

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

export default class HTML extends React.Component {
render() {
Expand All @@ -32,17 +29,21 @@ export default class HTML extends React.Component {
/>
{head.title.toComponent()}
{head.meta.toComponent()}
<link rel="shortcut icon" href={prefixLink('/favicon.png')} />
{this.props.headComponents}
<link rel="shortcut icon" href={('/favicon.png')} />
{css}
</head>
<body>
<div
id="react-mount"
dangerouslySetInnerHTML={{ __html: this.props.body }}
/>
<script src={prefixLink(`/bundle.js?t=${BUILD_TIME}`)} />
{this.props.postBodyComponents}
</body>
</html>
);
}
}


// TODO: prefixLink breaks favicon
13 changes: 7 additions & 6 deletions pages/_template.jsx → src/layouts/index.jsx
@@ -1,20 +1,19 @@
import React from 'react';
import { config } from 'config';
import 'font-awesome/scss/font-awesome.scss';
import { prefixLink } from 'gatsby-helpers';
import Navigation from '../components/Navigation/Navigation.jsx';
import './_template.scss';
import './index.scss';

export default class Template extends React.Component {

getLocalTitle() {
const currentPath = this.props.location.pathname;
let title = '';
if (currentPath === prefixLink('/')) {
if (currentPath === ('/')) {
title = 'Home';
} else if (currentPath === prefixLink('/tags/')) {
} else if (currentPath === ('/tags/')) {
title = 'Tags';
} else if (currentPath === prefixLink('/about/')) {
} else if (currentPath === ('/about/')) {
title = 'About';
} else {
title = 'Article';
Expand All @@ -25,8 +24,10 @@ export default class Template extends React.Component {
const { children } = this.props;
return (
<Navigation SiteConfig={config} LocalTitle={this.getLocalTitle()}>
{children}
{children()}
</Navigation>
);
}
}

// TODO: Removal of prefixLink breaks link checks
File renamed without changes.
File renamed without changes.
4 changes: 1 addition & 3 deletions pages/about.jsx → src/pages/about.jsx
@@ -1,13 +1,11 @@
import React, { Component } from 'react';
import { config } from 'config';
import Helmet from 'react-helmet';
import About from '../components/About/About.jsx';

class AboutPage extends Component {
render() {
return (
<div className="about-container">
<Helmet title={`About | ${config.siteTitle}`} />
{/* TODO: Set title from config.*/}
<About />
</div>
);
Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
96 changes: 0 additions & 96 deletions wrappers/atom-one-dark.css

This file was deleted.

37 changes: 0 additions & 37 deletions wrappers/md.jsx

This file was deleted.

0 comments on commit 1e89c1f

Please sign in to comment.