Mirror of the sourcecode for my blog, original repo: https://github.com/NobbZ/blog-nobbz-dev
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

initial draft of an authors detail page

+36 -1
+35
src/pages/authors/[slug].astro
··· 1 + --- 2 + import type { GetStaticPaths } from "astro"; 3 + import type { CollectionEntry } from "astro:content"; 4 + import { getCollection } from "astro:content"; 5 + 6 + import NobbzDev from "../../layouts/NobbzDev.astro"; 7 + 8 + const components = {}; 9 + 10 + export const getStaticPaths = (async () => { 11 + const authorEntries = await getCollection("authors"); 12 + 13 + return authorEntries.map((author) => ({ 14 + params: { 15 + slug: author.slug, 16 + }, 17 + props: { author }, 18 + })); 19 + }) satisfies GetStaticPaths; 20 + 21 + export type Props = { 22 + author: CollectionEntry<"authors">; 23 + }; 24 + 25 + const { author } = Astro.props; 26 + const { Content } = await author.render(); 27 + --- 28 + 29 + <NobbzDev title={author.data.nick_name}> 30 + <article> 31 + <h1 class:list={["p-1"]}>{author.data.nick_name}</h1> 32 + 33 + <Content components={components} /> 34 + </article> 35 + </NobbzDev>
+1 -1
src/scripts/paths.ts
··· 12 12 export const authorPath = (author: CollectionEntry<"authors">): string => { 13 13 const slug = author.slug; 14 14 15 - return `/author/${slug}`; 15 + return `/authors/${slug}`; 16 16 };