1
0
mirror of https://github.com/kremalicious/blog.git synced 2025-01-03 18:35:07 +01:00
This commit is contained in:
Matthias Kretschmann 2021-03-01 02:08:38 +01:00
parent 4e2b8f7615
commit a0504d5d2b
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 8 additions and 21 deletions

View File

@ -4,7 +4,6 @@ import { Image } from '../atoms/Image'
import { Post } from '../../@types/Post'
import PostTitle from '../templates/Post/Title'
import styles from './PostTeaser.module.scss'
import PostDate from './PostDate'
export const postTeaserQuery = graphql`
fragment PostTeaser on MarkdownRemark {
@ -48,17 +47,17 @@ export default function PostTeaser({
onClick={toggleSearch && toggleSearch}
>
{image ? (
<Image
fluid={image.childImageSharp.fluid}
alt={title}
original={image.childImageSharp.original}
/>
<Image fluid={image.childImageSharp.fluid} alt={title} />
) : (
<span className={styles.empty} />
)}
<PostTitle slug={slug} title={title} className={styles.title} />
{date && !hideDate && <PostDate date={date} updated={updated} />}
<PostTitle
title={title}
date={hideDate ? null : date}
updated={updated}
className={styles.title}
/>
</Link>
)
}

View File

@ -4,14 +4,12 @@ import Icon from '../../atoms/Icon'
import PostDate from '../../molecules/PostDate'
export default function PostTitle({
slug,
linkurl,
title,
date,
updated,
className
}: {
slug?: string
linkurl?: string
title: string
date?: string
@ -33,10 +31,6 @@ export default function PostTitle({
</h1>
<div className={styles.linkurl}>{linkHostname}</div>
</>
) : slug ? (
<h1 className={`${styles.hentry__title} ${className && className}`}>
{title}
</h1>
) : (
<>
<h1 className={`${styles.hentry__title} ${className && className}`}>

View File

@ -48,13 +48,7 @@ export default function Post({
{type === 'article' && <PostLead post={post} />}
{image && (
<Image
fluid={image.childImageSharp.fluid}
alt={title}
original={image.childImageSharp.original}
/>
)}
{image && <Image fluid={image.childImageSharp.fluid} alt={title} />}
</header>
{type === 'photo' ? (