Skip to content

Commit

Permalink
Merge branch 'fix/js-to-jsx'
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonrundell committed May 12, 2020
2 parents 65fae53 + 84e8461 commit dfe7309
Show file tree
Hide file tree
Showing 21 changed files with 29 additions and 29 deletions.
18 changes: 9 additions & 9 deletions gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
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 }) => {
if (node.frontmatter.tags) {
node.frontmatter.tags.forEach((tag) => {
node.frontmatter.tags.forEach(tag => {
if (!tagResults[tag]) {
tagResults[tag] = []
}
Expand All @@ -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}/`,
Expand All @@ -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 = {}

Expand All @@ -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}/`,
Expand All @@ -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 }) => {
Expand All @@ -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}/`,
Expand All @@ -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(
Expand Down Expand Up @@ -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,
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.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.post__meta {
font-size: 0.8rem;
}
.post__meta {
font-size: 0.8rem;
}
10 changes: 5 additions & 5 deletions src/templates/blog-post.js → src/templates/blog-post/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit dfe7309

Please sign in to comment.