From c640bba61cda1bc966dfdf1de16f77e85039ac1f Mon Sep 17 00:00:00 2001 From: Jason Rundell Date: Tue, 12 May 2020 01:03:55 -0400 Subject: [PATCH 1/2] jsx files renamed to .jsx --- gatsby-node.js | 8 ++++---- src/components/BlogPostCard/{index.js => index.jsx} | 0 src/components/BlogPostList/{index.js => index.jsx} | 0 src/components/Breadcrumb/{index.js => index.jsx} | 0 src/components/ImageFluid/{index.js => index.jsx} | 0 src/components/Pagination/{index.js => index.jsx} | 0 src/components/SkipToMain/{index.js => index.jsx} | 0 src/components/TagsList/{index.js => index.jsx} | 0 src/pages/404/{index.js => index.jsx} | 0 src/pages/authors/{index.js => index.jsx} | 0 src/pages/categories/{index.js => index.jsx} | 0 src/pages/{index.js => index.jsx} | 0 src/pages/tags/{index.js => index.jsx} | 0 13 files changed, 4 insertions(+), 4 deletions(-) rename src/components/BlogPostCard/{index.js => index.jsx} (100%) rename src/components/BlogPostList/{index.js => index.jsx} (100%) rename src/components/Breadcrumb/{index.js => index.jsx} (100%) rename src/components/ImageFluid/{index.js => index.jsx} (100%) rename src/components/Pagination/{index.js => index.jsx} (100%) rename src/components/SkipToMain/{index.js => index.jsx} (100%) rename src/components/TagsList/{index.js => index.jsx} (100%) rename src/pages/404/{index.js => index.jsx} (100%) rename src/pages/authors/{index.js => index.jsx} (100%) rename src/pages/categories/{index.js => index.jsx} (100%) rename src/pages/{index.js => index.jsx} (100%) rename src/pages/tags/{index.js => index.jsx} (100%) diff --git a/gatsby-node.js b/gatsby-node.js index dbcecc6..b2d1049 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -6,7 +6,7 @@ const createTagPages = (createPage, edges) => { edges.forEach(({ node }) => { if (node.frontmatter.tags) { - node.frontmatter.tags.forEach((tag) => { + node.frontmatter.tags.forEach(tag => { if (!tagResults[tag]) { tagResults[tag] = [] } @@ -15,7 +15,7 @@ const createTagPages = (createPage, edges) => { } }) - Object.keys(tagResults).forEach((tagName) => { + Object.keys(tagResults).forEach(tagName => { const tagResult = tagResults[tagName] createPage({ path: `/tags/${tagName}/`, @@ -45,7 +45,7 @@ const createCategoryPages = (createPage, edges) => { } }) - Object.keys(categoryResults).forEach((category) => { + Object.keys(categoryResults).forEach(category => { const categoryResult = categoryResults[category] createPage({ path: `/categories/${category}/`, @@ -73,7 +73,7 @@ const createAuthorPages = (createPage, edges) => { } }) - Object.keys(authorResults).forEach((author) => { + Object.keys(authorResults).forEach(author => { const authorResult = authorResults[author] createPage({ path: `/authors/${author}/`, diff --git a/src/components/BlogPostCard/index.js b/src/components/BlogPostCard/index.jsx similarity index 100% rename from src/components/BlogPostCard/index.js rename to src/components/BlogPostCard/index.jsx diff --git a/src/components/BlogPostList/index.js b/src/components/BlogPostList/index.jsx similarity index 100% rename from src/components/BlogPostList/index.js rename to src/components/BlogPostList/index.jsx diff --git a/src/components/Breadcrumb/index.js b/src/components/Breadcrumb/index.jsx similarity index 100% rename from src/components/Breadcrumb/index.js rename to src/components/Breadcrumb/index.jsx diff --git a/src/components/ImageFluid/index.js b/src/components/ImageFluid/index.jsx similarity index 100% rename from src/components/ImageFluid/index.js rename to src/components/ImageFluid/index.jsx diff --git a/src/components/Pagination/index.js b/src/components/Pagination/index.jsx similarity index 100% rename from src/components/Pagination/index.js rename to src/components/Pagination/index.jsx diff --git a/src/components/SkipToMain/index.js b/src/components/SkipToMain/index.jsx similarity index 100% rename from src/components/SkipToMain/index.js rename to src/components/SkipToMain/index.jsx diff --git a/src/components/TagsList/index.js b/src/components/TagsList/index.jsx similarity index 100% rename from src/components/TagsList/index.js rename to src/components/TagsList/index.jsx diff --git a/src/pages/404/index.js b/src/pages/404/index.jsx similarity index 100% rename from src/pages/404/index.js rename to src/pages/404/index.jsx diff --git a/src/pages/authors/index.js b/src/pages/authors/index.jsx similarity index 100% rename from src/pages/authors/index.js rename to src/pages/authors/index.jsx diff --git a/src/pages/categories/index.js b/src/pages/categories/index.jsx similarity index 100% rename from src/pages/categories/index.js rename to src/pages/categories/index.jsx diff --git a/src/pages/index.js b/src/pages/index.jsx similarity index 100% rename from src/pages/index.js rename to src/pages/index.jsx diff --git a/src/pages/tags/index.js b/src/pages/tags/index.jsx similarity index 100% rename from src/pages/tags/index.js rename to src/pages/tags/index.jsx From 84e8461720b378f3fc5f9ad86c87132c7a2ee92f Mon Sep 17 00:00:00 2001 From: Jason Rundell Date: Tue, 12 May 2020 01:33:54 -0400 Subject: [PATCH 2/2] templates reorganized and renamed to jsx --- gatsby-node.js | 10 +++++----- .../{author-results.js => author-results/index.jsx} | 6 +++--- src/templates/{ => blog-list}/blog-list.module.scss | 0 src/templates/{blog-list.js => blog-list/index.jsx} | 8 ++++---- src/templates/{ => blog-post}/blog-post.css | 0 src/templates/{ => blog-post}/blog-post.module.scss | 6 +++--- src/templates/{blog-post.js => blog-post/index.jsx} | 10 +++++----- .../index.jsx} | 6 +++--- .../{tag-results.js => tag-results/index.jsx} | 4 ++-- 9 files changed, 25 insertions(+), 25 deletions(-) rename src/templates/{author-results.js => author-results/index.jsx} (90%) rename src/templates/{ => blog-list}/blog-list.module.scss (100%) rename src/templates/{blog-list.js => blog-list/index.jsx} (91%) rename src/templates/{ => blog-post}/blog-post.css (100%) rename src/templates/{ => blog-post}/blog-post.module.scss (92%) rename src/templates/{blog-post.js => blog-post/index.jsx} (92%) rename src/templates/{category-results.js => category-results/index.jsx} (90%) rename src/templates/{tag-results.js => tag-results/index.jsx} (94%) diff --git a/gatsby-node.js b/gatsby-node.js index b2d1049..4854bd4 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -1,7 +1,7 @@ const path = require('path') const createTagPages = (createPage, edges) => { - const tagResultsTemplate = path.resolve(`src/templates/tag-results.js`) + const tagResultsTemplate = path.resolve(`src/templates/tag-results/index.jsx`) const tagResults = {} edges.forEach(({ node }) => { @@ -31,7 +31,7 @@ const createTagPages = (createPage, edges) => { const createCategoryPages = (createPage, edges) => { const categoryResultsTemplate = path.resolve( - `src/templates/category-results.js` + `src/templates/category-results/index.jsx` ) const categoryResults = {} @@ -60,7 +60,7 @@ const createCategoryPages = (createPage, edges) => { } const createAuthorPages = (createPage, edges) => { - const authorResultsTemplate = path.resolve(`src/templates/author-results.js`) + const authorResultsTemplate = path.resolve(`src/templates/author-results/index.jsx`) const authorResults = {} edges.forEach(({ node }) => { @@ -90,7 +90,7 @@ const createAuthorPages = (createPage, edges) => { exports.createPages = async ({ actions, graphql, reporter }) => { const { createPage, createRedirect } = actions - const blogPostTemplate = path.resolve(`src/templates/blog-post.js`) + const blogPostTemplate = path.resolve(`src/templates/blog-post/index.jsx`) const result = await graphql(` { allMarkdownRemark( @@ -155,7 +155,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => { const nextPageNumber = i === numPages - 1 ? null : currentPage + 1 createPage({ path: i === 0 ? `/blog/` : `/blog/${i + 1}/`, - component: path.resolve('./src/templates/blog-list.js'), + component: path.resolve('./src/templates/blog-list/index.jsx'), context: { previousPageNumber, nextPageNumber, diff --git a/src/templates/author-results.js b/src/templates/author-results/index.jsx similarity index 90% rename from src/templates/author-results.js rename to src/templates/author-results/index.jsx index 6d0bb06..760248e 100644 --- a/src/templates/author-results.js +++ b/src/templates/author-results/index.jsx @@ -1,10 +1,10 @@ import React from 'react' import { Link, graphql } from 'gatsby' -import Layout from '../components/Layout' -import SEO from '../components/SEO' +import Layout from '../../components/Layout' +import SEO from '../../components/SEO' -import formatAuthorName from '../utils/formatAuthorName' +import formatAuthorName from '../../utils/formatAuthorName' export default (props) => { const { data, pageContext, path } = props diff --git a/src/templates/blog-list.module.scss b/src/templates/blog-list/blog-list.module.scss similarity index 100% rename from src/templates/blog-list.module.scss rename to src/templates/blog-list/blog-list.module.scss diff --git a/src/templates/blog-list.js b/src/templates/blog-list/index.jsx similarity index 91% rename from src/templates/blog-list.js rename to src/templates/blog-list/index.jsx index 52ddcbc..15f0e29 100644 --- a/src/templates/blog-list.js +++ b/src/templates/blog-list/index.jsx @@ -1,10 +1,10 @@ import React from 'react' import { graphql } from 'gatsby' -import Layout from '../components/Layout' -import SEO from '../components/SEO' -import BlogPostList from '../components/BlogPostList' -import Pagination from '../components/Pagination' +import Layout from '../../components/Layout' +import SEO from '../../components/SEO' +import BlogPostList from '../../components/BlogPostList' +import Pagination from '../../components/Pagination' import styles from './blog-list.module.scss' diff --git a/src/templates/blog-post.css b/src/templates/blog-post/blog-post.css similarity index 100% rename from src/templates/blog-post.css rename to src/templates/blog-post/blog-post.css diff --git a/src/templates/blog-post.module.scss b/src/templates/blog-post/blog-post.module.scss similarity index 92% rename from src/templates/blog-post.module.scss rename to src/templates/blog-post/blog-post.module.scss index b7400cb..00aa341 100644 --- a/src/templates/blog-post.module.scss +++ b/src/templates/blog-post/blog-post.module.scss @@ -1,3 +1,3 @@ -.post__meta { - font-size: 0.8rem; -} +.post__meta { + font-size: 0.8rem; +} diff --git a/src/templates/blog-post.js b/src/templates/blog-post/index.jsx similarity index 92% rename from src/templates/blog-post.js rename to src/templates/blog-post/index.jsx index dfbf58f..7b11d91 100644 --- a/src/templates/blog-post.js +++ b/src/templates/blog-post/index.jsx @@ -4,12 +4,12 @@ import moment from 'moment' import { Row, Typography } from 'antd' import { LeftOutlined, RightOutlined } from '@ant-design/icons' -import Layout from '../components/Layout' -import SEO from '../components/SEO' -import TagsList from '../components/TagsList' +import Layout from '../../components/Layout' +import SEO from '../../components/SEO' +import TagsList from '../../components/TagsList' -import formatCategoryTitle from '../utils/formatCategoryTitle' -import formatAuthorName from '../utils/formatAuthorName' +import formatCategoryTitle from '../../utils/formatCategoryTitle' +import formatAuthorName from '../../utils/formatAuthorName' import './blog-post.css' import styles from './blog-post.module.scss' diff --git a/src/templates/category-results.js b/src/templates/category-results/index.jsx similarity index 90% rename from src/templates/category-results.js rename to src/templates/category-results/index.jsx index 166563b..a2c7a43 100644 --- a/src/templates/category-results.js +++ b/src/templates/category-results/index.jsx @@ -1,10 +1,10 @@ import React from 'react' import { Link, graphql } from 'gatsby' -import Layout from '../components/Layout' -import SEO from '../components/SEO' +import Layout from '../../components/Layout' +import SEO from '../../components/SEO' -import formatCategoryTitle from '../utils/formatCategoryTitle' +import formatCategoryTitle from '../../utils/formatCategoryTitle' export default (props) => { const { data, pageContext, path } = props diff --git a/src/templates/tag-results.js b/src/templates/tag-results/index.jsx similarity index 94% rename from src/templates/tag-results.js rename to src/templates/tag-results/index.jsx index 3c9186c..9d3acfa 100644 --- a/src/templates/tag-results.js +++ b/src/templates/tag-results/index.jsx @@ -1,8 +1,8 @@ import React from 'react' import { Link, graphql } from 'gatsby' -import Layout from '../components/Layout' -import SEO from '../components/SEO' +import Layout from '../../components/Layout' +import SEO from '../../components/SEO' export default (props) => { const { data, pageContext, path, tag } = props