diff --git a/src/components/AllBookTags.astro b/src/components/AllBookTags.astro index 55b6ad8..5a1af2e 100644 --- a/src/components/AllBookTags.astro +++ b/src/components/AllBookTags.astro @@ -1,20 +1,27 @@ --- -import { getCollection } from "astro:content"; -import Link from "./Link.astro"; -import TagsList from "./TagsList.astro"; +import { getCollection } from "astro:content" +import Link from "./Link.astro" +import TagsList from "./TagsList.astro" export interface Props { - selectedTag?: string; - title?: string; + selectedTag?: string + title?: string } -const allBooks = await getCollection("books"); +const allBooks = await getCollection("books") -const tags = [...new Set(allBooks.map((book) => book.data.tags).flat())]; +const tags = [ + ...new Set( + allBooks + .filter((book) => book.data.exclusiveShelf === "read") + .map((book) => book.data.tags) + .flat(), + ), +] -const { selectedTag, title } = Astro.props; +const { selectedTag, title } = Astro.props -const { tag } = Astro.params; +const { tag } = Astro.params --- { diff --git a/src/components/RecentBooks.astro b/src/components/RecentBooks.astro index 2e62baa..475e2f0 100644 --- a/src/components/RecentBooks.astro +++ b/src/components/RecentBooks.astro @@ -1,21 +1,23 @@ --- -import { getCollection } from "astro:content"; -import BookListItem from "./BookListItem.astro"; +import { getCollection } from "astro:content" +import BookListItem from "./BookListItem.astro" -const allBooks = await getCollection("books"); +const allBooks = await getCollection("books") interface Props { - limit?: number; - slug: string; + limit?: number + slug: string } -const { slug, limit = 3 } = Astro.props; +const { slug, limit = 3 } = Astro.props -const books = allBooks.filter((book) => { - if (slug === book.slug) return false; +const books = allBooks + .filter((book) => book.data.exclusiveShelf === "read") + .filter((book) => { + if (slug === book.slug) return false - return true; -}); + return true + }) ---
@@ -27,7 +29,7 @@ const books = allBooks.filter((book) => { .sort( (a, b) => new Date(b.data.dateAdded).valueOf() - - new Date(a.data.dateAdded).valueOf() + new Date(a.data.dateAdded).valueOf(), ) .slice(0, limit) .map((book) => ) diff --git a/src/components/RelatedBooks.astro b/src/components/RelatedBooks.astro index bc5eee3..264f6e9 100644 --- a/src/components/RelatedBooks.astro +++ b/src/components/RelatedBooks.astro @@ -1,28 +1,30 @@ --- -import { getCollection } from "astro:content"; -import BookListItem from "./BookListItem.astro"; -import RecentBooks from "./RecentBooks.astro"; +import { getCollection } from "astro:content" +import BookListItem from "./BookListItem.astro" +import RecentBooks from "./RecentBooks.astro" type Props = { - tags: string[]; - slug: string; -}; + tags: string[] + slug: string +} -const { tags, slug } = Astro.props; +const { tags, slug } = Astro.props -const allBooks = await getCollection("books"); -const books = allBooks.filter((book) => { - if (slug === book.slug) return false; +const allBooks = await getCollection("books") +const books = allBooks + .filter((book) => book.data.exclusiveShelf === "read") + .filter((book) => { + if (slug === book.slug) return false - let keep = false; - tags.forEach((tag: string) => { - if (book.data.tags.includes(tag)) { - keep = true; - } - }); + let keep = false + tags.forEach((tag: string) => { + if (book.data.tags.includes(tag)) { + keep = true + } + }) - return keep; -}); + return keep + }) --- { diff --git a/src/content/books/100m-offers how to make offers so good people feel stupid saying no acquisitioncom 100m series book 1.md b/src/content/books/100m-offers how to make offers so good people feel stupid saying no acquisitioncom 100m series book 1.md index c2002e6..ce3635d 100644 --- a/src/content/books/100m-offers how to make offers so good people feel stupid saying no acquisitioncom 100m series book 1.md +++ b/src/content/books/100m-offers how to make offers so good people feel stupid saying no acquisitioncom 100m series book 1.md @@ -3,25 +3,24 @@ id: 58612786 title: "100M Offers How To Make Offers So Good People Feel Stupid Saying No Acquisitioncom 100M Series Book 1" author: Alex Hormozi authorLF: Hormozi Alex -additionalAuthors: +additionalAuthors: ISBN: "1737475707" ISBN13: "9781737475705" myRating: 0 averageRating: 4.62 -publisher: +publisher: binding: Kindle Edition numberOfPages: 210 yearPublished: "2021" originalPublicationYear: "undefined" -dateRead: "2024-01-25" +dateRead: null dateAdded: "2022-12-13" bookshelves: toread bookshelvesWithPositions: toread 23 exclusiveShelf: toread -myReview: +myReview: spoiler: null readCount: 0 ownedCopies: 0 tags: [] --- - diff --git "a/src/content/books/a-room of one\342\200\231s own.md" "b/src/content/books/a-room of one\342\200\231s own.md" index cb5a7d5..d3c5349 100644 --- "a/src/content/books/a-room of one\342\200\231s own.md" +++ "b/src/content/books/a-room of one\342\200\231s own.md" @@ -3,7 +3,7 @@ id: 18521 title: "A Room of One’s Own" author: Virginia Woolf authorLF: Woolf Virginia -additionalAuthors: +additionalAuthors: ISBN: "" ISBN13: "undefined" myRating: 0 @@ -13,15 +13,14 @@ binding: Paperback numberOfPages: 112 yearPublished: "2000" originalPublicationYear: "1929" -dateRead: "2024-01-25" +dateRead: null dateAdded: "2021-06-28" bookshelves: toread bookshelvesWithPositions: toread 30 exclusiveShelf: toread -myReview: +myReview: spoiler: null readCount: 0 ownedCopies: 0 tags: [] --- - diff --git a/src/content/books/bird-by bird.md b/src/content/books/bird-by bird.md index 0ce8e6b..7ed360d 100644 --- a/src/content/books/bird-by bird.md +++ b/src/content/books/bird-by bird.md @@ -3,7 +3,7 @@ id: 12543 title: "Bird by Bird" author: Anne Lamott authorLF: Lamott Anne -additionalAuthors: +additionalAuthors: ISBN: "" ISBN13: "undefined" myRating: 0 @@ -13,15 +13,14 @@ binding: Paperback numberOfPages: 237 yearPublished: "1995" originalPublicationYear: "1994" -dateRead: "2024-01-25" +dateRead: null dateAdded: "2023-01-06" bookshelves: toread bookshelvesWithPositions: toread 29 exclusiveShelf: toread -myReview: +myReview: spoiler: null readCount: 0 ownedCopies: 0 tags: [] --- - diff --git a/src/content/books/breaking-the habit of being yourself how to lose your mind and create a new one.md b/src/content/books/breaking-the habit of being yourself how to lose your mind and create a new one.md index 53fc3dd..3a36fd8 100644 --- a/src/content/books/breaking-the habit of being yourself how to lose your mind and create a new one.md +++ b/src/content/books/breaking-the habit of being yourself how to lose your mind and create a new one.md @@ -3,7 +3,7 @@ id: 12951631 title: "Breaking the Habit of Being Yourself How to Lose Your Mind and Create a New One" author: Joe Dispenza authorLF: Dispenza Joe -additionalAuthors: +additionalAuthors: ISBN: "1401938086" ISBN13: "9781401938086" myRating: 0 @@ -13,15 +13,14 @@ binding: Hardcover numberOfPages: 329 yearPublished: "2012" originalPublicationYear: "2012" -dateRead: "2024-01-25" +dateRead: null dateAdded: "2021-03-14" bookshelves: toread bookshelvesWithPositions: toread 14 exclusiveShelf: toread -myReview: +myReview: spoiler: null readCount: 0 ownedCopies: 0 tags: [] --- - diff --git a/src/content/books/bridge-over waters.md b/src/content/books/bridge-over waters.md index 03c6f5a..84677df 100644 --- a/src/content/books/bridge-over waters.md +++ b/src/content/books/bridge-over waters.md @@ -3,25 +3,24 @@ id: 54644555 title: "Bridge over waters" author: Tsungai Marandure authorLF: Marandure Tsungai -additionalAuthors: +additionalAuthors: ISBN: "" ISBN13: "undefined" myRating: 0 averageRating: 0 -publisher: +publisher: binding: Kindle Edition numberOfPages: null yearPublished: "2020" originalPublicationYear: "undefined" -dateRead: "2024-01-25" +dateRead: null dateAdded: "2020-07-22" bookshelves: toread bookshelvesWithPositions: toread 6 exclusiveShelf: toread -myReview: +myReview: spoiler: null readCount: 0 ownedCopies: 0 tags: [] --- - diff --git a/src/content/books/conversations-with god an uncommon dialogue book 1.md b/src/content/books/conversations-with god an uncommon dialogue book 1.md index 0c66f5e..bfd7223 100644 --- a/src/content/books/conversations-with god an uncommon dialogue book 1.md +++ b/src/content/books/conversations-with god an uncommon dialogue book 1.md @@ -3,7 +3,7 @@ id: 15015 title: "Conversations with God An Uncommon Dialogue Book 1" author: Neale Donald Walsch authorLF: Walsch Neale Donald -additionalAuthors: +additionalAuthors: ISBN: "0399142789" ISBN13: "9780399142789" myRating: 0 @@ -13,15 +13,14 @@ binding: Hardcover numberOfPages: 223 yearPublished: "1996" originalPublicationYear: "1995" -dateRead: "2024-01-25" +dateRead: null dateAdded: "2021-08-09" bookshelves: toread bookshelvesWithPositions: toread 19 exclusiveShelf: toread -myReview: +myReview: spoiler: null readCount: 0 ownedCopies: 0 tags: [] --- - diff --git a/src/content/books/cultish-the language of fanaticism.md b/src/content/books/cultish-the language of fanaticism.md index b8df04e..9370aa0 100644 --- a/src/content/books/cultish-the language of fanaticism.md +++ b/src/content/books/cultish-the language of fanaticism.md @@ -3,7 +3,7 @@ id: 55338982 title: "Cultish The Language of Fanaticism" author: Amanda Montell authorLF: Montell Amanda -additionalAuthors: +additionalAuthors: ISBN: "0062993151" ISBN13: "9780062993151" myRating: 0 @@ -13,15 +13,14 @@ binding: Hardcover numberOfPages: 309 yearPublished: "2021" originalPublicationYear: "2021" -dateRead: "2024-01-25" +dateRead: null dateAdded: "2023-09-29" bookshelves: currentlyreading bookshelvesWithPositions: currentlyreading 13 exclusiveShelf: currentlyreading -myReview: +myReview: spoiler: null readCount: 1 ownedCopies: 0 tags: [] --- - diff --git a/src/content/books/deep-work rules for focused success in a distracted world.md b/src/content/books/deep-work rules for focused success in a distracted world.md index fa93cc4..4400b71 100644 --- a/src/content/books/deep-work rules for focused success in a distracted world.md +++ b/src/content/books/deep-work rules for focused success in a distracted world.md @@ -1,9 +1,9 @@ --- id: 25744928 -title: "Deep Work Rules for Focused Success in a Distracted World" +title: "Deep Work: Rules for Focused Success in a Distracted World" author: Cal Newport authorLF: Newport Cal -additionalAuthors: +additionalAuthors: ISBN: "1455586692" ISBN13: "9781455586691" myRating: 5 @@ -15,13 +15,12 @@ yearPublished: "2016" originalPublicationYear: "2016" dateRead: "2023-07-06" dateAdded: "2023-07-06" -bookshelves: -bookshelvesWithPositions: +bookshelves: +bookshelvesWithPositions: exclusiveShelf: read -myReview: +myReview: spoiler: null readCount: 1 ownedCopies: 0 tags: [] --- - diff --git a/src/content/books/digital-minimalism on living better with less technology.md b/src/content/books/digital-minimalism on living better with less technology.md index 4f55c65..faeb068 100644 --- a/src/content/books/digital-minimalism on living better with less technology.md +++ b/src/content/books/digital-minimalism on living better with less technology.md @@ -3,7 +3,7 @@ id: 54651516 title: "Digital Minimalism On Living Better with Less Technology" author: Cal Newport authorLF: Newport Cal -additionalAuthors: +additionalAuthors: ISBN: "" ISBN13: "undefined" myRating: 0 @@ -13,15 +13,14 @@ binding: Kindle Edition numberOfPages: 294 yearPublished: "2019" originalPublicationYear: "2019" -dateRead: "2024-01-25" +dateRead: null dateAdded: "2023-04-11" bookshelves: toread bookshelvesWithPositions: toread 34 exclusiveShelf: toread -myReview: +myReview: spoiler: null readCount: 0 ownedCopies: 0 tags: [] --- - diff --git a/src/content/books/financial-freedom through property a stepbystep guide to wealth creation.md b/src/content/books/financial-freedom through property a stepbystep guide to wealth creation.md index 1ee8ad0..4a8154b 100644 --- a/src/content/books/financial-freedom through property a stepbystep guide to wealth creation.md +++ b/src/content/books/financial-freedom through property a stepbystep guide to wealth creation.md @@ -3,7 +3,7 @@ id: 52288982 title: "Financial Freedom through Property A stepbystep guide to wealth creation" author: Laurens Boel authorLF: Boel Laurens -additionalAuthors: +additionalAuthors: ISBN: "1776095057" ISBN13: "9781776095056" myRating: 0 @@ -13,15 +13,14 @@ binding: Paperback numberOfPages: 152 yearPublished: "2020" originalPublicationYear: "2020" -dateRead: "2024-01-25" +dateRead: null dateAdded: "2020-10-30" bookshelves: currentlyreading bookshelvesWithPositions: currentlyreading 3 exclusiveShelf: currentlyreading -myReview: +myReview: spoiler: null readCount: 1 ownedCopies: 0 tags: [] --- - diff --git a/src/content/books/good-omens the nice and accurate prophecies of agnes nutter witch.md b/src/content/books/good-omens the nice and accurate prophecies of agnes nutter witch.md index 91985de..f474ec3 100644 --- a/src/content/books/good-omens the nice and accurate prophecies of agnes nutter witch.md +++ b/src/content/books/good-omens the nice and accurate prophecies of agnes nutter witch.md @@ -13,15 +13,14 @@ binding: Mass Market Paperback numberOfPages: 491 yearPublished: "2006" originalPublicationYear: "1990" -dateRead: "2024-01-25" +dateRead: null dateAdded: "2020-07-18" bookshelves: toread bookshelvesWithPositions: toread 5 exclusiveShelf: toread -myReview: +myReview: spoiler: null readCount: 0 ownedCopies: 0 tags: [] --- - diff --git a/src/content/books/nonviolent-communication a language of life.md b/src/content/books/nonviolent-communication a language of life.md index ce308c4..6f9f571 100644 --- a/src/content/books/nonviolent-communication a language of life.md +++ b/src/content/books/nonviolent-communication a language of life.md @@ -13,15 +13,14 @@ binding: Paperback numberOfPages: 220 yearPublished: "2003" originalPublicationYear: "1999" -dateRead: "2024-01-25" +dateRead: null dateAdded: "2020-12-31" bookshelves: toread bookshelvesWithPositions: toread 7 exclusiveShelf: toread -myReview: +myReview: spoiler: null readCount: 0 ownedCopies: 0 tags: [] --- - diff --git a/src/content/books/numbers-dont lie 71 things you need to know about the world.md b/src/content/books/numbers-dont lie 71 things you need to know about the world.md index 529c527..4b81173 100644 --- a/src/content/books/numbers-dont lie 71 things you need to know about the world.md +++ b/src/content/books/numbers-dont lie 71 things you need to know about the world.md @@ -3,7 +3,7 @@ id: 50705179 title: "Numbers Dont Lie 71 Things You Need to Know About the World" author: Vaclav Smil authorLF: Smil Vaclav -additionalAuthors: +additionalAuthors: ISBN: "0241454417" ISBN13: "9780241454411" myRating: 0 @@ -13,15 +13,14 @@ binding: Hardcover numberOfPages: 384 yearPublished: "2020" originalPublicationYear: "2020" -dateRead: "2024-01-25" +dateRead: null dateAdded: "2021-08-31" bookshelves: currentlyreading bookshelvesWithPositions: currentlyreading 8 exclusiveShelf: currentlyreading -myReview: +myReview: spoiler: null readCount: 1 ownedCopies: 0 tags: [] --- - diff --git a/src/content/books/predictably-irrational the hidden forces that shape our decisions.md b/src/content/books/predictably-irrational the hidden forces that shape our decisions.md index 915ce26..a37106d 100644 --- a/src/content/books/predictably-irrational the hidden forces that shape our decisions.md +++ b/src/content/books/predictably-irrational the hidden forces that shape our decisions.md @@ -3,7 +3,7 @@ id: 1713426 title: "Predictably Irrational The Hidden Forces That Shape Our Decisions" author: Dan Ariely authorLF: Ariely Dan -additionalAuthors: +additionalAuthors: ISBN: "" ISBN13: "undefined" myRating: 0 @@ -13,15 +13,14 @@ binding: Hardcover numberOfPages: 247 yearPublished: "2008" originalPublicationYear: "2008" -dateRead: "2024-01-25" +dateRead: null dateAdded: "2022-03-07" bookshelves: toread bookshelvesWithPositions: toread 22 exclusiveShelf: toread -myReview: +myReview: spoiler: null readCount: 0 ownedCopies: 0 tags: [] --- - diff --git a/src/content/books/reading-like a writer a guide for people who love books and for those who want to write them.md b/src/content/books/reading-like a writer a guide for people who love books and for those who want to write them.md index 4afda60..49d5962 100644 --- a/src/content/books/reading-like a writer a guide for people who love books and for those who want to write them.md +++ b/src/content/books/reading-like a writer a guide for people who love books and for those who want to write them.md @@ -3,7 +3,7 @@ id: 39934 title: "Reading Like a Writer A Guide for People Who Love Books and for Those Who Want to Write Them" author: Francine Prose authorLF: Prose Francine -additionalAuthors: +additionalAuthors: ISBN: "0060777052" ISBN13: "9780060777050" myRating: 0 @@ -13,15 +13,14 @@ binding: Paperback numberOfPages: 302 yearPublished: "2007" originalPublicationYear: "2006" -dateRead: "2024-01-25" +dateRead: null dateAdded: "2022-03-08" bookshelves: currentlyreading bookshelvesWithPositions: currentlyreading 10 exclusiveShelf: currentlyreading -myReview: +myReview: spoiler: null readCount: 1 ownedCopies: 0 tags: [] --- - diff --git a/src/content/books/someday-is today 22 simple actionable ways to propel your creative life.md b/src/content/books/someday-is today 22 simple actionable ways to propel your creative life.md index 1620ed6..ee1b07e 100644 --- a/src/content/books/someday-is today 22 simple actionable ways to propel your creative life.md +++ b/src/content/books/someday-is today 22 simple actionable ways to propel your creative life.md @@ -13,15 +13,14 @@ binding: Paperback numberOfPages: 344 yearPublished: "2022" originalPublicationYear: "undefined" -dateRead: "2024-01-25" +dateRead: null dateAdded: "2022-12-13" bookshelves: toread bookshelvesWithPositions: toread 25 exclusiveShelf: toread -myReview: +myReview: spoiler: null readCount: 0 ownedCopies: 0 tags: [] --- - diff --git a/src/content/books/surprised-by joy the shape of my early life.md b/src/content/books/surprised-by joy the shape of my early life.md index ec3493a..5ba6008 100644 --- a/src/content/books/surprised-by joy the shape of my early life.md +++ b/src/content/books/surprised-by joy the shape of my early life.md @@ -1,27 +1,26 @@ --- id: 121732 -title: "Surprised by Joy The Shape of My Early Life" +title: "Surprised by Joy: The Shape of My Early Life" author: CS Lewis authorLF: Lewis CS -additionalAuthors: +additionalAuthors: ISBN: "0006280838" ISBN13: "9780006280835" myRating: 4 averageRating: 4.06 -publisher: +publisher: binding: Paperback numberOfPages: 185 yearPublished: "undefined" originalPublicationYear: "1955" dateRead: "2023-03-31" dateAdded: "2023-01-29" -bookshelves: -bookshelvesWithPositions: +bookshelves: +bookshelvesWithPositions: exclusiveShelf: read -myReview: +myReview: spoiler: null readCount: 1 ownedCopies: 0 tags: [] --- - diff --git a/src/content/books/the-3 alarms a simple system to transform your health wealth and relationships forever.md b/src/content/books/the-3 alarms a simple system to transform your health wealth and relationships forever.md index 87ba4a8..65a84a9 100644 --- a/src/content/books/the-3 alarms a simple system to transform your health wealth and relationships forever.md +++ b/src/content/books/the-3 alarms a simple system to transform your health wealth and relationships forever.md @@ -3,25 +3,24 @@ id: 55537584 title: "The 3 Alarms A Simple System to Transform Your Health Wealth and Relationships Forever" author: Eric Partaker authorLF: Partaker Eric -additionalAuthors: +additionalAuthors: ISBN: "" ISBN13: "undefined" myRating: 0 averageRating: 4.05 -publisher: +publisher: binding: Kindle Edition numberOfPages: 144 yearPublished: "2020" originalPublicationYear: "2020" -dateRead: "2024-01-25" +dateRead: null dateAdded: "2022-12-13" bookshelves: toread bookshelvesWithPositions: toread 26 exclusiveShelf: toread -myReview: +myReview: spoiler: null readCount: 0 ownedCopies: 0 tags: [] --- - diff --git a/src/content/books/the-adventist home counsels to seventhday adventist families christian home library.md b/src/content/books/the-adventist home counsels to seventhday adventist families christian home library.md index 623de3a..60b0940 100644 --- a/src/content/books/the-adventist home counsels to seventhday adventist families christian home library.md +++ b/src/content/books/the-adventist home counsels to seventhday adventist families christian home library.md @@ -1,27 +1,26 @@ --- id: 2041666 -title: "The Adventist home Counsels to SeventhDay Adventist families Christian home library" +title: "The Adventist Home: Counsels to SeventhDay Adventist Families Christian Home Library" author: Ellen Gould White authorLF: White Ellen Gould -additionalAuthors: +additionalAuthors: ISBN: "0828015937" ISBN13: "9780828015936" myRating: 0 averageRating: 4.6 -publisher: +publisher: binding: Hardcover numberOfPages: 583 yearPublished: "2001" originalPublicationYear: "2005" dateRead: "2023-10-03" dateAdded: "2023-11-03" -bookshelves: -bookshelvesWithPositions: +bookshelves: +bookshelvesWithPositions: exclusiveShelf: read -myReview: +myReview: spoiler: null readCount: 1 ownedCopies: 0 tags: [] --- - diff --git a/src/pages/books/index.astro b/src/pages/books/index.astro index 74432bb..addd39c 100644 --- a/src/pages/books/index.astro +++ b/src/pages/books/index.astro @@ -1,17 +1,20 @@ --- -import { getCollection } from "astro:content"; -import AllBookTags from "../../components/AllBookTags.astro"; -import BookCard from "../../components/BookCard.astro"; -import MainContainer from "../../components/MainContainer.astro"; -import BaseLayout from "../../layouts/BaseLayout.astro"; +import { getCollection } from "astro:content" +import AllBookTags from "../../components/AllBookTags.astro" +import BookCard from "../../components/BookCard.astro" +import MainContainer from "../../components/MainContainer.astro" +import BaseLayout from "../../layouts/BaseLayout.astro" -const allBooks = await getCollection("books"); -const sortedBooks = allBooks.sort( - (a, b) => - new Date(b.data.dateAdded).valueOf() - new Date(a.data.dateAdded).valueOf() -); +const allBooks = await getCollection("books") +const sortedBooks = allBooks + .filter((book) => book.data.exclusiveShelf === "read") + .sort( + (a, b) => + new Date(b.data.dateAdded).valueOf() - + new Date(a.data.dateAdded).valueOf(), + ) // const firstBook = sortedBooks.shift(); -const pageTitle = "Books"; +const pageTitle = "Books" --- diff --git a/src/utils/config.ts b/src/utils/config.ts index 683f2b8..7a8641e 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -12,7 +12,7 @@ export const navItems = [ href: "/thoughts", }, { - title: "Reading", + title: "Books", href: "/books", }, { @@ -23,4 +23,4 @@ export const navItems = [ title: "Micro", href: "/micro", }, -]; +]