Skip to content

Commit 6c1fe98

Browse files
committed
refactor: removed unused plugin and unrelated BlogPostItem header change
1 parent c57f9f9 commit 6c1fe98

3 files changed

Lines changed: 2 additions & 83 deletions

File tree

docusaurus.config.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type { Config } from "@docusaurus/types";
33
import type * as Preset from "@docusaurus/preset-classic";
44
import * as dotenv from "dotenv";
55
import giscusInjector from "./src/plugins/giscus-injector";
6-
import blogReadingTime from "./src/plugins/blog-reading-time";
76
dotenv.config({ path: ".env.local" });
87
dotenv.config();
98

@@ -263,7 +262,6 @@ const config: Config = {
263262
themes: ["@docusaurus/theme-mermaid"],
264263

265264
plugins: [
266-
blogReadingTime,
267265
[
268266
"@docusaurus/plugin-ideal-image",
269267
{

src/plugins/blog-reading-time.ts

Lines changed: 0 additions & 45 deletions
This file was deleted.

src/theme/BlogPostItem/Header/index.tsx

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -59,42 +59,8 @@ export default function BlogPostItemHeaderWrapper(props: Props): JSX.Element {
5959
const { metadata, isBlogPostPage } = useBlogPost();
6060

6161
if (!isBlogPostPage) {
62-
const roundedReadTime = Math.max(1, Math.ceil(metadata.readingTime || 0));
63-
const readTimeText = `${roundedReadTime} min read`;
64-
65-
return (
66-
<>
67-
<BlogPostItemHeaderOriginal {...props} />
68-
<span
69-
style={{
70-
display: "inline-flex",
71-
alignItems: "center",
72-
gap: "0.25rem",
73-
fontSize: "0.8rem",
74-
color: "var(--ifm-color-emphasis-600)",
75-
marginTop: "0.25rem",
76-
}}
77-
>
78-
<svg
79-
xmlns="http://www.w3.org/2000/svg"
80-
viewBox="0 0 24 24"
81-
width="12"
82-
height="12"
83-
fill="none"
84-
stroke="currentColor"
85-
strokeWidth="2"
86-
strokeLinecap="round"
87-
strokeLinejoin="round"
88-
aria-hidden="true"
89-
>
90-
<circle cx="12" cy="12" r="10" />
91-
<polyline points="12 6 12 12 16 14" />
92-
</svg>
93-
{readTimeText}
94-
</span>
95-
</>
96-
);
97-
}
62+
return <BlogPostItemHeaderOriginal {...props} />;
63+
}
9864

9965
// Build display data for ALL authors (not just the first one)
10066
const authors = (metadata.authors ?? []).map((author) => {

0 commit comments

Comments
 (0)