Skip to content

Commit 52829d3

Browse files
authored
Merge pull request #10640 from Chasen-Zhang/main
feat(front): Add [fetch-databend-releases] plugin and refactor download page
2 parents 0d823a4 + b1c3cad commit 52829d3

File tree

28 files changed

+1312
-473
lines changed

28 files changed

+1312
-473
lines changed

docs/doc/00-overview/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
title: Welcome
33
slug: /
44
---
5-
import GetLatest from '@site/src/components/GetLatest';
65

76
Welcome to the Databend documentation! Databend is an **open-source**, **elastic**, and **workload-aware** modern cloud data warehouse designed to meet businesses' massive-scale analytics needs at low cost and with low complexity.
87

docs/doc/03-develop/01-python.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ sidebar_label: Python
44
description:
55
Develop with Databend using Python.
66
---
7-
import GetLatest from '@site/src/components/GetLatest';
87

98
Databend offers the following options enabling you to develop applications using the Python programming language and establish connectivity with Databend:
109

website/docusaurus.config.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const config = {
3131
},
3232

3333
customFields: {
34-
blogTags: ['weekly','databend']
34+
blogTags: ['weekly','databend']
3535
},
3636

3737
presets: [
@@ -80,7 +80,8 @@ const config = {
8080
],
8181
plugins: [
8282
'docusaurus-plugin-sass',
83-
'./src/plugins/globalSassVarInject',
83+
'./src/plugins/global-sass-var-inject',
84+
'./src/plugins/fetch-databend-releases',
8485
[
8586
'@docusaurus/plugin-content-docs',
8687
/** @type {import('@docusaurus/plugin-content-docs').Options} */
@@ -179,4 +180,4 @@ const config = {
179180
}),
180181
};
181182

182-
module.exports = config;
183+
module.exports = config;

website/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,21 @@
2727
"bytes": "^3.1.2",
2828
"clsx": "^1.1.1",
2929
"copyforjs": "^1.0.6",
30+
"dayjs": "^1.11.7",
3031
"docusaurus-plugin-sass": "^0.2.1",
3132
"node": "^17.7.2",
3233
"prism-react-renderer": "^1.2.1",
3334
"rc-table": "^7.27.1",
3435
"rc-texty": "^0.2.0",
3536
"react": "^17.0.1",
3637
"react-dom": "^17.0.1",
38+
"react-markdown": "^8.0.5",
39+
"remark-gfm": "^3.0.1",
3740
"sass": "^1.45.0"
3841
},
3942
"devDependencies": {
4043
"@docusaurus/module-type-aliases": "^2.2.0",
4144
"@tsconfig/docusaurus": "^1.0.4",
42-
"postcss-px-to-viewport-8-plugin": "^1.1.3",
4345
"sass-resources-loader": "^2.2.4",
4446
"typescript": "^4.3.5"
4547
},
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright 2023 Datafuse Labs.
2+
import React from 'react';
3+
import { FC, ReactElement } from 'react';
4+
import styles from './styles.module.scss';
5+
import clsx from 'clsx';
6+
import { ICommonProps } from '@site/src/types';
7+
interface IProps extends ICommonProps{
8+
href?: string;
9+
isDownload?: boolean;
10+
padding?: number[];
11+
}
12+
const Card: FC<IProps> = ({children, padding, className, href, isDownload, style}): ReactElement=> {
13+
const props = {
14+
style:{padding: `${padding[0]}px ${padding[1]}px`, ...style},
15+
className: clsx(styles.wrap, className)
16+
}
17+
return (
18+
<>
19+
{
20+
href
21+
? <a download={isDownload} href={href} {...props}>{children}</a>
22+
: <div {...props}>{children}</div>
23+
}
24+
</>
25+
);
26+
};
27+
Card.defaultProps = {
28+
padding: [28, 24],
29+
isDownload: false
30+
}
31+
export default Card;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.wrap {
2+
background-color: var(--color-fill-0);
3+
border: 1px solid var(--color-border);
4+
border-radius: 6px;
5+
display: block;
6+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2023 Datafuse Labs.
2+
import { FC, ReactElement } from 'react';
3+
import styles from './styles.module.scss';
4+
import React from 'react';
5+
import clsx from 'clsx';
6+
import { ICommonProps } from '@site/src/types';
7+
8+
const Tag: FC<ICommonProps> = ({children, className}): ReactElement=> {
9+
return (
10+
<span className={clsx(styles.tag, className)}>{children}</span>
11+
);
12+
};
13+
export default Tag;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.tag {
2+
display: inline-block;
3+
height: 20px;
4+
font-size: 14px;
5+
line-height: 20px;
6+
padding-left: 8px;
7+
padding-right: 8px;
8+
color: var(--color-white);
9+
background-color: var(--color-primary );
10+
border-radius: 100px;
11+
}

website/src/components/CustomBlog/BlogList.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ import styles from "./styles.module.scss";
33
import clsx from "clsx";
44
import WeeklyCover from "./WeeklyCover";
55
import DefaultCover from "./DefaultCover";
6-
import useBaseUrl from "@docusaurus/useBaseUrl";
76

87
const BlogList = (metadatas) => {
98
const items = metadatas.metadatas.items.map((item) => {
109
const metadata = item.content.metadata;
10+
function innerTagAction(e, permalink) {
11+
e.stopPropagation();
12+
e.preventDefault();
13+
window.open(permalink, '_self')
14+
}
1115
return (
1216
<li
1317
className={clsx("post-list-item", styles.postListItem)}
@@ -30,7 +34,7 @@ const BlogList = (metadatas) => {
3034
{metadata.tags.map((tag, index) => {
3135
return (
3236
<span className={clsx("tag", styles.Tag)} key={index}>
33-
<a href={tag.permalink}># {tag.label}</a>
37+
<span onClick={(e)=> innerTagAction(e, tag.permalink)}># {tag.label}</span>
3438
</span>
3539
);
3640
})}
@@ -52,9 +56,9 @@ const BlogList = (metadatas) => {
5256
className={clsx("post-list-item-description", styles.postListDesc)}
5357
>
5458
By{" "}
55-
<a href={metadata.authors[0].url}>
59+
<span onClick={(e)=> innerTagAction(e, metadata.authors[0].url)}>
5660
<strong>{metadata.authors[0].name}</strong>
57-
</a>{" "}
61+
</span>{" "}
5862
on {metadata.formattedDate}
5963
</p>
6064
</a>

website/src/components/CustomBlog/styles.module.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@
138138
.postListDesc {
139139
color: var(--color-text-2) !important;
140140
font-size: 14px;
141+
span{
142+
color: var(--color-primary);
143+
font-weight: bold;
144+
}
141145
}
142146

143147
@include media{

0 commit comments

Comments
 (0)