This is an automated email from the ASF dual-hosted git repository.
tison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kvrocks-website.git
The following commit(s) were added to refs/heads/main by this push:
new 3a808b2 refactor: drop CDN related code
3a808b2 is described below
commit 3a808b2e73995c982fc059260651410f89875cdb
Author: tison <[email protected]>
AuthorDate: Fri May 5 21:11:17 2023 +0800
refactor: drop CDN related code
This is a follow-up to
https://github.com/apache/incubator-kvrocks-website/pull/99.
Signed-off-by: tison <[email protected]>
---
src/cdn.ts | 7 -------
src/components/HomepageFeatures/index.tsx | 16 ++++------------
src/pages/index.tsx | 3 +--
3 files changed, 5 insertions(+), 21 deletions(-)
diff --git a/src/cdn.ts b/src/cdn.ts
deleted file mode 100644
index d1ae995..0000000
--- a/src/cdn.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export function resolveStaticAssetsURL(path: string) {
- if (!path.startsWith('/')) {
- path = '/' + path;
- }
-
- return path
-}
diff --git a/src/components/HomepageFeatures/index.tsx
b/src/components/HomepageFeatures/index.tsx
index cfaf602..bbd0bfb 100644
--- a/src/components/HomepageFeatures/index.tsx
+++ b/src/components/HomepageFeatures/index.tsx
@@ -1,14 +1,6 @@
import React from 'react';
import clsx from 'clsx';
import styles from './styles.module.css';
-import {resolveStaticAssetsURL} from "@site/src/cdn";
-
-const imagePaths = {
- namespace: resolveStaticAssetsURL('img/namespace.png'),
- cluster: resolveStaticAssetsURL('img/cluster.png'),
- highAvailable: resolveStaticAssetsURL('img/high-available.png'),
- replication: resolveStaticAssetsURL('img/replication.png'),
-};
type FeatureItem = {
imgPath:string;
@@ -18,7 +10,7 @@ type FeatureItem = {
const FeatureList: FeatureItem[] = [
{
- imgPath:imagePaths.namespace,
+ imgPath: require('@site/static/img/namespace.png').default,
title: 'Namespace',
description: (
<>
@@ -27,7 +19,7 @@ const FeatureList: FeatureItem[] = [
),
},
{
- imgPath:imagePaths.replication,
+ imgPath: require('@site/static/img/cluster.png').default,
title: 'Replication',
description: (
<>
@@ -36,7 +28,7 @@ const FeatureList: FeatureItem[] = [
),
},
{
- imgPath:imagePaths.highAvailable,
+ imgPath: require('@site/static/img/high-available.png').default,
title: 'High Available',
description: (
<>
@@ -45,7 +37,7 @@ const FeatureList: FeatureItem[] = [
),
},
{
- imgPath:imagePaths.cluster,
+ imgPath: require('@site/static/img/replication.png').default,
title: 'Cluster',
description: (
<>
diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index a4483ce..23ecb3c 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -5,7 +5,6 @@ import useDocusaurusContext from
'@docusaurus/useDocusaurusContext';
import Layout from '@theme/Layout';
import HomepageFeatures from '@site/src/components/HomepageFeatures';
import styles from './index.module.css';
-import {resolveStaticAssetsURL} from '../cdn'
function HomepageHeader() {
const {siteConfig} = useDocusaurusContext();
@@ -18,7 +17,7 @@ function HomepageHeader() {
<div
className={clsx('hero__subtitle',styles.tagline)}>{siteConfig.tagline}</div>
</div>
<div className={clsx(styles.image)}>
- <img src={resolveStaticAssetsURL('img/hero.png')} />
+ <img src={require('@site/static/img/hero.png').default}
alt="kvrocks banner"/>
</div>
</div>
<div className={styles.buttons}>