diff --git a/src/components/LatestDispatchBanner.astro b/src/components/LatestDispatchBanner.astro new file mode 100644 index 0000000..ed74b37 --- /dev/null +++ b/src/components/LatestDispatchBanner.astro @@ -0,0 +1,121 @@ +--- +import Avatar from './Avatar.astro'; +import { getLatestPublishedDispatches } from '../lib/db'; +import { + dispatchSlug, dispatchExcerptParas, relativeTime, +} from '../lib/format'; + +const [latest] = getLatestPublishedDispatches(1); +const excerpt = latest ? dispatchExcerptParas(latest).lead : ''; +--- +{latest && ( + + + + + Latest dispatch · {relativeTime(latest.published_at ?? latest.created_at)} + + {latest.author_name.split(' ')[0]} · {latest.author_title ?? 'team'} + + + + + + {latest.title} + {excerpt} + + + + Read dispatch + All dispatches → + + +)} + +