feat(essay): new "Beyond the Bookshelf" series

This commit is contained in:
Stefan Imhoff
2024-12-04 16:39:27 +01:00
parent 9f81a863fe
commit a028bbf38d
21 changed files with 743 additions and 23 deletions

View File

@@ -21,7 +21,7 @@ import TextLink from '../components/TextLink.astro';
import { mapping } from '../mdx-components';
export async function getStaticPaths() {
const journalEntries = await getCollection('journal');
const journalEntries = await getCollection('journal', ({ data }: Journal) => !data.draft);
const numberOfPages = journalEntries.length;
const formattedJournalEntries: Journal[] = formatPosts(journalEntries, { sortOrder: 'asc' });
@@ -45,7 +45,7 @@ const {
} = await entry.render();
const seriesEntries: Journal[] = await getCollection('journal', ({ data }: Journal) => {
return data.series === entry.data.series;
return data.series === entry.data.series && !data.draft;
});
seriesEntries.sort(sortByDate).reverse();
@@ -133,7 +133,7 @@ const schema = JSON.stringify({
class="journal-post col-start-2 col-end-18 md:col-start-5 md:col-end-15 xl:col-start-6 xl:col-end-14 3xl:col-start-7 3xl:col-end-13"
>
{
entry.data.series && (
entry.data.series && seriesEntries.length > 1 && (
<Banner>
<OrderedList class="!mbe-0 !pis-7">
{seriesEntries.map((item) => (

View File

@@ -1,5 +1,7 @@
---
// Cspell:words astro imhoff fullsize webp pagefind
import type { CollectionEntry } from 'astro:content';
type JournalType = CollectionEntry<'journal'>;
import { getCollection } from 'astro:content';
import { formatPosts, isProduction, sortMarkdownByDate } from '../utils';
@@ -28,7 +30,7 @@ import { Content as Journal } from '../text/homepage/journal.mdx';
import { mapping } from '../mdx-components';
const allPosts = await getCollection('journal');
const allPosts = await getCollection('journal', ({ data }: JournalType) => !data.draft);
const formattedLatest = formatPosts(allPosts, { limit: 6 });
const title = 'Stefan Imhoff';

View File

@@ -1,5 +1,7 @@
---
// Cspell:words astro pagefind
import type { CollectionEntry } from 'astro:content';
type Journal = CollectionEntry<'journal'>;
import { getCollection } from 'astro:content';
import { formatPosts } from '../utils';
@@ -15,7 +17,7 @@ import { Content as Intro } from '../text/journal/intro.mdx';
import { mapping } from '../mdx-components';
const allPosts = await getCollection('journal');
const allPosts = await getCollection('journal', ({ data }: Journal) => !data.draft);
const formattedAllPosts = formatPosts(allPosts, {});
const uniqueTags = [...new Set(formattedAllPosts.map((entry) => entry.data.tags).flat())];

View File

@@ -19,7 +19,7 @@ This is my [Now](https://nownownow.com/) page, an idea by [Derek Silvers](https:
- Building the Design System of XING 👨‍💻
- Working from home 🏡
- Learning Japanese 🇯🇵 on [Duolingo](https://www.duolingo.com/profile/kogakure) 🦉and with [Anki](https://apps.ankiweb.net/) ⭐
- Learning Japanese 🇯🇵 and 🇪🇸 Spanish on [Duolingo](https://www.duolingo.com/profile/kogakure) 🦉and with [Anki](https://apps.ankiweb.net/) ⭐
- Learning ink and wash (sketching with ink and watercolor) and posting my art on [Instagram](https://www.instagram.com/kogakure.art/) 🖌️
- Learning to tie [knots](https://www.animatedknots.com/) 🪢
- Creating and reviewing highlights with [Readwise](https://readwise.io/i/stefan805) 📝 every day

View File

@@ -10,7 +10,7 @@ import GridLayout from '../layouts/GridLayout.astro';
import PageTitle from '../components/PageTitle.astro';
import TagComponent from '../components/Tag.astro';
const allJournal: Journal[] = await getCollection('journal');
const allJournal: Journal[] = await getCollection('journal', ({ data }: Journal) => !data.draft);
const uniqueTags = [...new Set(allJournal.map((entry) => entry.data.tags).flat())];
uniqueTags.sort((a, b) => a.localeCompare(b));

View File

@@ -1,5 +1,7 @@
---
// Cspell:words astro
import type { CollectionEntry } from 'astro:content';
type Journal = CollectionEntry<'journal'>;
import { getCollection } from 'astro:content';
import { formatPosts, titleCase } from '../../utils';
@@ -10,14 +12,13 @@ import PageTitle from '../../components/PageTitle.astro';
import JournalList from '../../components/JournalList.astro';
import TagComponent from '../../components/Tag.astro';
import type { CollectionEntry } from 'astro:content';
interface Props {
entries: CollectionEntry<'journal'>[];
uniqueTags: string[];
}
export async function getStaticPaths() {
const journalEntries = await getCollection('journal');
const journalEntries = await getCollection('journal', ({ data }: Journal) => !data.draft);
const formattedJournalEntries = formatPosts(journalEntries, {});
const uniqueTags = [...new Set(formattedJournalEntries.map((entry) => entry.data.tags).flat())];