Skip to content

Commit dc0bb83

Browse files
Add Freebie Sidebar
1 parent 5158127 commit dc0bb83

17 files changed

Lines changed: 333 additions & 119 deletions

File tree

Binary file not shown.
34.7 KB
Binary file not shown.
25 KB
Binary file not shown.
17.6 KB
Binary file not shown.

src/components/BaseTopOfBody.astro

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
---
22
import BlogHeader from "./BlogHeader.astro"
3-
import ConvertkitForm from "./ConvertkitForm.astro"
43
import PageAnalytics from "./PageAnalytics.astro"
54
import UserSettingsLoad from "./UserSettingsLoad.astro"
65
---
76

87
<UserSettingsLoad />
9-
<ConvertkitForm />
108
<PageAnalytics />
119
<BlogHeader />

src/components/BlogHeader.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import UserSettings from "../components/UserSettings.jsx"
33
---
44

5-
<header class="wrapper">
5+
<header>
66
<h1>
77
<a href="/">
88
<span>Web Dev Simplified Blog</span>

src/components/BlogList.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default function BlogList({ allPosts }) {
1010
return post.tags.reduce((tagTotals, tag) => {
1111
return { ...tagTotals, [tag]: (tagTotals[tag] || 0) + 1 }
1212
}, totals)
13-
}, {})
13+
}, {}),
1414
)
1515
.map(([name, count]) => ({ name, count }))
1616
.sort((a, b) => {
@@ -45,7 +45,7 @@ export default function BlogList({ allPosts }) {
4545
}
4646

4747
return (
48-
<div className="wrapper">
48+
<>
4949
<SearchBar query={searchQuery} onChange={handleSearchChange} />
5050
<TagBar tags={tags} onTagSelect={handleTagSelect} />
5151
<main className="content">
@@ -55,6 +55,6 @@ export default function BlogList({ allPosts }) {
5555
))}
5656
</section>
5757
</main>
58-
</div>
58+
</>
5959
)
6060
}

src/components/BlogPost.astro

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@
22
import dateFormatter from "../utils/dateFormatter.js"
33
import TagBar from "./TagBar.jsx"
44
import ShareButtons from "./ShareButtons.jsx"
5+
import FreebieSidebar from "./FreebieSidebar.astro"
6+
import type { Freebie } from "../data/freebies"
57
68
export interface Props {
79
title: string
810
date: string
911
updatedDate: string
1012
url: string
1113
tags: string[]
14+
freebie: Freebie
1215
}
1316
14-
const { title, date, updatedDate, tags, url } = Astro.props
17+
const { title, date, updatedDate, tags, url, freebie } = Astro.props
1518
const siteUrl = Astro.site.href
1619
---
1720

@@ -57,11 +60,20 @@ const siteUrl = Astro.site.href
5760
<!-- TODO: Add Pagination -->
5861
</div>
5962
</article>
63+
<FreebieSidebar freebie={freebie} />
6064
</div>
6165

6266
<style>
67+
.layout {
68+
display: grid;
69+
grid-template-columns: 1fr 320px;
70+
gap: 2rem;
71+
align-items: start;
72+
}
73+
6374
.content {
6475
margin-bottom: 8rem;
76+
min-width: 0;
6577
}
6678

6779
.content :global(main > * + :not(h2):not(h3)) {
@@ -95,6 +107,12 @@ const siteUrl = Astro.site.href
95107
font-weight: 700;
96108
}
97109

110+
@media (max-width: 1100px) {
111+
.layout {
112+
grid-template-columns: 1fr;
113+
}
114+
}
115+
98116
@media (max-width: 50em) {
99117
.title {
100118
font-size: 1.75rem;

src/components/ConvertkitForm.astro

Lines changed: 0 additions & 97 deletions
This file was deleted.

0 commit comments

Comments
 (0)