library is done

This commit is contained in:
Filipe Medeiros 2023-12-03 14:38:04 +01:00
parent 4b2cd6d1e5
commit 384d1d1037
Signed by: filipe
GPG key ID: 9533BD5467CC1E78
10 changed files with 139 additions and 85 deletions

View file

@ -1,11 +1,15 @@
// 1. Import utilities from `astro:content` import { defineCollection, z } from 'astro:content';
import { defineCollection } from 'astro:content';
// 2. Define your collection(s) const libraryCollection = defineCollection({
const blogCollection = defineCollection({ type: 'data',
/* ... */ schema: z.object({
title: z.string(),
checkedOut: z.boolean(),
link: z.string().url(),
description: z.string().optional(),
}),
}); });
// 3. Export a single `collections` object to register your collection(s)
// This key should match your collection directory name in "src/content"
export const collections = { export const collections = {
blog: blogCollection, library: libraryCollection,
}; };

View file

@ -0,0 +1,7 @@
title: 'Doughnut Economics: Seven Ways to Think Like a 21st-Century Economist'
checkedOut: true
link: 'https://www.kobo.com/ie/en/ebook/doughnut-economics'
description: >
I loved it and highly recommend it! It's a book about economics, but a very unorthodox one.
It has a degrowth side to it, but it's a great read for any person that wants a breath of
fresh air in the field of economics.

View file

@ -0,0 +1,11 @@
title: 'Limits to Growth: The 30-Year Update'
checkedOut: true
link: 'https://www.kobo.com/ie/en/ebook/limits-to-growth-1'
description: >
This book completely solidified my urge to study political economics and
system dynamics. It takes on a realistic but duly urgent approach about the problems
that haunted the world at the beginning of the 21st century and that, unfortunately,
still do. The authors present clear solutions but, above all, a new way of thinking
about what it means to live in a society and the potential the human being has to build
a new global community with well-being and Nature preservation at the core, based
on empirical data when possible.

View file

@ -0,0 +1,10 @@
title: 'Mission Economy: A Moonshot Guide to Changing Capitalism'
checkedOut: true
link: 'https://www.kobo.com/us/en/ebook/mission-economy-1'
description: >
I've read about half of the book (maybe a bit more, if you don't count references, etc).
I can't say I was impressed. The book tries to use the case of Nasa's Apolo XIII project
to explore how the Srare can and should be a leader in society, guiding investment, picking
strategic areas, taking tisks for the common good, etc. However, I felt lost in the middle
of the analogy, not being able to make a clear connection to its more general implications.
I still haven't finished the book. One day I'll try again.

View file

@ -0,0 +1,7 @@
title: 'Economia Donut: Sete Formas de Pensar Como um Economista no Século XXI'
checkedOut: true
link: 'https://www.wook.pt/ebook/economia-donut-kate-raworth/21400895'
description: >
'Adorei e recomendo vivamente! É um livro sobre economia, mas muito pouco ortodoxo.
Tem uma faceta decrescentista, mas é uma ótima leitura para qualquer pessoa que queira
uma lufada de ar fresco no tópico de economia.'

View file

@ -0,0 +1,12 @@
title: 'Limites do Crescimento: A Atualização de 30 Anos'
checkedOut: true
link: 'https://www.scribd.com/document/422266661/Limites-Do-Crescimento-A-Atualizacao-de-30-Anos'
description: >
Este livro solidificou por completo a minha vontade de estudar economia política
e dinâmica de sistemas. É uma abordagem realista mas devidamente urgente sobre os
problemas que assolavam o mundo no início do século XXI e que, muito infelizmente,
ainda continuam presentes. As autoras apresentam soluções claras, mas, acima de tudo,
uma nova maneira de pensar sobre o que é viver em sociedade e o potencial que o ser humano
tem para construir uma comunidade global com o bem-estar e a preservação da Natureza em
primeiro lugar, baseadas em dados empíricos sempre que possível. PS: Não consegui encontrar
um link melhor para a versão portuguesa do livro, desculpem!

View file

@ -0,0 +1,11 @@
title: 'Economia de Missão: Um guia ousado e inovador para mudar o capitalismo'
checkedOut: true
link: 'https://www.wook.pt/ebook/economia-de-missao-mariana-mazzucato/25383261'
description: >
Já li cerca de metade do livro (talvez mais, se excluir referências, etc).
Não posso dizer que fiquei impressionado. O livro tenta usar o caso do projeto Apolo XIII
da NASA para explorar como o Estado pode e deve ser um líder na sociedade, guiando
investimentos, escolhendo áreas estratégicas, tomando riscos pelo bem comum, etc.
No entanto, sinto que fiquei perdido no meio da analogia, sem conseguir fazer uma
ligação clara às suas implicações mais gerais. Ainda não acabei o livro.
Um dia terei de voltar.

View file

@ -1 +1,2 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" /> /// <reference types="astro/client" />

View file

