Skip to content

Commit

Permalink
bug: nested page export
Browse files Browse the repository at this point in the history
  • Loading branch information
cpboyd committed Aug 4, 2022
1 parent 75c1293 commit d4fd528
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 22 deletions.
32 changes: 32 additions & 0 deletions www/src/pages/prose.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import * as React from "react"
import { PageProps, graphql, HeadFC } from "gatsby"
import { Text } from "@chakra-ui/react"
import { WritingViewDataProps, WritingView } from "../components/writing/writing-view"
import { Heading } from "../components/typography/heading"
import { Spacer } from "../components/blocks/spacer"
import { SEO } from "../components/seo"
import { article } from "../constants/json-ld"

const ProseTemplate: React.FC<PageProps<WritingViewDataProps>> = ({
data: { post },
location: { pathname },
children: mdxContent,
}) => (
<WritingView post={post} mdxContent={mdxContent} pathname={pathname} type="prose">
<Text
color="textEmphasized"
fontWeight={500}
textAlign="center"
fontSize={[`md`, null, null, `1.125rem`, `1.3125rem`]}
>
{post.category.name}
</Text>
<Spacer size={6} axis="vertical" />
<Heading as="h1" textAlign="center">
{post.title}
</Heading>
<Spacer size={[16, null, null, 20]} axis="vertical" />
</WritingView>
)

export default ProseTemplate
23 changes: 1 addition & 22 deletions www/src/templates/prose.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,7 @@ import { Heading } from "../components/typography/heading"
import { Spacer } from "../components/blocks/spacer"
import { SEO } from "../components/seo"
import { article } from "../constants/json-ld"

const ProseTemplate: React.FC<PageProps<WritingViewDataProps>> = ({
data: { post },
location: { pathname },
children: mdxContent,
}) => (
<WritingView post={post} mdxContent={mdxContent} pathname={pathname} type="prose">
<Text
color="textEmphasized"
fontWeight={500}
textAlign="center"
fontSize={[`md`, null, null, `1.125rem`, `1.3125rem`]}
>
{post.category.name}
</Text>
<Spacer size={6} axis="vertical" />
<Heading as="h1" textAlign="center">
{post.title}
</Heading>
<Spacer size={[16, null, null, 20]} axis="vertical" />
</WritingView>
)
import ProseTemplate from "../pages/prose"

export default ProseTemplate

Expand Down

0 comments on commit d4fd528

Please sign in to comment.