Skip to content

Commit fe9a2be

Browse files
committed
initial
1 parent df1e550 commit fe9a2be

File tree

6 files changed

+52
-6
lines changed

6 files changed

+52
-6
lines changed

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
]
1616
],
1717
"access": "public",
18-
"baseBranch": "master",
18+
"baseBranch": "main",
1919
"updateInternalDependencies": "patch",
2020
"ignore": []
2121
}

.changeset/thin-wasps-kneel.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@lekoarts/gatsby-theme-minimal-blog": minor
3+
---
4+
5+
**Feature:** The `<Post />` component now has a `<PostFooter />` component at the bottom of the page (between the end of the post content and the global footer). You can shadow this to e.g. display a comment section below a post. The component receives its data through the `post` prop which holds the same data as what `<Post />` receives.
6+
7+
Fixes https://github.com/LekoArts/gatsby-themes/discussions/698.

examples/minimal-blog/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,18 @@ defer: false
200200
---
201201
```
202202

203-
#### Changing the "Hero" text
203+
### Changing the "Hero" text
204204

205205
To edit the hero text ("Hi, I'm Lupin...), create a file at `src/@lekoarts/gatsby-theme-minimal-blog/texts/hero.mdx` to edit the text.
206206

207-
#### Changing the "Projects" part
207+
### Changing the "Projects" part
208208

209209
To edit the projects part below "Latest posts", create a file at `src/@lekoarts/gatsby-theme-minimal-blog/texts/bottom.mdx` to edit the contents.
210210

211+
### Extending the footer of the post
212+
213+
Inside the [`<Post />` component](https://github.com/LekoArts/gatsby-themes/blob/main/themes/gatsby-theme-minimal-blog/src/components/post.tsx) there's also a `<PostFooter />` component that you can shadow to display elements between the end of the post and the global footer. By default it returns `null`. Create a file at `src/@lekoarts/gatsby-theme-minimal-blog/components/post-footer.jsx` to edit this section. The `<PostFooter />` component receives the complete `post` prop that `<Post />` also receives.
214+
211215
### Changing your fonts
212216

213217
By default, the underlying theme and thus this starter uses "IBM Plex Sans" as its font. It's used throughout the site and set as a `font-family` on the `html` element.

themes/gatsby-theme-minimal-blog/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,14 +275,18 @@ defer: false
275275
---
276276
```
277277

278-
#### Changing the "Hero" text
278+
### Changing the "Hero" text
279279

280280
To edit the hero text ("Hi, I'm Lupin...), create a file at `src/@lekoarts/gatsby-theme-minimal-blog/texts/hero.mdx` to edit the text.
281281

282-
#### Changing the "Projects" part
282+
### Changing the "Projects" part
283283

284284
To edit the projects part below "Latest posts", create a file at `src/@lekoarts/gatsby-theme-minimal-blog/texts/bottom.mdx` to edit the contents.
285285

286+
### Extending the footer of the post
287+
288+
Inside the [`<Post />` component](https://github.com/LekoArts/gatsby-themes/blob/main/themes/gatsby-theme-minimal-blog/src/components/post.tsx) there's also a `<PostFooter />` component that you can shadow to display elements between the end of the post and the global footer. By default it returns `null`. Create a file at `src/@lekoarts/gatsby-theme-minimal-blog/components/post-footer.jsx` to edit this section. The `<PostFooter />` component receives the complete `post` prop that `<Post />` also receives.
289+
286290
## Changelog
287291

288292
You can find the extensive [changelog of changes on GitHub](https://github.com/LekoArts/gatsby-themes/blob/main/themes/gatsby-theme-minimal-blog/CHANGELOG.md). You'll be able to see each patch, minor, and major changes and what pull requests contributed to them.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import * as React from "react"
2+
3+
type PostFooterProps = {
4+
post: {
5+
slug: string
6+
title: string
7+
date: string
8+
tags?: {
9+
name: string
10+
slug: string
11+
}[]
12+
description?: string
13+
canonicalUrl?: string
14+
body: string
15+
excerpt: string
16+
timeToRead?: number
17+
banner?: {
18+
childImageSharp: {
19+
resize: {
20+
src: string
21+
}
22+
}
23+
}
24+
}
25+
}
26+
27+
const PostFooter = ({ post }: PostFooterProps) => null
28+
29+
export default PostFooter

themes/gatsby-theme-minimal-blog/src/components/post.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { MDXRenderer } from "gatsby-plugin-mdx"
55
import Layout from "./layout"
66
import ItemTags from "./item-tags"
77
import Seo from "./seo"
8+
import PostFooter from "./post-footer"
89

910
type PostProps = {
1011
data: {
@@ -40,7 +41,7 @@ const Post = ({ data: { post } }: PostProps) => (
4041
<Seo
4142
title={post.title}
4243
description={post.description ? post.description : post.excerpt}
43-
image={post.banner ? post.banner.childImageSharp.resize.src : undefined}
44+
image={post.banner ? post.banner?.childImageSharp?.resize?.src : undefined}
4445
pathname={post.slug}
4546
canonicalUrl={post.canonicalUrl}
4647
/>
@@ -67,6 +68,7 @@ const Post = ({ data: { post } }: PostProps) => (
6768
>
6869
<MDXRenderer>{post.body}</MDXRenderer>
6970
</section>
71+
<PostFooter post={post} />
7072
</Layout>
7173
)
7274

0 commit comments

Comments
 (0)