From 2c01f6ba24963a4574ea1cdd51e55e8e2ca35bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noah=20H=C3=BCsser?= Date: Thu, 16 May 2024 16:36:08 +0100 Subject: [PATCH] Fix page --- _config.ts | 4 +-- src/_includes/templates/post-details.jsx | 37 ++++++++++++------------ 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/_config.ts b/_config.ts index 7d0b6ac..01c3660 100644 --- a/_config.ts +++ b/_config.ts @@ -17,7 +17,6 @@ import sass from "lume/plugins/sass.ts"; import source_maps from "lume/plugins/source_maps.ts"; import svgo from "lume/plugins/svgo.ts"; import toc from "https://deno.land/x/lume_markdown_plugins@v0.1.0/toc/mod.ts"; -import readingTime from "https://raw.githubusercontent.com/lumeland/experimental-plugins/main/reading_time/mod.ts"; import { Page } from "lume/core.ts"; const markdown = { @@ -56,7 +55,6 @@ site.use(imagick()); site.use(sass()); site.use(source_maps()); site.use(svgo()); -site.use(readingTime()); site .scopedUpdates((path) => path.endsWith(".png") || path.endsWith(".jpg")) .filter("slice", (arr, length) => arr.slice(0, length)) @@ -109,7 +107,7 @@ site }) .preprocess([".md"], (page: Page) => { page.data.excerpt ??= (page.data.content as string).split( - //i, + //i )[0]; }); diff --git a/src/_includes/templates/post-details.jsx b/src/_includes/templates/post-details.jsx index c690ce2..89630cc 100644 --- a/src/_includes/templates/post-details.jsx +++ b/src/_includes/templates/post-details.jsx @@ -1,34 +1,35 @@ -export default ( - { search, authors, date, readingTime, filters }, -) => { +export default ({ search, authors, date, readingTime, filters }) => { const page = search.page(`type=author author="author"`); return (

- by {authors.map((author, i) => (( + by{" "} + {authors.map((author, i) => ( <> - {page - ? ( - - {author} - - ) - : author} + {page ? ( + + {author} + + ) : ( + author + )} {authors.length == 2 - ? (i == authors.length - 1 ? "" : " and ") - : (authors.length > 2 - ? (i == authors.length - 1 ? "" : ", ") - : "")} + ? i == authors.length - 1 + ? "" + : " and " + : authors.length > 2 + ? i == authors.length - 1 + ? "" + : ", " + : ""} - )))} + ))}

- -

{readingTime.minutes} min read

); };