mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-08-23 17:36:15 +02:00
added read time on index and post pages
This commit is contained in:
@@ -5,7 +5,6 @@ import { Link } from "gatsby";
|
||||
import * as styles from "./Feed.module.scss";
|
||||
import { Edge } from "@/types";
|
||||
|
||||
|
||||
type Props = {
|
||||
edges: Array<Edge>;
|
||||
};
|
||||
@@ -17,12 +16,14 @@ const Feed: React.FC<Props> = ({ edges }: Props) => (
|
||||
<div className={styles.meta}>
|
||||
<time
|
||||
className={styles.time}
|
||||
dateTime={new Date(edge.node.frontmatter.date).toLocaleDateString(
|
||||
"en-US",
|
||||
{ year: "numeric", month: "long", day: "numeric" },
|
||||
)}
|
||||
dateTime={new Date(edge.node.frontmatter.date).toLocaleDateString("en-US", {
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
})}
|
||||
>
|
||||
{new Date(edge.node.frontmatter.date).toLocaleDateString("en-US", {
|
||||
{new Date(edge.node.frontmatter.date).toLocaleDateString("en-Us", {
|
||||
day: "numeric",
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
})}
|
||||
@@ -39,11 +40,9 @@ const Feed: React.FC<Props> = ({ edges }: Props) => (
|
||||
{edge.node.frontmatter.title}
|
||||
</Link>
|
||||
</h2>
|
||||
<p className={styles.description}>
|
||||
{edge.node.frontmatter.description}
|
||||
</p>
|
||||
<p className={styles.description}>{edge.node.frontmatter.description}</p>
|
||||
<Link className={styles.more} to={edge.node.fields.slug}>
|
||||
Read
|
||||
Read ({edge.node.fields.readingTime?.text})
|
||||
</Link>
|
||||
</div>
|
||||
))}
|
||||
|
@@ -7,7 +7,7 @@ exports[`Feed renders correctly 1`] = `
|
||||
<time
|
||||
dateTime="September 1, 2016"
|
||||
>
|
||||
September 2016
|
||||
September 1, 2016
|
||||
</time>
|
||||
<span />
|
||||
<span>
|
||||
@@ -31,7 +31,8 @@ exports[`Feed renders correctly 1`] = `
|
||||
<a
|
||||
href="/posts/perfecting-the-art-of-perfection"
|
||||
>
|
||||
Read
|
||||
Read (
|
||||
)
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
@@ -39,7 +40,7 @@ exports[`Feed renders correctly 1`] = `
|
||||
<time
|
||||
dateTime="September 1, 2016"
|
||||
>
|
||||
September 2016
|
||||
September 1, 2016
|
||||
</time>
|
||||
<span />
|
||||
<span>
|
||||
@@ -63,7 +64,8 @@ exports[`Feed renders correctly 1`] = `
|
||||
<a
|
||||
href="/posts/the-birth-of-movable-type"
|
||||
>
|
||||
Read
|
||||
Read (
|
||||
)
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user