@ -1,65 +1,62 @@
--- ---
import client from "../../lib/cms/client"; import ButtonLink from '../../components/ButtonLink.astro';
import { forLibraryPage } from "../../lib/cms/queries/libraryItems"; import CardLink from '../../components/CardLink.astro';
import ButtonLink from "../../components/ButtonLink.astro"; import PageTitle from '../../components/PageTitle.astro';
import CardLink from "../../components/CardLink.astro"; import Layout from '../../layouts/Layout.astro';
import PageTitle from "../../components/PageTitle.astro"; import { getCollection } from 'astro:content';
import Layout from "../../layouts/Layout.astro";
const libraryItems: { const libraryItems = await getCollection('library', ({ id }) =>
description: string; id.startsWith('pt'),
checkedOut: boolean; );
link: string;
title: string;
}[] = await client.fetch(forLibraryPage, {
lang: "pt_PT",
});
--- ---
<Layout <Layout
title="Biblioteca - Filipe Medeiros" title="Biblioteca - Filipe Medeiros"
ptUrl="/biblioteca" ptUrl="/biblioteca"
enUrl="/library" enUrl="/library"
lang="pt" lang="pt"
> >
<header class="mb-10"> <header class="mb-10">
<PageTitle class="mb-3">Biblioteca</PageTitle> <PageTitle class="mb-3">Biblioteca</PageTitle>
<h2> <h2>
Livros, artigos, <span class="italic">etc.</span> que já li e que recomendo Livros, artigos, <span class="italic">etc.</span> que já li e que
ou que quero ler num futuro próximo. Se um item tiver uma marca "<span recomendo ou que quero ler num futuro próximo. Se um item tiver uma marca
class="text-primary-700">✓</span "<span class="text-primary-700">✓</span>", siginifca que eu já o li, vi, <span
>", siginifca que eu já o li, vi, <span class="italic">etc.</span> class="italic">etc.</span
</h2> >
</header> </h2>
<ol> </header>
{ <ol class="grid lg:grid-cols-3 md:grid-cols-2 items-start gap-4">
libraryItems.map(({ title, description, link, checkedOut }) => ( {
<CardLink link={link}> libraryItems.map(({ data: { title, description, link, checkedOut } }) => (
<span class="text-lg sm:text-xl font-medium break-words text-primary-700 block mb-3"> <CardLink link={link}>
{title} <article>
</span> <div class="flex gap-2">
<p class="mb-5">{description}</p> <h2 class="text-lg sm:text-xl font-medium break-words text-primary-700 block mb-3">
{checkedOut && ( {title}
<span class="text-primary-700 text-3xl">✓</span> </h2>
)} {checkedOut && <span class="text-primary-700 text-3xl">✓</span>}
</CardLink> </div>
)) <p class="mb-5">{description}</p>
} </article>
</ol> </CardLink>
<Fragment slot="footer"> ))
<nav class="flex gap-4"> }
<ButtonLink </ol>
href="/blogue" <Fragment slot="footer">
class="text-xl sm:text-3xl flex-1 py-1 sm:py-2 flex justify-center px-2" <nav class="flex gap-4">
> <ButtonLink
Blogue href="/blogue"
</ButtonLink> class="text-xl sm:text-3xl flex-1 py-1 sm:py-2 flex justify-center px-2"
<ButtonLink >
href="/" Blogue
class="text-xl sm:text-3xl flex-1 py-1 sm:py-2 flex justify-center px-2" </ButtonLink>
> <ButtonLink
Início href="/"
</ButtonLink> class="text-xl sm:text-3xl flex-1 py-1 sm:py-2 flex justify-center px-2"
</nav> >
</Fragment> Início
</ButtonLink>
</nav>
</Fragment>
</Layout> </Layout>

View file

@ -1,19 +1,13 @@
--- ---
import client from "../../lib/cms/client"; import ButtonLink from '../../components/ButtonLink.astro';
import { forLibraryPage } from "../../lib/cms/queries/libraryItems"; import CardLink from '../../components/CardLink.astro';
import ButtonLink from "../../components/ButtonLink.astro"; import PageTitle from '../../components/PageTitle.astro';
import CardLink from "../../components/CardLink.astro"; import Layout from '../../layouts/Layout.astro';
import PageTitle from "../../components/PageTitle.astro"; import { getCollection } from 'astro:content';
import Layout from "../../layouts/Layout.astro";
const libraryItems: { const libraryItems = await getCollection('library', ({ id }) =>
description: string; id.startsWith('en'),
checkedOut: boolean; );
link: string;
title: string;
}[] = await client.fetch(forLibraryPage, {
lang: "en_EN",
});
--- ---
<Layout <Layout
@ -25,16 +19,16 @@ const libraryItems: {
<header class="mb-10"> <header class="mb-10">
<PageTitle class="mb-3">Library</PageTitle> <PageTitle class="mb-3">Library</PageTitle>
<h2> <h2>
Books, articles, <span class="italic">etc.</span> that I've read and recommend Books, articles, <span class="italic">etc.</span> that I've read and
or that I want to check out in the near future. If an item has a checkmark recommend or that I want to check out in the near future. If an item has a
"<span class="text-primary-700">✓</span>", that means I've read it, checkmark "<span class="text-primary-700">✓</span>", that means I've read
listened to it, it, listened to it,
<span class="italic">etc.</span> <span class="italic">etc.</span>
</h2> </h2>
</header> </header>
<ol> <ol>
{ {
libraryItems.map(({ title, description, link, checkedOut }) => ( libraryItems.map(({ data: { title, description, link, checkedOut } }) => (
<CardLink link={link}> <CardLink link={link}>
<span class="text-lg sm:text-xl font-medium break-words text-primary-700 block mb-3"> <span class="text-lg sm:text-xl font-medium break-words text-primary-700 block mb-3">
{title} {title}