Skip to content

Commit a7b00b2

Browse files
committed
add blog/core-members/footer
1 parent 73417e1 commit a7b00b2

25 files changed

+838
-75
lines changed

blog/2019-05-28-first-blog-post.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
---
22
slug: first-blog-post
33
title: First Blog Post
4-
authors:
5-
name: Gao Wei
6-
title: Docusaurus Core Team
7-
url: https://github.com/wgao19
8-
image_url: https://github.com/wgao19.png
9-
tags: [hola, docusaurus]
104
---
115

126
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

blog/2019-05-29-long-blog-post.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
slug: long-blog-post
33
title: Long Blog Post
4-
authors: endi
5-
tags: [hello, docusaurus]
64
---
75

86
This is the summary of a very long blog post,

blog/2021-08-01-mdx-blog-post.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
slug: mdx-blog-post
33
title: MDX Blog Post
4-
authors: [slorber]
5-
tags: [docusaurus]
64
---
75

86
Blog posts support [Docusaurus Markdown features](https://docusaurus.io/docs/markdown-features), such as [MDX](https://mdxjs.com/).
@@ -12,9 +10,9 @@ Blog posts support [Docusaurus Markdown features](https://docusaurus.io/docs/mar
1210
Use the power of React to create interactive blog posts.
1311

1412
```js
15-
<button onClick={() => alert('button clicked!')}>Click me!</button>
13+
<button onClick={() => alert("button clicked!")}>Click me!</button>
1614
```
1715

18-
<button onClick={() => alert('button clicked!')}>Click me!</button>
16+
<button onClick={() => alert("button clicked!")}>Click me!</button>
1917

2018
:::

blog/2021-08-26-welcome/index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
slug: welcome
33
title: Welcome
4-
authors: [slorber, yangshun]
5-
tags: [facebook, hello, docusaurus]
64
---
75

86
[Docusaurus blogging features](https://docusaurus.io/docs/blog) are powered by the [blog plugin](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog).

docusaurus.config.ts

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { themes as prismThemes } from "prism-react-renderer";
22
import type { Config } from "@docusaurus/types";
33
import type * as Preset from "@docusaurus/preset-classic";
4+
import blogPlugin from "./plugins/blog-plugin";
5+
6+
const baseUrl = "/website";
47

58
const config: Config = {
69
title: "Pleisto",
@@ -11,7 +14,7 @@ const config: Config = {
1114
url: "https://pleisto.github.io",
1215
// Set the /<baseUrl>/ pathname under which your site is served
1316
// For GitHub pages deployment, it is often '/<projectName>/'
14-
baseUrl: "/website",
17+
baseUrl,
1518

1619
// GitHub pages deployment config.
1720
// If you aren't using GitHub pages, you don't need these.
@@ -34,16 +37,23 @@ const config: Config = {
3437
"classic",
3538
{
3639
docs: false,
37-
blog: {
38-
showReadingTime: true,
39-
},
40+
blog: false,
4041
theme: {
4142
customCss: "./src/css/custom.css",
4243
},
4344
} satisfies Preset.Options,
4445
],
4546
],
4647

48+
plugins: [
49+
[
50+
blogPlugin,
51+
{
52+
showReadingTime: false,
53+
},
54+
],
55+
],
56+
4757
themeConfig: {
4858
colorMode: {
4959
disableSwitch: true,
@@ -60,33 +70,38 @@ const config: Config = {
6070
to: "#about-us",
6171
label: "About Us",
6272
position: "left",
63-
activeBasePath: "/#about-us",
73+
activeBasePath: baseUrl + "/#about-us",
6474
},
6575
{
6676
to: "#ai-solutions",
6777
label: "AI Solutions",
6878
position: "left",
69-
activeBasePath: "/#ai-solutions",
79+
activeBasePath: baseUrl + "/#ai-solutions",
7080
},
7181
{
7282
to: "#blogs",
7383
label: "Blogs",
7484
position: "left",
75-
activeBasePath: "/#blogs",
85+
activeBasePath: baseUrl + "/#blogs",
7686
},
7787
{
7888
to: "#core-members",
7989
label: "Core Members",
8090
position: "left",
81-
activeBasePath: "/#core-members",
91+
activeBasePath: baseUrl + "/#core-members",
8292
},
8393
{
8494
to: "#partners",
8595
label: "Partner",
8696
position: "left",
87-
activeBasePath: "/#partners",
97+
activeBasePath: baseUrl + "/#partners",
98+
},
99+
{
100+
to: "#contact-us",
101+
label: "Contact us",
102+
position: "left",
103+
activeBasePath: baseUrl + "/#contact-us",
88104
},
89-
{ to: "#contact-us", label: "Contact us", position: "left" },
90105
{
91106
type: "localeDropdown",
92107
position: "right",

plugins/blog-plugin.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import blogPlugin, { PluginOptions } from "@docusaurus/plugin-content-blog";
2+
import { LoadContext, Plugin } from "@docusaurus/types";
3+
4+
const blogPluginExtended: Plugin = async (
5+
context: LoadContext,
6+
options: PluginOptions
7+
) => {
8+
const blogPluginInstance = await blogPlugin(context, options);
9+
10+
return {
11+
// Add all properties of the default blog plugin so existing functionality is preserved
12+
...blogPluginInstance,
13+
/**
14+
* Override the default `contentLoaded` hook to access blog posts data
15+
*/
16+
contentLoaded: async function (data) {
17+
// Get the 2 latest blog posts
18+
const recentPosts = [...data.content.blogPosts].splice(0, 2);
19+
20+
data.actions.setGlobalData({
21+
recentPosts,
22+
});
23+
24+
// Call the default overridden `contentLoaded` implementation
25+
return blogPluginInstance.contentLoaded(data);
26+
},
27+
};
28+
};
29+
30+
export * from "@docusaurus/plugin-content-blog";
31+
export default blogPluginExtended;

src/components/icons/Close.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { FC, MouseEventHandler } from "react";
2+
3+
export interface CloseProps {
4+
className?: string;
5+
onClick?: MouseEventHandler;
6+
}
7+
8+
export const Close: FC<CloseProps> = ({ className, onClick }) => (
9+
<svg
10+
className={className}
11+
onClick={onClick}
12+
width="1em"
13+
height="1em"
14+
viewBox="0 0 30 30"
15+
fill="none"
16+
xmlns="http://www.w3.org/2000/svg"
17+
>
18+
<path
19+
fillRule="evenodd"
20+
clipRule="evenodd"
21+
d="M4.55806 4.55806C4.80214 4.31398 5.19786 4.31398 5.44194 4.55806L25.4419 24.5581C25.686 24.8021 25.686 25.1979 25.4419 25.4419C25.1979 25.686 24.8021 25.686 24.5581 25.4419L4.55806 5.44194C4.31398 5.19786 4.31398 4.80214 4.55806 4.55806Z"
22+
fill="#424242"
23+
/>
24+
<path
25+
fillRule="evenodd"
26+
clipRule="evenodd"
27+
d="M25.4419 4.55806C25.686 4.80214 25.686 5.19786 25.4419 5.44194L5.44194 25.4419C5.19786 25.686 4.80214 25.686 4.55806 25.4419C4.31398 25.1979 4.31398 24.8021 4.55806 24.5581L24.5581 4.55806C24.8021 4.31398 25.1979 4.31398 25.4419 4.55806Z"
28+
fill="#424242"
29+
/>
30+
</svg>
31+
);

src/css/custom.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,4 +190,13 @@ html {
190190
.menu__link,
191191
.menu__caret {
192192
border-radius: 0;
193+
}
194+
195+
article {
196+
color: rgba(146, 146, 146, 1);
197+
198+
}
199+
200+
article h2 a {
201+
color: rgba(66, 66, 66, 1);
193202
}

0 commit comments

Comments
 (0)