feat: Add community discussions page with Giscus integration and update support links.

This commit is contained in:
Haitao Pan 2026-02-01 21:02:21 +08:00
parent c654eb4804
commit ee8c725d8e
5 changed files with 81 additions and 5 deletions

View File

@ -1,3 +1,10 @@
# Moltbot Service URL
# Defaults to https://moltbot.svc.plus if not set
MOLTBOT_SERVICE_URL=https://moltbot.svc.plus
# Giscus Configuration (GitHub Discussions Integration)
# See https://giscus.app to generate these values
NEXT_PUBLIC_GISCUS_REPO=cloud-neutral-toolkit/console.svc.plus
NEXT_PUBLIC_GISCUS_REPO_ID=R_kgDOQoiZ_g
NEXT_PUBLIC_GISCUS_CATEGORY=General
NEXT_PUBLIC_GISCUS_CATEGORY_ID=DIC_kwDOQoiZ_s4Clj_q

View File

@ -0,0 +1,39 @@
"use client";
import React from "react";
import UnifiedNavigation from "../../../components/UnifiedNavigation";
import Footer from "../../../components/Footer";
import Discussions from "../../../components/support/Discussions";
import { useLanguage } from "../../../i18n/LanguageProvider";
export default function DiscussionsPage() {
const { language } = useLanguage();
const isChinese = language === "zh";
return (
<div className="min-h-screen bg-background text-text transition-colors duration-150 flex flex-col">
<UnifiedNavigation />
<main className="flex-1 relative overflow-hidden pt-24 pb-20">
<div className="relative mx-auto max-w-5xl px-6">
<div className="text-center mb-12">
<h1 className="text-3xl font-bold tracking-tight text-heading sm:text-4xl mb-4">
{isChinese ? "社区讨论" : "Community Discussions"}
</h1>
<p className="text-text-muted max-w-2xl mx-auto">
{isChinese
? "欢迎来到 Cloud-Neutral Toolkit 社区!这里是分享想法、提出问题和与其他开发者交流的地方。"
: "Welcome to the Cloud-Neutral Toolkit community! This is the place to share ideas, ask questions, and connect with other developers."}
</p>
</div>
<div className="rounded-2xl border border-surface-border bg-surface p-6 sm:p-8">
<Discussions />
</div>
</div>
</main>
<Footer />
</div>
);
}

View File

@ -32,7 +32,7 @@ export default function SupportPage() {
description: isChinese
? "与其他开发者交流,分享经验和解决问题。"
: "Connect with other developers, share experiences, and solve problems.",
link: "https://github.com/Cloud-Neutral-Toolkit/console.svc.plus/discussions",
link: "https://github.com/orgs/cloud-neutral-toolkit/discussions",
linkText: isChinese ? "加入讨论" : "Join Discussions"
},
{

View File

@ -0,0 +1,30 @@
'use client';
import Giscus from '@giscus/react';
import { useThemeStore } from '../theme';
import { useLanguage } from '../../i18n/LanguageProvider';
export default function Discussions() {
const isDark = useThemeStore((state) => state.isDark);
const { language } = useLanguage();
return (
<div className="w-full">
<Giscus
id="comments"
repo={process.env.NEXT_PUBLIC_GISCUS_REPO as `${string}/${string}`}
repoId={process.env.NEXT_PUBLIC_GISCUS_REPO_ID!}
category={process.env.NEXT_PUBLIC_GISCUS_CATEGORY!}
categoryId={process.env.NEXT_PUBLIC_GISCUS_CATEGORY_ID!}
mapping="pathname"
term="Welcome to console.svc.plus Discussions!"
reactionsEnabled="1"
emitMetadata="0"
inputPosition="top"
theme={isDark ? 'dark' : 'light'}
lang={language === 'zh' ? 'zh-CN' : 'en'}
loading="lazy"
/>
</div>
);
}

View File

@ -1736,11 +1736,11 @@ export const translations: Record<'en' | 'zh', Translation> = {
successTitle: '认证器绑定成功',
successBody: '以后登录时将需要动态验证码,账号更安全。',
guide: {
step1Title: '1 请在手机端下载阿里云 APP 或 Google Authenticator 身份验证器',
step1Title: '1 请在手机端下载 Google Authenticator 身份验证器',
step1Description: '下载并安装验证器应用,准备开始绑定流程。',
step1Ios: '苹果:在 App Store 搜索 “Google Authenticator” 或 “阿里云 身份验证器” 并安装。',
step1Android: '安卓:在应用商店搜索 “Google Authenticator” 或 “阿里云 身份验证器” 并安装。',
step2Title: '2 使用阿里云或 Google Authenticator 身份验证器获取验证码',
step1Ios: '苹果:在 App Store 搜索 “Google Authenticator” 并安装。',
step1Android: '安卓:在应用商店搜索 “Google Authenticator” 并安装。',
step2Title: '2 使用 Google Authenticator 身份验证器获取验证码',
step2Description: '打开验证器扫描下方二维码,如无法扫描可手动输入密钥。',
step3Title: '3 输入验证码完成绑定',
step3Description: '在验证器中查看 6 位验证码并输入完成绑定。',