Use collection config for slugs and correct locale for links
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
tobias
2024-06-24 09:55:03 +02:00
parent f3596d4258
commit 4dfe80213e
11 changed files with 24 additions and 21 deletions

View File

@ -1,5 +1,6 @@
import { Post } from 'types/payload-types'
import Image from 'next/image'
import { COLLECTION_SLUG_POST } from '@/app/(payload)/collections/config'
interface Props {
post: Post
@ -9,7 +10,10 @@ export default function PostEntry(props: Props) {
if (typeof props.post.thumbnail === 'string') return
return (
<a className="py-4 border-secondary decoration-transparent" href={`/posts/${props.post.slug}`}>
<a
className="py-4 border-secondary decoration-transparent"
href={`/${COLLECTION_SLUG_POST}${props.post.path}`}
>
<article className="flex px-5 py-3 gap-8">
<Image
src={props.post.thumbnail.url || ''}