diff --git a/src/components/MainNavigation.astro b/src/components/MainNavigation.astro index 030e497..3e44726 100644 --- a/src/components/MainNavigation.astro +++ b/src/components/MainNavigation.astro @@ -8,7 +8,11 @@ import navigation from '../data/navigation.json'; const currentPath = new URL(Astro.request.url).pathname; --- - diff --git a/src/pages/haiku.astro b/src/pages/haiku.astro index 77e2305..720ebdf 100644 --- a/src/pages/haiku.astro +++ b/src/pages/haiku.astro @@ -23,7 +23,7 @@ allHaiku.sort(sortByDate).reverse(); -
+
+ diff --git a/src/pages/sketchnotes/[...slug].astro b/src/pages/sketchnotes/[...slug].astro new file mode 100644 index 0000000..cf068d3 --- /dev/null +++ b/src/pages/sketchnotes/[...slug].astro @@ -0,0 +1,72 @@ +--- +import { getCollection } from 'astro:content'; + +import { sortBySortKey } from '../../utils/sort-by-sortkey'; + +import BaseLayout from '../../layouts/BaseLayout.astro'; +import PageHeader from '../../components/PageHeader.astro'; +import Pagination from '../../components/Pagination.astro'; +import { Headline } from '../../components'; + +import { mapping } from '../../mdx-components'; + +export async function getStaticPaths() { + const sketchnotesEntries = await getCollection('sketchnotes'); + const numberOfPages = sketchnotesEntries.length; + sketchnotesEntries.sort(sortBySortKey).reverse(); + + return sketchnotesEntries.map((entry, index) => ({ + params: { slug: entry.slug }, + props: { + entry, + next: + index + 1 === numberOfPages + ? { slug: null, data: null } + : sketchnotesEntries[index + 1], + prev: index === 0 ? {} : sketchnotesEntries[index - 1], + }, + })); +} + +const { entry, prev, next } = Astro.props; +const { Content } = await entry.render(); +--- + + +
+ +
+
+
+ {entry.data.title} + +
+
+
+ { + entry.data.images.map(({ src }: { src: string }) => ( +
+ {entry.data.title} +
+ )) + } +
+
+ +
+