diff --git a/.eslintrc.json b/.eslintrc.json index 784f72c5..8ee304ae 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -14,7 +14,7 @@ }, "settings": { "import/resolver": "webpack", - "import/core-modules": ["gatsby-helpers", "config"] + "import/core-modules": [] }, "env": { "browser": true diff --git a/.gitignore b/.gitignore index 7aae0584..308b2db0 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,7 @@ jspm_packages # Build Files public/ +.cache/ # Gatsby context .gatsby-context.js diff --git a/config.toml b/config.toml deleted file mode 100644 index 225aacf1..00000000 --- a/config.toml +++ /dev/null @@ -1,24 +0,0 @@ -siteTitle="Gatsby Material Starter" # Site title -linkPrefix = "/gatsby-material-starter" # Gatsby link prefix -googleAnalyticsID = 'UA-47311644-4' # GA id -disqusShortname = 'https-vagr9k-github-io-gatsby-material-starter' # Disqus shortname - -postDefaultCategoryID= '12121212' # Disqus category for posts without categories. -userName = "Material User" # Your public name -userLocation = "Yerevan, Armenia" # Your location -userAvatar = "https://api.adorable.io/avatars/150/test.png" # Your avatar -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." # Your short "about me" - -# An array of links to you projects/social profiles you want to share -# FORMAT: ['LABEL', 'LINK', 'ICON CLASSNAME'] -# ICON CLASSNAME can be either FontAwesome or Material Design icon classnames. -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" # Footer copyright \ No newline at end of file diff --git a/gatsby-browser.js b/gatsby-browser.js deleted file mode 100644 index 1290e7a9..00000000 --- a/gatsby-browser.js +++ /dev/null @@ -1,10 +0,0 @@ -import ReactGA from 'react-ga'; -import { config } from 'config'; - -if (config.googleAnalyticsID) { - ReactGA.initialize(config.googleAnalyticsID); - - exports.onRouteUpdate = (state) => { - ReactGA.pageview(state.pathname); - }; -} diff --git a/gatsby-config.js b/gatsby-config.js new file mode 100644 index 00000000..fa53fe5b --- /dev/null +++ b/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', + }, +}; diff --git a/package.json b/package.json index 3511a9c9..d0341fb3 100644 --- a/package.json +++ b/package.json @@ -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": { @@ -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" } -} \ No newline at end of file +} diff --git a/components/About/About.jsx b/src/components/About/About.jsx similarity index 100% rename from components/About/About.jsx rename to src/components/About/About.jsx diff --git a/components/About/About.scss b/src/components/About/About.scss similarity index 100% rename from components/About/About.scss rename to src/components/About/About.scss diff --git a/components/Disqus/Disqus.jsx b/src/components/Disqus/Disqus.jsx similarity index 100% rename from components/Disqus/Disqus.jsx rename to src/components/Disqus/Disqus.jsx diff --git a/components/DrawerChildren/DrawerChildren.jsx b/src/components/DrawerChildren/DrawerChildren.jsx similarity index 100% rename from components/DrawerChildren/DrawerChildren.jsx rename to src/components/DrawerChildren/DrawerChildren.jsx diff --git a/components/DrawerChildren/DrawerChildren.scss b/src/components/DrawerChildren/DrawerChildren.scss similarity index 100% rename from components/DrawerChildren/DrawerChildren.scss rename to src/components/DrawerChildren/DrawerChildren.scss diff --git a/components/Footer/Footer.jsx b/src/components/Footer/Footer.jsx similarity index 100% rename from components/Footer/Footer.jsx rename to src/components/Footer/Footer.jsx diff --git a/components/Footer/Footer.scss b/src/components/Footer/Footer.scss similarity index 100% rename from components/Footer/Footer.scss rename to src/components/Footer/Footer.scss diff --git a/components/Navigation/NavList.jsx b/src/components/Navigation/NavList.jsx similarity index 78% rename from components/Navigation/NavList.jsx rename to src/components/Navigation/NavList.jsx index 1c9e1949..3b729584 100644 --- a/components/Navigation/NavList.jsx +++ b/src/components/Navigation/NavList.jsx @@ -1,7 +1,6 @@ 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 = [{ @@ -9,7 +8,7 @@ const NavList = [{ subheader: false, primaryText: 'Home', leftIcon: home, - onClick: () => browserHistory.push(prefixLink('/')), + onClick: () => browserHistory.push('/'), }, { divider: true, }, @@ -37,8 +36,10 @@ NavList.push( subheader: false, primaryText: 'About', leftIcon: person, - onClick: () => browserHistory.push(prefixLink('/about/')), + onClick: () => browserHistory.push('/about/'), }, ); export default NavList; + +// TODO: Does browserhistory have prefixLink? diff --git a/components/Navigation/Navigation.jsx b/src/components/Navigation/Navigation.jsx similarity index 100% rename from components/Navigation/Navigation.jsx rename to src/components/Navigation/Navigation.jsx diff --git a/components/Navigation/Navigation.scss b/src/components/Navigation/Navigation.scss similarity index 100% rename from components/Navigation/Navigation.scss rename to src/components/Navigation/Navigation.scss diff --git a/components/PostPreview/PostPreview.jsx b/src/components/PostPreview/PostPreview.jsx similarity index 87% rename from components/PostPreview/PostPreview.jsx rename to src/components/PostPreview/PostPreview.jsx index e41bb169..c01e1491 100644 --- a/components/PostPreview/PostPreview.jsx +++ b/src/components/PostPreview/PostPreview.jsx @@ -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'; @@ -15,7 +14,7 @@ class PostPreview extends Component { const { postInfo } = this.props; return ( - + {postInfo.title} diff --git a/components/PostTags/PostTags.jsx b/src/components/PostTags/PostTags.jsx similarity index 81% rename from components/PostTags/PostTags.jsx rename to src/components/PostTags/PostTags.jsx index 2cb9a053..998e2380 100644 --- a/components/PostTags/PostTags.jsx +++ b/src/components/PostTags/PostTags.jsx @@ -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'; @@ -11,7 +10,7 @@ class PostTags extends Component {
{ tags && tags.map(tag => - + ) } diff --git a/components/PostTags/PostTags.scss b/src/components/PostTags/PostTags.scss similarity index 100% rename from components/PostTags/PostTags.scss rename to src/components/PostTags/PostTags.scss diff --git a/components/ToolbarActions/ToolbarActions.jsx b/src/components/ToolbarActions/ToolbarActions.jsx similarity index 100% rename from components/ToolbarActions/ToolbarActions.jsx rename to src/components/ToolbarActions/ToolbarActions.jsx diff --git a/components/ToolbarActions/ToolbarActions.scss b/src/components/ToolbarActions/ToolbarActions.scss similarity index 100% rename from components/ToolbarActions/ToolbarActions.scss rename to src/components/ToolbarActions/ToolbarActions.scss diff --git a/components/UserInfo/UserInfo.jsx b/src/components/UserInfo/UserInfo.jsx similarity index 100% rename from components/UserInfo/UserInfo.jsx rename to src/components/UserInfo/UserInfo.jsx diff --git a/components/UserInfo/UserInfo.scss b/src/components/UserInfo/UserInfo.scss similarity index 100% rename from components/UserInfo/UserInfo.scss rename to src/components/UserInfo/UserInfo.scss diff --git a/components/UserLinks/UserLinks.jsx b/src/components/UserLinks/UserLinks.jsx similarity index 100% rename from components/UserLinks/UserLinks.jsx rename to src/components/UserLinks/UserLinks.jsx diff --git a/components/UserLinks/UserLinks.scss b/src/components/UserLinks/UserLinks.scss similarity index 100% rename from components/UserLinks/UserLinks.scss rename to src/components/UserLinks/UserLinks.scss diff --git a/components/UserNavInfo/UserNavInfo.jsx b/src/components/UserNavInfo/UserNavInfo.jsx similarity index 100% rename from components/UserNavInfo/UserNavInfo.jsx rename to src/components/UserNavInfo/UserNavInfo.jsx diff --git a/components/UserNavInfo/UserNavInfo.scss b/src/components/UserNavInfo/UserNavInfo.scss similarity index 100% rename from components/UserNavInfo/UserNavInfo.scss rename to src/components/UserNavInfo/UserNavInfo.scss diff --git a/html.jsx b/src/html.jsx similarity index 81% rename from html.jsx rename to src/html.jsx index 5d758b77..02138789 100644 --- a/html.jsx +++ b/src/html.jsx @@ -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() { @@ -32,7 +29,8 @@ export default class HTML extends React.Component { /> {head.title.toComponent()} {head.meta.toComponent()} - + {this.props.headComponents} + {css} @@ -40,9 +38,12 @@ export default class HTML extends React.Component { id="react-mount" dangerouslySetInnerHTML={{ __html: this.props.body }} /> -