diff --git a/i18n/en/code.json b/i18n/en/code.json new file mode 100644 index 0000000..31e60a1 --- /dev/null +++ b/i18n/en/code.json @@ -0,0 +1,11 @@ +{ + "helpFeedback.title": { + "message": "Have questions about this doc?" + }, + "helpFeedback.description": { + "message": "Post your question on the GitLink forum, and our community and official team will help you out." + }, + "helpFeedback.forumButton": { + "message": "Ask on Forum" + } +} diff --git a/i18n/zh-CN/code.json b/i18n/zh-CN/code.json index c753757..550d9a8 100644 --- a/i18n/zh-CN/code.json +++ b/i18n/zh-CN/code.json @@ -836,5 +836,14 @@ "theme.unlistedContent.message": { "message": "此页面未列出。搜索引擎不会索引它,只有拥有直链的用户才能访问它。", "description": "The unlisted content banner message" + }, + "helpFeedback.title": { + "message": "对这篇文档有疑问?" + }, + "helpFeedback.description": { + "message": "欢迎到 GitLink 论坛发帖提问,社区成员和官方团队会协助解答。" + }, + "helpFeedback.forumButton": { + "message": "去论坛提问" } } diff --git a/src/components/HelpFeedback/index.jsx b/src/components/HelpFeedback/index.jsx new file mode 100644 index 0000000..06d6338 --- /dev/null +++ b/src/components/HelpFeedback/index.jsx @@ -0,0 +1,36 @@ +import React from 'react'; +import Translate from '@docusaurus/Translate'; +import styles from './index.module.css'; + +const FORUM_URL = 'https://forum.gitlink.org.cn'; + +export default function HelpFeedback() { + return ( +
+
+
+

+ + 对这篇文档有疑问? + +

+

+ + 欢迎到 GitLink 论坛发帖提问,社区成员和官方团队会协助解答。 + +

+
+ + + 去论坛提问 + + +
+
+ ); +} diff --git a/src/components/HelpFeedback/index.module.css b/src/components/HelpFeedback/index.module.css new file mode 100644 index 0000000..0be6343 --- /dev/null +++ b/src/components/HelpFeedback/index.module.css @@ -0,0 +1,79 @@ +.wrapper { + margin: 2rem 0 1rem; +} + +.card { + display: flex; + align-items: center; + justify-content: space-between; + gap: 1.5rem; + padding: 1.25rem 1.5rem; + border: 1px solid #e2e5ea; + border-radius: 8px; + background: #f7f8fa; +} + +html[data-theme='dark'] .card { + background: rgba(255, 255, 255, 0.05); + border-color: rgba(255, 255, 255, 0.1); +} + +.content { + flex: 1; + min-width: 0; +} + +.title { + font-size: 0.95rem; + font-weight: 600; + margin: 0 0 0.25rem; + color: #1b2440; +} + +html[data-theme='dark'] .title { + color: #e3e5e8; +} + +.desc { + font-size: 0.875rem; + margin: 0; + color: #6b7280; + line-height: 1.5; +} + +html[data-theme='dark'] .desc { + color: #9ca3af; +} + +.button { + display: inline-flex; + align-items: center; + flex-shrink: 0; + padding: 0.5rem 1.25rem; + background: #466aff; + color: #fff; + border-radius: 6px; + font-size: 0.875rem; + font-weight: 500; + text-decoration: none; + white-space: nowrap; + transition: background 0.2s; +} + +.button:hover { + background: #3651d9; + color: #fff; + text-decoration: none; +} + +@media (max-width: 640px) { + .card { + flex-direction: column; + align-items: flex-start; + } + + .button { + width: 100%; + justify-content: center; + } +} diff --git a/src/theme/DocItem/Footer/index.js b/src/theme/DocItem/Footer/index.js new file mode 100644 index 0000000..b2f2a56 --- /dev/null +++ b/src/theme/DocItem/Footer/index.js @@ -0,0 +1,12 @@ +import React from 'react'; +import Footer from '@theme-original/DocItem/Footer'; +import HelpFeedback from '@site/src/components/HelpFeedback'; + +export default function FooterWrapper(props) { + return ( + <> +