Commit ecf2cb2
Changed files (2)
src
pages
[...locale]
posts
src/pages/[...locale]/posts/[slug].astro
@@ -48,5 +48,14 @@ const { Content } = await render(entry);
>
<article>
<Content />
+ <footer>
+ <small>
+ <p>License: {
+ typeof data.license === "string"
+ ? data.license
+ : <a href={data.license.link}>{data.license.name}</a>
+ }</p>
+ </small>
+ </footer>
</article>
</BaseLayout>
src/content.config.ts
@@ -52,6 +52,16 @@ const typCollection = (base: string) => (defineCollection({
}
return z.NEVER;
}),
+ license: z.xor([
+ z.object({
+ name: z.string(),
+ link: z.url(),
+ }),
+ z.string(),
+ ]).default({
+ name: "CC BY-NC-SA 4.0",
+ link: "https://creativecommons.org/licenses/by-nc-sa/4.0/",
+ }),
}),
}));