better article reading and stuff

This commit is contained in:
Filipe Medeiros 2024-10-05 00:11:41 +02:00
parent e74e9d7a83
commit 2c234276b0
Signed by: filipe
GPG key ID: 9533BD5467CC1E78
23 changed files with 95 additions and 33 deletions

BIN
bun.lockb

Binary file not shown.

View file

@ -24,6 +24,7 @@ export default config({
validation: { isRequired: true },
},
}),
originalTitle: fields.text({ label: 'Original title' }),
subtitle: fields.text({ label: 'Subtitle' }),
checkedOut: fields.checkbox({ label: 'Checked out?' }),
link: fields.url({ label: 'Link', validation: { isRequired: true } }),

View file

@ -23,10 +23,10 @@
"mdast-flatten-listitem-paragraphs": "^1.0.0",
"react": "^18.3.1",
"sharp": "^0.33.5",
"tailwindcss": "^3.4.12"
"tailwindcss": "^3.4.13"
},
"devDependencies": {
"@types/node": "^20.16.5",
"@types/node": "^20.16.10",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.47"
}

View file

@ -5,6 +5,7 @@ const libraryCollection = defineCollection({
schema: z.object({
title: z.string(),
subtitle: z.ostring(),
originalTitle: z.ostring(),
checkedOut: z.boolean(),
link: z.string().url(),
description: z.ostring(),

View file

@ -1,4 +1,5 @@
title: One hundred years of solitude
originalTitle: Cien Años de Soledad
checkedOut: false
link: >-
https://openlibrary.org/works/OL274505W/Cien_a%C3%B1os_de_soledad?edition=key%3A/books/OL30448691M

View file

@ -1,4 +1,5 @@
title: Blindness
originalTitle: Ensaio sobre a cegueira
checkedOut: true
link: >-
https://openlibrary.org/works/OL27420W/Ensaio_Sobre_a_Cegueira?edition=key%3A/books/OL352517M

View file

@ -1,6 +1,6 @@
title: Factfulness
subtitle: >-
Ten Reasons We're Wrong About the World and Why Things Are Better Than You
Ten Reasons We're Wrong About the World and Why Things Are Better Than You
Think
checkedOut: true
link: https://archive.org/details/factfulness-hans-rosling/page/n153/mode/2up

View file

@ -1,4 +1,5 @@
title: Manifesto of the Communist Party
originalTitle: Manifest der Kommunistischen Partei
checkedOut: true
link: https://www.marxists.org/admin/books/manifesto/Manifesto.pdf
description: "Very interesting. Honestly, I only felt compelled to read this because of its statute as a classic. I think no marxist should call themselves that without reading (at least) this Manifesto, especially given how short and quick to read it is. The text's language has some peculiarities, of course due to when it was written, but it is generally easy to understand. It seems to me that some topics are very specific to what the authors were living through, during those days, in Europe, and, for that reason, it's hard for someone with a lack of historical context —\_like me —\_to get and feel everything perfectly. Even so, it positively surprised me! Mainly because of its mentions to women (in its call for their emancipation) and to Nature (in the recognition of its exploitation by the capitalist systems). I recommend this book to any leftist."

View file

@ -1,4 +1,5 @@
title: New Radical Enlightenment
originalTitle: Nova Il·Lustració Radical
checkedOut: true
link: https://catalog.princeton.edu/catalog/99131003959006421
description: >-

View file

@ -1,4 +1,5 @@
title: Cem anos de solidão
originalTitle: Cien Años de Soledad
checkedOut: false
link: >-
https://openlibrary.org/works/OL26414960W/Cem_Anos_De_Solid%C3%A3o?edition=key%3A/books/OL35663961M

View file

@ -1,5 +1,6 @@
title: Economia Donut
subtitle: Sete Formas de Pensar Como um Economista no Século XXI
originalTitle: 'Doughtnut Econonomics: Seven Ways to Think Like a 21st-Centurty Economist'
checkedOut: true
link: https://www.wook.pt/ebook/economia-donut-kate-raworth/21400895
description: >

View file

@ -1,4 +1,5 @@
title: Manifesto do Partido Comunista
originalTitle: Manifest der Kommunistischen Partei
checkedOut: true
link: >-
https://www.marxists.org/portugues/marx/1848/ManifestoDoPartidoComunista/manifesto.pdf

View file

@ -1,5 +1,6 @@
title: Economia de Missão
subtitle: Um guia ousado e inovador para mudar o capitalismo
originalTitle: 'Mission Economy: A Moonshot Guide to Changing Capitalism'
checkedOut: true
link: https://www.wook.pt/ebook/economia-de-missao-mariana-mazzucato/25383261
description: >

View file

@ -1,4 +1,5 @@
title: Novo Iluminismo Radical
originalTitle: Nova Il·Lustració Radical
checkedOut: true
link: >-
https://catalogo.bnportugal.gov.pt/ipac20/ipac.jsp?session=EA222557L6592.58616&menu=search&aspect=subtab11&npp=20&ipp=20&spp=20&profile=bn&ri=&term=Novo+iluminismo+radical&index=.GW&x=0&y=0&aspect=subtab11

View file

@ -1,4 +1,5 @@
title: Sputnik, Meu Amor
originalTitle: スプートニクの恋人
checkedOut: true
link: https://search.worldcat.org/title/864808899?oclcNum=864808899
description: >

View file

@ -1,5 +1,6 @@
title: Limites do Crescimento
subtitle: A Atualização de 30 Anos
originalTitle: 'Limits to Growth: The 30-Year Update'
checkedOut: true
link: >-
https://www.scribd.com/document/422266661/Limites-Do-Crescimento-A-Atualizacao-de-30-Anos

View file

@ -1,4 +1,5 @@
title: The Strange Library
originalTitle: ふしぎな図書館
checkedOut: true
link: >-
https://www.fnac.pt/The-Strange-Library-Haruki-Murakami/a807074?NUMERICAL=Y#bl=FA_ebook

View file

@ -5,9 +5,10 @@ export interface Props {
ptUrl: string;
enUrl: string;
lang: string;
hideFooterLinks?: boolean;
}
const { ptUrl, enUrl, lang } = Astro.props;
const { ptUrl, enUrl, lang, hideFooterLinks } = Astro.props;
const { footer } = Astro.slots;
const hasFooter = !!footer;
---
@ -30,28 +31,40 @@ const hasFooter = !!footer;
<slot />
</main>
<footer class="fixed bottom-0 p-4 pb-0 flex flex-col w-full gap-2">
<footer
class:list={[
'fixed bottom-0 p-4 pb-0 flex flex-col w-full gap-2',
hideFooterLinks && 'mb-3',
]}
>
<slot name="footer" />
<div
class="flex justify-between max-xs:flex-col-reverse max-xs:items-center bg-orange-50 pb-2"
class:list={[
'flex justify-end gap-2 xs:gap-3 max-xs:flex-col-reverse max-xs:items-center pb-2',
hideFooterLinks && 'sr-only',
]}
>
<ul class="flex gap-3">
<ul
class="flex gap-3 bg-orange-50 px-1 border-2 border-primary-900 text-lg shadow-[3px_3px] shadow-primary-900"
>
{
lang !== 'pt' && (
<li>
<InlineLink href={ptUrl}>PT</InlineLink>
<InlineLink href={ptUrl}>Português</InlineLink>
</li>
)
}
{
lang !== 'en' && (
<li>
<InlineLink href={enUrl}>EN</InlineLink>
<InlineLink href={enUrl}>English</InlineLink>
</li>
)
}
</ul>
<ul class="flex gap-3">
<ul
class="flex gap-3 bg-orange-50 px-2 border-2 border-primary-900 shadow-[3px_3px] shadow-primary-900"
>
<li>
<InlineLink
title={lang === 'pt'

View file

@ -29,21 +29,36 @@ const libraryItems = (
{
libraryItems.map(
({
data: { title, subtitle, description, link, checkedOut, mainAuthors },
data: {
title,
subtitle,
originalTitle,
description,
link,
checkedOut,
mainAuthors,
},
}) => (
<CardLink link={link} isExternal>
<article>
<div class="flex gap-2 justify-between">
<h2 class="text-lg sm:text-xl font-medium break-words text-primary-700 block">
{title}
</h2>
<header class="flex gap-2 justify-between">
<div>
{originalTitle && (
<h4 class="text-xs font-light text-stone-700">
{originalTitle}
</h4>
)}
<h2 class="text-lg sm:text-xl font-medium break-words text-primary-700 block">
{title}
</h2>
{subtitle && (
<h3 class="text-sm sm:text-base break-words text-primary-800 block">
{subtitle}
</h3>
)}
</div>
{checkedOut && <span class="text-primary-700 text-3xl">✓</span>}
</div>
{subtitle && (
<h3 class="text-sm sm:text-base break-words text-primary-800 block">
{subtitle}
</h3>
)}
</header>
{mainAuthors.length > 0 && (
<h3 class="mb-3 sm:text-lg text-end">
{mainAuthors.map((author, i) =>

View file

@ -58,7 +58,12 @@ const formattedPublishDate = publishDate.toLocaleDateString('pt', {
});
---
<Layout ptUrl={`/blogue/${slug}`} enUrl={`/blog/${slug}`} lang="pt">
<Layout
ptUrl={`/blogue/${slug}`}
enUrl={`/blog/${slug}`}
lang="pt"
hideFooterLinks
>
<Metadata
slot="metadata"
title={linkPreviewTitle ?? `${title} - Filipe Medeiros`}

View file

@ -30,21 +30,36 @@ const libraryItems = (
{
libraryItems.map(
({
data: { title, subtitle, description, link, checkedOut, mainAuthors },
data: {
title,
subtitle,
originalTitle,
description,
link,
checkedOut,
mainAuthors,
},
}) => (
<CardLink link={link} isExternal>
<article>
<div class="flex gap-2 justify-between">
<h2 class="text-lg sm:text-xl font-medium break-words text-primary-700 block">
{title}
</h2>
<header class="flex gap-2 justify-between">
<div>
{originalTitle && (
<h4 class="text-xs font-light text-stone-700">
{originalTitle}
</h4>
)}
<h2 class="text-lg sm:text-xl font-medium break-words text-primary-700 block">
{title}
</h2>
{subtitle && (
<h3 class="text-sm sm:text-base break-words text-primary-800 block">
{subtitle}
</h3>
)}
</div>
{checkedOut && <span class="text-primary-700 text-3xl">✓</span>}
</div>
{subtitle && (
<h3 class="text-sm sm:text-base break-words text-primary-800 block">
{subtitle}
</h3>
)}
</header>
{mainAuthors.length > 0 && (
<h3 class="mb-3 sm:text-lg text-end">
{mainAuthors.map((author, i) =>