Make category page work without errors

This commit is contained in:
Vishnu KS
2020-08-23 12:49:02 +05:30
parent 4d81bf3fe1
commit 1593c00620
2 changed files with 5 additions and 4 deletions

View File

@@ -34,13 +34,12 @@ exports.createPages = async function ({ actions, graphql }) {
}
`,
{categoryName: category.name})
createPage({
path: createSlug(category.name),
component: require.resolve("./src/templates/categoryTemplate.js"),
context: {
categoryName: category.name,
data: data,
data: data.data,
limit: null,
},
})

View File

@@ -4,12 +4,13 @@ import { graphql } from "gatsby"
import Layout from "../components/layout"
import SEO from "../components/seo"
import SideBar from "../components/sidebar"
import CategoryDescription from "../components/categorydescription"
import { Container, Row, Col } from "react-bootstrap"
import BookFeed from "../components/feed"
const basicTemplate = props => {
const { pageContext } = props
const { categoryName, books } = pageContext
const { categoryName, data } = pageContext
return (
<Layout>
@@ -20,7 +21,8 @@ const basicTemplate = props => {
<SideBar />
</Col>
<Col>
<BookFeed books={books} categoryName={categoryName} />
<CategoryDescription categoryName={categoryName} />
<BookFeed data={data} categoryName={categoryName} />
</Col>
</Row>
</Container>