diff --git a/gatsby-config.js b/gatsby-config.js
index 378c3b8..acf7eee 100644
--- a/gatsby-config.js
+++ b/gatsby-config.js
@@ -1,6 +1,6 @@
module.exports = {
siteMetadata: {
- url: 'https://alxshelepenok.github.com/gatsby-starter-lumen',
+ url: 'https://lumen.netlify.com/',
title: 'Blog by John Doe',
subtitle: 'Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu.',
copyright: '© All rights reserved.',
@@ -61,8 +61,7 @@ module.exports = {
url: site.siteMetadata.url + edge.node.fields.slug,
guid: site.siteMetadata.url + edge.node.fields.slug,
custom_elements: [{ 'content:encoded': edge.node.html }]
- })
- )
+ }))
),
query: `
{
@@ -101,15 +100,12 @@ module.exports = {
{
resolve: 'gatsby-remark-images',
options: {
- maxWidth: 960,
- linkImagesToOriginal: false
+ maxWidth: 960
}
},
{
resolve: 'gatsby-remark-responsive-iframe',
- options: {
- wrapperStyle: 'margin-bottom: 1.0725rem'
- }
+ options: { wrapperStyle: 'margin-bottom: 1.0725rem' }
},
'gatsby-remark-prismjs',
'gatsby-remark-copy-linked-files',
@@ -121,9 +117,7 @@ module.exports = {
'gatsby-plugin-sharp',
{
resolve: 'gatsby-plugin-google-analytics',
- options: {
- trackingId: ''
- }
+ options: { trackingId: '' }
},
{
resolve: 'gatsby-plugin-sitemap',
diff --git a/gatsby-node.js b/gatsby-node.js
index cb5c1a9..baf5b41 100644
--- a/gatsby-node.js
+++ b/gatsby-node.js
@@ -9,13 +9,12 @@ exports.createPages = ({ graphql, boundActionCreators }) => {
const { createPage } = boundActionCreators;
return new Promise((resolve, reject) => {
- const postTemplate = path.resolve('./src/templates/post-template.js');
- const pageTemplate = path.resolve('./src/templates/page-template.js');
- const tagTemplate = path.resolve('./src/templates/tag-template.js');
- const categoryTemplate = path.resolve('./src/templates/category-template.js');
+ const postTemplate = path.resolve('./src/templates/post-template.jsx');
+ const pageTemplate = path.resolve('./src/templates/page-template.jsx');
+ const tagTemplate = path.resolve('./src/templates/tag-template.jsx');
+ const categoryTemplate = path.resolve('./src/templates/category-template.jsx');
- graphql(
- `
+ graphql(`
{
allMarkdownRemark(
limit: 1000,
@@ -35,8 +34,7 @@ exports.createPages = ({ graphql, boundActionCreators }) => {
}
}
}
- `
- ).then((result) => {
+ `).then((result) => {
if (result.errors) {
console.log(result.errors);
reject(result.errors);
@@ -47,17 +45,13 @@ exports.createPages = ({ graphql, boundActionCreators }) => {
createPage({
path: edge.node.fields.slug,
component: slash(pageTemplate),
- context: {
- slug: edge.node.fields.slug
- }
+ context: { slug: edge.node.fields.slug }
});
} else if (_.get(edge, 'node.frontmatter.layout') === 'post') {
createPage({
path: edge.node.fields.slug,
component: slash(postTemplate),
- context: {
- slug: edge.node.fields.slug
- }
+ context: { slug: edge.node.fields.slug }
});
let tags = [];
@@ -71,9 +65,7 @@ exports.createPages = ({ graphql, boundActionCreators }) => {
createPage({
path: tagPath,
component: tagTemplate,
- context: {
- tag
- }
+ context: { tag }
});
});
@@ -88,9 +80,7 @@ exports.createPages = ({ graphql, boundActionCreators }) => {
createPage({
path: categoryPath,
component: categoryTemplate,
- context: {
- category
- }
+ context: { category }
});
});
}
@@ -124,9 +114,7 @@ exports.onCreateNode = ({ node, boundActionCreators, getNode }) => {
});
if (node.frontmatter.tags) {
- const tagSlugs = node.frontmatter.tags.map(
- tag => `/tags/${_.kebabCase(tag)}/`
- );
+ const tagSlugs = node.frontmatter.tags.map(tag => `/tags/${_.kebabCase(tag)}/`);
createNodeField({ node, name: 'tagSlugs', value: tagSlugs });
}
diff --git a/src/components/CategoryTemplateDetails/index.jsx b/src/components/CategoryTemplateDetails/index.jsx
index 8fc7d98..47b4f1e 100644
--- a/src/components/CategoryTemplateDetails/index.jsx
+++ b/src/components/CategoryTemplateDetails/index.jsx
@@ -1,16 +1,13 @@
import React from 'react';
-import PropTypes from 'prop-types';
import Post from '../Post';
class CategoryTemplateDetails extends React.Component {
render() {
const items = [];
- const category = this.props.pathContext.category;
+ const { category } = this.props.pathContext;
const posts = this.props.data.allMarkdownRemark.edges;
posts.forEach((post) => {
- items.push(
-
{post.description}
- Read +{description}
+ Read{subtitle}