Skip to content

Commit 484ccd0

Browse files
committed
new popular post
also fix prev/next links
1 parent 53cbc0c commit 484ccd0

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

data/posts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
export const popularPosts = [
33
"lisp-compiler-optimizations",
44
"my-time-at-the-recurse-center",
5-
"building-my-own-chess-engine",
5+
"rendering-counter-strike-demos-in-the-browser",
66
];
77

88
// Starred posts (not in any specific order)

pages/[id].tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,13 @@ export default function Post({
191191
<Newsletter />
192192
<div className="other-posts">
193193
{prevPost ? (
194-
<div className="other-posts-link">
194+
<div className="other-posts-link prev">
195195
<Link href={`/${prevPost.id}`} legacyBehavior>{`← ${prevPost.title}`}</Link>
196196
</div>
197197
) : null}
198198
{nextPost ? (
199-
<div className="other-posts-link">
200-
<Link href={`/${nextPost.id}`} legacyBehavior>{`${nextPost.title} →`}</Link>{" "}
199+
<div className="other-posts-link next">
200+
<Link href={`/${nextPost.id}`} legacyBehavior>{`${nextPost.title} →`}</Link>
201201
</div>
202202
) : null}
203203
</div>
@@ -220,11 +220,20 @@ export default function Post({
220220
}
221221
.other-posts {
222222
padding-top: 48px;
223+
display: flex;
224+
flex-wrap: wrap;
225+
justify-content: space-between;
226+
gap: 16px;
223227
}
224228
.other-posts-link {
225-
display: block;
226229
padding-bottom: 32px;
227230
}
231+
.other-posts-link.prev {
232+
text-align: left;
233+
}
234+
.other-posts-link.next {
235+
text-align: right;
236+
}
228237
aside {
229238
background-color: var(--aside);
230239
padding: 1.5em 1.5em;

0 commit comments

Comments
 (0)