This is an automated email from the ASF dual-hosted git repository.
shuai pushed a commit to branch fix-text
in repository https://gitbox.apache.org/repos/asf/answer-website.git
The following commit(s) were added to refs/heads/fix-text by this push:
new 9454fca0c fix: ci Add to run fetPlugin.js step
9454fca0c is described below
commit 9454fca0c0416ff99e2ea0c2af3022a522347d71
Author: shuai <[email protected]>
AuthorDate: Mon Feb 17 12:18:02 2025 +0800
fix: ci Add to run fetPlugin.js step
---
.github/workflows/deploy.yml | 2 +
src/pages/plugins.tsx | 27 +----
static/data/plugin.json | 276 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 283 insertions(+), 22 deletions(-)
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 39a468ea5..677781ba2 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -42,6 +42,8 @@ jobs:
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
+ - name: Fetch plugins data
+ run: node scripts/fetchPlugins.js
- name: build
run: pnpm run build
diff --git a/src/pages/plugins.tsx b/src/pages/plugins.tsx
index 708490908..9e77ceba4 100644
--- a/src/pages/plugins.tsx
+++ b/src/pages/plugins.tsx
@@ -6,33 +6,16 @@ import Layout from '@theme/Layout';
import HeaderSlogan from '../components/HeaderSlogan';
+import pluginList from '../../static/data/plugin.json';
+
export default function Plugins(): JSX.Element {
- const [list, setList] = useState([]);
const { i18n } = useDocusaurusContext();
+ const currentLang = i18n.currentLocale;
+ const lang = currentLang === 'en' ? 'en_US' : 'zh_CN';
+ const list = pluginList[lang];
- useEffect(() => {
- getPluginList();
- }, [])
-
- const getPluginList = async () => {
- try {
- const res = await fetch(
-
'https://raw.githubusercontent.com/apache/answer-plugins/main/plugins_desc.json'
- );
- const data = await res.json();
- if (Array.isArray(data)) {
- setList(data);
- } else {
- const currentLang = i18n.currentLocale;
- const lang = currentLang === 'en' ? 'en_US' : currentLang.replace('-',
'_');
- setList(data[lang]);
- }
- } catch (err) {
- console.error('featch plugins list error', err);
- }
- }
return (
<Layout
title={translate({ message: 'Plugins' })}
diff --git a/static/data/plugin.json b/static/data/plugin.json
new file mode 100644
index 000000000..51e682952
--- /dev/null
+++ b/static/data/plugin.json
@@ -0,0 +1,276 @@
+{
+ "en_US": [
+ {
+ "name": "Redis Cache",
+ "desc": "Use Redis as cache",
+ "link": "https://github.com/apache/answer-plugins/tree/main/cache-redis"
+ },
+ {
+ "name": "Basic Captcha",
+ "desc": "Default graphic verification code",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/captcha-basic"
+ },
+ {
+ "name": "Google reCAPTCHA v2",
+ "desc": "Google reCAPTCHA v2 plugin",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/captcha-google-v2"
+ },
+ {
+ "name": "Aliyun CDN",
+ "desc": "Speed up your website and enjoy greatly improved loading times
around the world.",
+ "link": "https://github.com/apache/answer-plugins/tree/main/cdn-aliyun"
+ },
+ {
+ "name": "Amazon CloudFront",
+ "desc": "Speed up your website and enjoy greatly improved loading times
around the world.",
+ "link": "https://github.com/apache/answer-plugins/tree/main/cdn-s3"
+ },
+ {
+ "name": "Apache Connector",
+ "desc": "Connect to Apache Oauth",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/connector-apache"
+ },
+ {
+ "name": "OAuth2 Basic",
+ "desc": "Generic OAuth2 Plugin",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/connector-basic"
+ },
+ {
+ "name": "Dingtalk Connector",
+ "desc": "Connect to Dingtalk for third-party login",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/connector-dingtalk"
+ },
+ {
+ "name": "Google Connector",
+ "desc": "Connect to Google for third-party login",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/connector-google"
+ },
+ {
+ "name": "Wallet Connector",
+ "desc": "Connect to Wallet for third-party login",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/connector-wallet"
+ },
+ {
+ "name": "Chart Editor",
+ "desc": "Render chart in editor",
+ "link": "https://github.com/apache/answer-plugins/tree/main/editor-chart"
+ },
+ {
+ "name": "Formula Editor",
+ "desc": "Render formula in editor",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/editor-formula"
+ },
+ {
+ "name": "Embed",
+ "desc": "Embed content from other sites",
+ "link": "https://github.com/apache/answer-plugins/tree/main/embed-basic"
+ },
+ {
+ "name": "Ding talk Notification",
+ "desc": "Send notifications to Ding Talk",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/notification-dingtalk"
+ },
+ {
+ "name": "Slack Notification",
+ "desc": "Send notifications to Slack",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/notification-slack"
+ },
+ {
+ "name": "Code Highlight",
+ "desc": "Highlight code blocks in Markdown content",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/render-markdown-codehighlight"
+ },
+ {
+ "name": "Akismet Anti-Spam",
+ "desc": "Akismet Anti-Spam is used to check the content of posts and
comments against the Akismet web service to see if they look like spam.",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/reviewer-akismet"
+ },
+ {
+ "name": "Baidu Anti-Spam",
+ "desc": "Baidu Anti-Spam is used to check the content of posts and
comments against the Baidu web service to see if they look like spam.",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/reviewer-baidu"
+ },
+ {
+ "name": "Review Basic",
+ "desc": "Generic review rule plugin",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/reviewer-basic"
+ },
+ {
+ "name": "Algolia Search",
+ "desc": "Use Algolia as a search engine.",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/search-algolia"
+ },
+ {
+ "name": "Elasticsearch Engine",
+ "desc": "Use Elasticsearch as search engine",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/search-elasticsearch"
+ },
+ {
+ "name": "MeiliSearch",
+ "desc": "MeiliSearch is a powerful, fast, open-source, easy to use and
deploy search engine.",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/search-meilisearch"
+ },
+ {
+ "name": "Aliyun OSS storage",
+ "desc": "Upload files to AliCloud OSS storage",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/storage-aliyunoss"
+ },
+ {
+ "name": "S3 storage",
+ "desc": "Upload files to S3 storage",
+ "link": "https://github.com/apache/answer-plugins/tree/main/storage-s3"
+ },
+ {
+ "name": "Tencent COS storage",
+ "desc": "Upload files to Tencent COS storage",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/storage-tencentyuncos"
+ },
+ {
+ "name": "Slack User Center",
+ "desc": "A plugin for integrating Slack user management",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/user-center-slack"
+ },
+ {
+ "name": "WeCom",
+ "desc": "Get user info from WeCom and sync to User Center",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/user-center-wecom"
+ }
+ ],
+ "zh_CN": [
+ {
+ "name": "Redis缓存",
+ "desc": "使用Redis作为缓存",
+ "link": "https://github.com/apache/answer-plugins/tree/main/cache-redis"
+ },
+ {
+ "name": "基础验证码",
+ "desc": "默认图形验证码",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/captcha-basic"
+ },
+ {
+ "name": "Google reCAPTCHA v2",
+ "desc": "Google reCAPTCHA v2 插件",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/captcha-google-v2"
+ },
+ {
+ "name": "阿里云CDN",
+ "desc": "通过阿里云CDN提升静态资源加速",
+ "link": "https://github.com/apache/answer-plugins/tree/main/cdn-aliyun"
+ },
+ {
+ "name": "Amazon CloudFront",
+ "desc": "通过AWS CDN提升静态资源加速",
+ "link": "https://github.com/apache/answer-plugins/tree/main/cdn-s3"
+ },
+ {
+ "name": "Apache 连接器",
+ "desc": "用于接入 Apache Oauth",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/connector-apache"
+ },
+ {
+ "name": "通用连接器",
+ "desc": "适用于各种 OAuth 登录的通用插件",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/connector-basic"
+ },
+ {
+ "name": "钉钉连接器",
+ "desc": "用于接入钉钉第三方登录",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/connector-dingtalk"
+ },
+ {
+ "name": "Google 连接器",
+ "desc": "用于接入 Google 第三方登录",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/connector-google"
+ },
+ {
+ "name": "Wallet 连接器",
+ "desc": "用于接入 Wallet 第三方登录",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/connector-wallet"
+ },
+ {
+ "name": "图表编辑器",
+ "desc": "在编辑器中渲染图表",
+ "link": "https://github.com/apache/answer-plugins/tree/main/editor-chart"
+ },
+ {
+ "name": "公式编辑器",
+ "desc": "在编辑器中渲染公式",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/editor-formula"
+ },
+ {
+ "name": "内容嵌入",
+ "desc": "在内容中嵌入其他网站",
+ "link": "https://github.com/apache/answer-plugins/tree/main/embed-basic"
+ },
+ {
+ "name": "钉钉通知",
+ "desc": "发送通知到钉钉",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/notification-dingtalk"
+ },
+ {
+ "name": "Slack 通知",
+ "desc": "发送通知到 Slack",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/notification-slack"
+ },
+ {
+ "name": "代码高亮",
+ "desc": "高亮显示 Markdown 内容中的代码块",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/render-markdown-codehighlight"
+ },
+ {
+ "name": "Akismet Anti-Spam",
+ "desc": "Akismet Anti-Spam is used to check the content of posts and
comments against the Akismet web service to see if they look like spam.",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/reviewer-akismet"
+ },
+ {
+ "name": "百度反垃圾",
+ "desc": "百度反垃圾用于检查帖子和评论内容,通过百度内容审核平台查看它们是否像垃圾内容。",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/reviewer-baidu"
+ },
+ {
+ "name": "基础审核插件",
+ "desc": "基础的通用审核插件",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/reviewer-basic"
+ },
+ {
+ "name": "Algolia 搜索",
+ "desc": "使用 Algolia 作为搜索引擎.",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/search-algolia"
+ },
+ {
+ "name": "Elasticsearch 引擎",
+ "desc": "使用 Elasticsearch 作为搜索引擎",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/search-elasticsearch"
+ },
+ {
+ "name": "MeiliSearch",
+ "desc": "MeiliSearch 是一个强大、快速、开源、易于使用和部署的搜索引擎。",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/search-meilisearch"
+ },
+ {
+ "name": "阿里云OSS存储",
+ "desc": "上传文件到阿里云OSS存储",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/storage-aliyunoss"
+ },
+ {
+ "name": "S3 存储",
+ "desc": "上传文件到S3存储",
+ "link": "https://github.com/apache/answer-plugins/tree/main/storage-s3"
+ },
+ {
+ "name": "腾讯云COS对象存储",
+ "desc": "上传文件到腾讯云COS对象存储",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/storage-tencentyuncos"
+ },
+ {
+ "name": "Slack",
+ "desc": "通过Slack进行登录",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/user-center-slack"
+ },
+ {
+ "name": "企业微信",
+ "desc": "从企业微信获取用户信息并同步到用户中心",
+ "link":
"https://github.com/apache/answer-plugins/tree/main/user-center-wecom"
+ }
+ ]
+}