From 502edd0b28119a7f602500a4c5cd4a8f8250a128 Mon Sep 17 00:00:00 2001 From: Hopelezz <72772558+Hopelezz@users.noreply.github.com> Date: Sun, 14 Aug 2022 11:26:38 -0500 Subject: [PATCH 1/6] changed most recent to a start --- src/components/blog/PostPreview.astro | 10 +-- src/layouts/BookPost.astro | 65 ++++++++------- src/pages/blog/4-a-start.mdx | 83 ++++++++++++++++++++ src/pages/blog/4-most-recent-post-button.mdx | 68 ---------------- src/pages/book/10-never-let-me-go.mdx | 1 + src/pages/book/12-alias-grace.mdx | 19 +++++ 6 files changed, 139 insertions(+), 107 deletions(-) create mode 100644 src/pages/blog/4-a-start.mdx delete mode 100644 src/pages/blog/4-most-recent-post-button.mdx create mode 100644 src/pages/book/12-alias-grace.mdx diff --git a/src/components/blog/PostPreview.astro b/src/components/blog/PostPreview.astro index dac662a..7976500 100644 --- a/src/components/blog/PostPreview.astro +++ b/src/components/blog/PostPreview.astro @@ -96,7 +96,7 @@ a { .details p { font-size: var(--size-3); margin-top: 5px; - padding-top: var(--gap-3); + /* padding-top: var(--gap-1); */ } /* remove link decoration */ @@ -105,13 +105,13 @@ a { text-decoration: none; } -/* truncate 2 lines */ - .truncate { - width: var(--size-fluid-8); overflow: hidden; - white-space: nowrap; text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 3; + white-space: normal; } /*-------------Media --------------------*/ diff --git a/src/layouts/BookPost.astro b/src/layouts/BookPost.astro index cb38466..69c5686 100644 --- a/src/layouts/BookPost.astro +++ b/src/layouts/BookPost.astro @@ -1,56 +1,53 @@ --- - +import '../styles/shiki.css'; import Meta from '../components/MetaTags.astro'; import Navbar from '../components/Navbar.astro'; import Cursor from '../components/cursorEffect/Cursor.astro'; -import BookPost from '../components/bookShelf/Post.astro'; +import BlogPost from '../components/blog/Post.astro'; import Footer from '../components/footer/Footer.astro'; -import { getBlogPosts, getBookPosts } from '../utils/api.astro'; +import type { MDXInstance } from 'astro'; +import { Post } from '../utils/types'; + +export interface Props { + post: MDXInstance +} -const { mostRecentBlogPost } = await getBlogPosts(); // Fetch most recent blog post -const { mostRecentBookPost } = await getBookPosts(); // Fetch most recent book post -const { content } = Astro.props; // Get content from props -const { title, description, publishDate, author, heroImage, permalink, alt, img} = content; +// const { minutesRead } = Astro.props.frontmatter; +const { content } = Astro.props; +const { title, publishDate, writer, href, description, img, alt, permalink } = content; +const { minutesRead } = Astro.props.content; + +// console.log(minutesRead); --- - - - - -
- - -
- - - -
- - + + + +
+
+
+
+ +

{minutesRead}

- - +
-
-
- +
+
+
+