You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by sh...@apache.org on 2023/11/13 02:53:39 UTC

(incubator-answer-website) branch main updated: add Plugins page (#119)

This is an automated email from the ASF dual-hosted git repository.

shuai pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-answer-website.git


The following commit(s) were added to refs/heads/main by this push:
     new e842623e add Plugins page (#119)
e842623e is described below

commit e842623e5e2c2dbc4f411585bad58f5015d9cd80
Author: dashuai <li...@sifou.com>
AuthorDate: Mon Nov 13 10:53:34 2023 +0800

    add Plugins page (#119)
    
    add plugin list page
---
 .../index.md                                       |  2 +-
 docusaurus.config.js                               |  4 +-
 i18n/zh-CN/code.json                               | 15 ++++++
 i18n/zh-CN/docusaurus-theme-classic/navbar.json    |  4 ++
 src/components/HeaderSlogan/index.tsx              |  4 ++
 src/pages/plugins.tsx                              | 62 ++++++++++++++++++++++
 6 files changed, 88 insertions(+), 3 deletions(-)

diff --git a/blog/2023-09-27-celebrate-answer-first-anniversary-with-hacktoberfest-2023/index.md b/blog/2023-09-27-celebrate-answer-first-anniversary-with-hacktoberfest-2023/index.md
index f9d90f11..a02f73aa 100644
--- a/blog/2023-09-27-celebrate-answer-first-anniversary-with-hacktoberfest-2023/index.md
+++ b/blog/2023-09-27-celebrate-answer-first-anniversary-with-hacktoberfest-2023/index.md
@@ -57,7 +57,7 @@ Here's the gear you need before making a contribution, and we are always here to
 
 * Docs: <https://answer.apache.org/docs/>
 * Community: <https://meta.answer.dev/>
-* <su...@answer.dev>
+* <de...@answer.apache.org>
 
 1. How to show my digital badges on my GitHub?
 
diff --git a/docusaurus.config.js b/docusaurus.config.js
index 259e2690..d5d42e4e 100644
--- a/docusaurus.config.js
+++ b/docusaurus.config.js
@@ -95,8 +95,8 @@ const config = {
             to: 'https://github.com/apache/incubator-answer/issues',
           },
           {
-            label: 'Roadmap',
-            to: 'https://github.com/orgs/answerdev/projects/1',
+            label: 'Plugins',
+            to: '/plugins',
           },
           {
             label: 'Community',
diff --git a/i18n/zh-CN/code.json b/i18n/zh-CN/code.json
index 2aff3a38..db2a6fef 100644
--- a/i18n/zh-CN/code.json
+++ b/i18n/zh-CN/code.json
@@ -556,5 +556,20 @@
   },
   "contact.twitter": {
     "message": "在 Twitter 上发送推文或私信 {br} @AnswerDev"
+  },
+  "plugins.title": {
+    "message": "插件"
+  },
+  "plugins.slogan": {
+    "message": "根据您的需求扩展功能。"
+  },
+  "plugins.instruction": {
+    "message": "任何人都可以向 Answer {submit_link}。 如果您对构建自己的插件有任何疑问,请 {community_link}。"
+  },
+  "plugins.instruction.submit": {
+    "message": "提交插件"
+  },
+  "plugins.instruction.join": {
+    "message": "加入我们的社区"
   }
 }
diff --git a/i18n/zh-CN/docusaurus-theme-classic/navbar.json b/i18n/zh-CN/docusaurus-theme-classic/navbar.json
index 72c205e7..4338f5ab 100644
--- a/i18n/zh-CN/docusaurus-theme-classic/navbar.json
+++ b/i18n/zh-CN/docusaurus-theme-classic/navbar.json
@@ -15,6 +15,10 @@
     "message": "路线图",
     "description": "Navbar item with label Roadmap"
   },
+  "item.label.Plugins": {
+    "message": "插件",
+    "description": "Navbar item with label Roadmap"
+  },
   "item.label.Community": {
     "message": "社区",
     "description": "Navbar item with label Community"
diff --git a/src/components/HeaderSlogan/index.tsx b/src/components/HeaderSlogan/index.tsx
index f574fb13..a3a4a2e4 100644
--- a/src/components/HeaderSlogan/index.tsx
+++ b/src/components/HeaderSlogan/index.tsx
@@ -16,6 +16,10 @@ const content = {
   contact: {
     title: <Translate id="contact.title">Contact us</Translate>,
     slogan: <Translate id="contact.slogan">We always get an answer to your question.</Translate>,
+  },
+  plugin: {
+    title: <Translate id="plugin.title">Plugins</Translate>,
+    slogan: <Translate id="plugin.slogan">Extend functionality to your needs.</Translate>,
   }
 }
 
diff --git a/src/pages/plugins.tsx b/src/pages/plugins.tsx
new file mode 100644
index 00000000..9876ea09
--- /dev/null
+++ b/src/pages/plugins.tsx
@@ -0,0 +1,62 @@
+import React, {  useEffect, useState } from 'react';
+import { Container, Row, Col, Card } from 'react-bootstrap';
+import Translate, { translate } from '@docusaurus/Translate';
+import Layout from '@theme/Layout';
+
+import HeaderSlogan from '../components/HeaderSlogan';
+
+
+export default function Plugins(): JSX.Element {
+  const [list, setList] = useState([]);
+  useEffect(() => {
+    fetch('https://raw.githubusercontent.com/answerdev/plugins/main/plugins_desc.json').then(res => res.json()).then(data => {
+      setList(data);
+    }).catch(err => {
+      console.error('featch plugins list error', err);
+    })
+  }, [])
+  return (
+    <Layout
+      title={translate({ message: 'Plugins' })}
+      description="Extend functionality to your needs.">
+      <HeaderSlogan type="plugin" />
+      <Container className='py-5'>
+         <div style={{ fontSize: '1.25rem' }}>
+          <Translate
+            id="plugins.instruction"
+            values={{
+              submit_link: (
+                <a href="https://github.com/apache/incubator-answer-plugins" target='_blank'>
+                  <Translate id="plugins.instruction.submit">submit an plugin</Translate>
+                </a>
+              ),
+              community_link: (
+                <a href="https://meta.answer.dev/" target='_blank'>
+                  <Translate id="plugins.instruction.join">join our community</Translate>
+                </a>
+              )
+            }}
+            >
+            {`Anyone can {submit_link} to Answer. If you have questions about building your own plugin, {community_link}.`}
+          </Translate>
+          </div>
+
+         <Row className='mt-5'>
+            {list?.map((item) => {
+              return <Col sm={12} md={6} lg={3} className='mb-4' key={item.name}>
+                <Card style={{ height: '100%' }}>
+                  <Card.Body>
+                    <h5>
+                      <a href={item.link} target='_blank'>{item.name}</a>
+                    </h5>
+                    <div>{item.desc}</div>
+                  </Card.Body>
+                </Card>
+              </Col>
+            })}
+
+         </Row>
+      </Container>
+    </Layout>
+  )
+}