Mirror of the sourcecode for my blog, original repo: https://github.com/NobbZ/blog-nobbz-dev
at main 559 B view raw
1// SPDX-FileCopyrightText: 2025 Norbert Melzer 2// SPDX-FileContributor: Norbert Melzer 3// 4// SPDX-License-Identifier: MIT 5 6import type { CollectionEntry } from "astro:content"; 7 8import { DateTime } from "luxon"; 9 10export const postPath = (post: CollectionEntry<"blog">): string => { 11 const date = DateTime.fromJSDate(post.data.date).toFormat("yyyy-MM-dd"); 12 const slug = post.slug; 13 14 return `/blog/${date}-${slug}`; 15}; 16 17export const authorPath = (author: CollectionEntry<"authors">): string => { 18 const slug = author.slug; 19 20 return `/authors/${slug}`; 21};