1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-06-28 16:48:00 +02:00
blog/src/layouts/Post/Meta.astro
Matthias Kretschmann 3b25ae2282
Location fetching (#843)
* location component

* fetching with @nanostores/query

* layouts reorg

* typescript plugins cleanup

* location component unit test cases

* fetch only when visible
2023-10-04 14:45:54 +01:00

45 lines
1.0 KiB
Plaintext

---
import type { CollectionEntry } from 'astro:content'
import { slugify } from '@lib/slugify'
import config from '@config/blog.config'
import Tag from '@components/Tag.astro'
import styles from './Meta.module.css'
import Date from './Date.astro'
type Props = {
post: CollectionEntry<'articles' | 'links' | 'photos'>
}
const { collection, data } = Astro.props.post
const { date, updated, author, tags } = data
---
<footer class={styles.entryMeta}>
<div class={styles.byline}>
<span class={styles.by}>by</span>
<a class="fn" rel="author" href={config.author.url}>
{author || config.author.name}
</a>
</div>
<Date date={date} updated={updated} />
{
collection === 'photos' && (
<div class={styles.type}>
<a href={`/${slugify(collection)}/`}>{collection}</a>
</div>
)
}
{
tags && (
<div class={styles.tags}>
{tags.map((tag: string) => (
<Tag name={slugify(tag)} url={`/tags/${slugify(tag)}/`} />
))}
</div>
)
}
</footer>