Make category page work without errors
This commit is contained in:
@@ -34,13 +34,12 @@ exports.createPages = async function ({ actions, graphql }) {
|
|||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
{categoryName: category.name})
|
{categoryName: category.name})
|
||||||
|
|
||||||
createPage({
|
createPage({
|
||||||
path: createSlug(category.name),
|
path: createSlug(category.name),
|
||||||
component: require.resolve("./src/templates/categoryTemplate.js"),
|
component: require.resolve("./src/templates/categoryTemplate.js"),
|
||||||
context: {
|
context: {
|
||||||
categoryName: category.name,
|
categoryName: category.name,
|
||||||
data: data,
|
data: data.data,
|
||||||
limit: null,
|
limit: null,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,12 +4,13 @@ import { graphql } from "gatsby"
|
|||||||
import Layout from "../components/layout"
|
import Layout from "../components/layout"
|
||||||
import SEO from "../components/seo"
|
import SEO from "../components/seo"
|
||||||
import SideBar from "../components/sidebar"
|
import SideBar from "../components/sidebar"
|
||||||
|
import CategoryDescription from "../components/categorydescription"
|
||||||
import { Container, Row, Col } from "react-bootstrap"
|
import { Container, Row, Col } from "react-bootstrap"
|
||||||
import BookFeed from "../components/feed"
|
import BookFeed from "../components/feed"
|
||||||
|
|
||||||
const basicTemplate = props => {
|
const basicTemplate = props => {
|
||||||
const { pageContext } = props
|
const { pageContext } = props
|
||||||
const { categoryName, books } = pageContext
|
const { categoryName, data } = pageContext
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
@@ -20,7 +21,8 @@ const basicTemplate = props => {
|
|||||||
<SideBar />
|
<SideBar />
|
||||||
</Col>
|
</Col>
|
||||||
<Col>
|
<Col>
|
||||||
<BookFeed books={books} categoryName={categoryName} />
|
<CategoryDescription categoryName={categoryName} />
|
||||||
|
<BookFeed data={data} categoryName={categoryName} />
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</Container>
|
</Container>
|
||||||
|
|||||||
Reference in New Issue
Block a user