-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f7f5d41
commit 660fc35
Showing
15 changed files
with
111 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...ents of Computing Systems: Building a Modern Computer from First Principles.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
rating: 5 | ||
read: 2023-10-09T08:00:00 | ||
--- | ||
|
||
hello world | ||
|
||
hooray |
8 changes: 8 additions & 0 deletions
8
src/content/book-review/The Rust Programming Language, 2nd Edition.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
rating: 4.5 | ||
read: 2024-05-21T08:00:00 | ||
--- | ||
|
||
hello world | ||
|
||
yoo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,60 @@ | ||
--- | ||
import Layout from "../layouts/Layout.astro"; | ||
import ReadingSection from "../components/ReadingSection.astro"; | ||
import BookReview from "../components/BookReview.astro"; | ||
import { getCollection } from "astro:content"; | ||
import type { CollectionEntry } from "astro:content"; | ||
const allSections = await getCollection("reading"); | ||
allSections.reverse(); | ||
const allBookReviews = await getCollection("book-review"); | ||
allBookReviews.reverse(); | ||
const yearsToReviews = new Map<number, CollectionEntry<"book-review">[]>(); | ||
for (let section of allBookReviews) { | ||
const year = section.data.read.getFullYear(); | ||
if (!yearsToReviews.has(year)) { | ||
yearsToReviews.set(year, []); | ||
} | ||
const curr = yearsToReviews.get(year)!; | ||
let i = 0; | ||
while (i < curr.length && curr[i].data.read > section.data.read) { | ||
i++; | ||
} | ||
curr.splice(i, 0, section); | ||
} | ||
--- | ||
|
||
<Layout title="Arhan's Reading Notes" sshUser="reading"> | ||
<div id="max-width-wrapper" class="system-ui"> | ||
<h1 class="input-mono">My reading notes</h1> | ||
<h1 class="input-mono">My reading notes & book reviews</h1> | ||
<hr /> | ||
{allSections.map((section) => <ReadingSection {section} />)} | ||
{ | ||
Array.from(yearsToReviews, ([year, bookReviews]) => ( | ||
<> | ||
<details> | ||
<summary>{year}</summary> | ||
<div class="indent"> | ||
{bookReviews.map((section) => ( | ||
<BookReview {section} /> | ||
))} | ||
</div> | ||
</details> | ||
</> | ||
)) | ||
} | ||
</div> | ||
</Layout> | ||
|
||
<style lang="scss"> | ||
details { | ||
margin: 1em 0; | ||
|
||
summary { | ||
font-size: 24px; | ||
font-weight: bolder; | ||
cursor: pointer; | ||
} | ||
|
||
.indent { | ||
margin-left: 40px; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters