This is an automated email from the ASF dual-hosted git repository. linkinstar pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/answer-website.git
The following commit(s) were added to refs/heads/main by this push: new ad9fd306c fix: correct typos and update category ad9fd306c is described below commit ad9fd306c4f61d0e82e102a2457fb5e8a4f8e2fc Author: Luffy <5...@qq52o.cn> AuthorDate: Tue May 20 18:14:16 2025 +0800 fix: correct typos and update category --- .../index.md | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/i18n/zh-CN/docusaurus-plugin-content-blog/why-the-answer-plugin-system-was-designed-this-way/index.md b/i18n/zh-CN/docusaurus-plugin-content-blog/why-the-answer-plugin-system-was-designed-this-way/index.md index 29d44c770..f8fc9cde2 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-blog/why-the-answer-plugin-system-was-designed-this-way/index.md +++ b/i18n/zh-CN/docusaurus-plugin-content-blog/why-the-answer-plugin-system-was-designed-this-way/index.md @@ -2,18 +2,18 @@ date: 2023-07-22 title: The Packaging Process for Answer Plugins authors: [LinkinStar] -category: Tech +category: Tutorials featured: true image: 2023-07-22-co...@4x.png description: "Let's discuss the design and implementation of the plugin system for Answer, and know why we design this way." --- -> 1. Why is Answer's plugin system designed in such a way that it seems a bit of difficulty to use? +> 1. Why is Answer's plugin system designed in such a way that it seems a bit difficult to use? > 2. How can I implement plugin functionality using Golang? > 3. What exactly does Answer's plugin system do when it is compiled and > packaged? ## Background -You can build a Q&A community using answer easily. However, the basic features of Answer may not sufficiently support to every use case. +You can build a Q&A community using Answer easily. However, the basic features of Answer may not sufficiently support to every use case. Therefore, we need to design a plugin system to extend its features. As you may know, Answer is built using `React.js` and `Golang`. Both these languages require compilation. So designing a plugin system is a bit difficult. @@ -21,12 +21,12 @@ As you may know, Answer is built using `React.js` and `Golang`. Both these langu The goal of Answer's plugin system is to provide a **flexible** and **extendable** architecture that can accommodate a wide range of use cases. Some of the key features of the plugin system include: ### Connectors -By default, Answer supports login via email and password. Withing the plugin system, developers can easily integrate other authentication, such as GitHub. +By default, Answer supports login via email and password. Within the plugin system, developers can easily integrate other authentication, such as GitHub. <img src={require('./answer-plugin-connector.png').default} alt="install-choose-language" width="400"/> ### Storage -Out of the box, Answer stores files in the local file system. However, there could be scenarios where users might prefer to save their uploaded files to a cloud storage service like `S3`. This can be achieved by plugin system. +Out of the box, Answer stores files in the local file system. However, there could be scenarios where users might prefer to save their uploaded files to a cloud storage service like `S3`. This can be achieved by the plugin system. <img src={require('./answer-plugin-storage.png').default} alt="install-choose-language" width="400"/> @@ -58,18 +58,18 @@ Here are the reasons behind our design choices: > This is the main reason why the plugin system is designed this way. `React.js` and `Golang` both these languages require compilation. They are not dynamically executable like some other scripting languages. -So the plugin system should be static compilation, which means that the application and plugins are compiled together, resulting in a single binary that can be easily distributed and deployed. +So the plugin system should be a static compilation, which means that the application and plugins are compiled together, resulting in a single binary that can be easily distributed and deployed. #### Fixed Functionality The plugin system allows users to add features that are fixed for their specific use cases without changing the core system. Furthermore, these functionalities persistently remain operational once they are employed. Therefore, it is sufficient to deliberate on the necessities of their incorporation at the initial stage, and subsequently, package them accordingly. -In the future, we can build a Docker image that contains all officially plugins, thereby enabling users to access the entire range of features. The enablement or disablement of these functionalities can be managed through the plugin control interface. +In the future, we can build a Docker image that contains all official plugins, thereby enabling users to access the entire range of features. The enablement or disablement of these functionalities can be managed through the plugin control interface. #### Extension -The most important capability of a plugin system is actually its extensibility. -It is impossible for a program to provide all the functions that every user wants. -However, with a plugin system, users can develop their own plugins to help them achieve the functions that they want. +The most important capability of a plugin system is its extensibility. +A program can't provide all the functions that every user wants. +However, with a plugin system, users can develop their plugins to help them achieve the functions that they want. ## Reference The Caddy is a great open-source software that inspired the design of the Answer plugin system. @@ -78,6 +78,6 @@ Using [xcaddy](https://github.com/caddyserver/xcaddy/) can easy to make custom b ## More In this blog post, we discussed the design and implementation of the plugin system for Answer, a popular open-source Q&A platform. -We discussed the motivation behind the design, the features and principles of the plugin system, and provided a step-by-step guide on implementation. +We discussed the motivation behind the design, and the features and principles of the plugin system, and provided a step-by-step guide on implementation. If you are interested in developing plugins for Answer, please feel free to leave us a comment. -We will also write an article on how to implement an Answer plugin from scratch, so stay focus! \ No newline at end of file +We will also write an article on how to implement an Answer plugin from scratch, so stay focused!