1import Link from "next/link";
2import BackgroundImage from "./BackgroundImage";
3import { formatDate } from "../lib/lib";
5export default function PostPreview(props) {
6 const section = props?.section ? props.section : "blog";
8 <div className={`cursor-pointer ${props.className}`}>
9 {props.title ? <h3 className="mb-2">{props.title}</h3> : null}
12 href={`/${section}/${props.post.slug}`}
13 key={`post-${props.post.slug}`}
17 className="aspect-w-5 aspect-h-4 rounded-lg"
18 src={props.post.extra.image || ""}
21 <h4 className="mt-2">{props.post.title}</h4>
22 <div className="flex items-baseline mt-1">
23 {props.post.extra.author ? (
24 <div className="type-sub-bold mr-2">
25 {props.post.extra.author}
28 {props.post.extra.ship ? (
29 <div className="type-sub-bold text-gray font-mono">
30 {props.post.extra.ship}
34 <div className="text-gray type-sub mt-1">
35 {formatDate(new Date(props.post.date))}
43PostPreview.defaultProps = {
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list