added read time on index and post pages

This commit is contained in:
2022-09-29 22:28:06 +02:00
parent 619758c175
commit 6a9ceb9670
22 changed files with 103 additions and 50 deletions

View File

@@ -9,13 +9,23 @@
.title {
font-size: $typographic-base-font-size * 2;
font-weight: 600;
margin-bottom: 0px !important;
margin-left: auto;
margin-right: auto;
max-width: $layout-post-width;
text-align: center;
@include line-height(1.65);
@include margin-top(1);
@include margin-bottom(0);
}
.subTitle {
font-size: $typographic-base-font-size;
font-style: italic;
margin-left: auto;
margin-right: auto;
margin-top: 0px;
max-width: $layout-post-width;
text-align: center;
}
.body {
@@ -48,7 +58,7 @@
max-width: $layout-post-width;
}
h2 > a {
h2>a {
visibility: hidden;
}
@@ -80,7 +90,7 @@
@include margin-bottom(1.125);
}
h2 > a {
h2>a {
visibility: unset;
@include padding-right(1);
}

View File

@@ -6,15 +6,17 @@ import * as styles from "./Content.module.scss";
interface Props {
title: string;
body: string;
subTitle?: string;
}
const Content: React.FC<Props> = ({ body, title }: Props) => {
const Content: React.FC<Props> = ({ body, title, subTitle }: Props) => {
const { author } = useSiteMetadata();
return (
<>
<PostHeader author={author} />
<div className={styles.content}>
<h1 className={styles.title}>{title}</h1>
<h2 className={styles.subTitle}>- {subTitle}</h2>
<div className={styles.body} dangerouslySetInnerHTML={{ __html: body }} />
</div>
</>

View File

@@ -138,6 +138,9 @@ exports[`Content renders correctly 1`] = `
<h1>
Perfecting the Art of Perfection
</h1>
<h2>
-
</h2>
<div
dangerouslySetInnerHTML={
{