1
0
mirror of https://github.com/kremalicious/blog.git synced 2025-02-14 21:10:25 +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 { Post } from '../../@types/Post'
import PostTitle from '../templates/Post/Title' import PostTitle from '../templates/Post/Title'
import styles from './PostTeaser.module.scss' import styles from './PostTeaser.module.scss'
import PostDate from './PostDate'
export const postTeaserQuery = graphql` export const postTeaserQuery = graphql`
fragment PostTeaser on MarkdownRemark { fragment PostTeaser on MarkdownRemark {
@ -48,17 +47,17 @@ export default function PostTeaser({
onClick={toggleSearch && toggleSearch} onClick={toggleSearch && toggleSearch}
> >
{image ? ( {image ? (
<Image <Image fluid={image.childImageSharp.fluid} alt={title} />
fluid={image.childImageSharp.fluid}
alt={title}
original={image.childImageSharp.original}
/>
) : ( ) : (
<span className={styles.empty} /> <span className={styles.empty} />
)} )}
<PostTitle slug={slug} title={title} className={styles.title} /> <PostTitle
{date && !hideDate && <PostDate date={date} updated={updated} />} title={title}
date={hideDate ? null : date}
updated={updated}
className={styles.title}
/>
</Link> </Link>
) )
} }

View File

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

View File

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