|
| 1 | +--- |
| 2 | +title: Cyber |
| 3 | +description: Shiro 的分支, 以炫酷赛博风为核心开发目标 |
| 4 | +--- |
| 5 | + |
| 6 | +import Image from 'next/image' |
| 7 | + |
| 8 | +<ToGithub repo="At87668/Cyber" description="Cyber — A cyber style theme for Mx Space." /> |
| 9 | +## 概述 |
| 10 | + |
| 11 | +<Callout title= "注意!" type="warn"> |
| 12 | + **Cyber 是 [Shiro](https://github.com/Innei/Shiro) 的社区分支**,请勿向原作者 (Innei) 报告本项目的 Issue。 |
| 13 | + **版本要求**:目前 Cyber **仅支持 Mix Space Core 版本 == 13.x (API v3)**。 |
| 14 | +</Callout> |
| 15 | + |
| 16 | +由 [Shiro](https://github.com/Innei/Shiro) 分支而来,专为 [Mix Space](https://github.com/mx-space) 生态系统设计的现代化个人站点前端。在继承 Shiro 极简主义与极致性能的基础上,适配了最新的 API v3,并融入了更具科技感的视觉风格。 |
| 17 | + |
| 18 | +欢迎体验 Cyber 带来的赛博炫酷! |
| 19 | + |
| 20 | +## 部署指南 |
| 21 | + |
| 22 | +### 前端部署 |
| 23 | + |
| 24 | +#### Vercel 一键部署(推荐) |
| 25 | + |
| 26 | +点击下方按钮即可快速部署,部署时请填写以下环境变量: |
| 27 | + |
| 28 | +[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FAt87668%2FCyber&env=NEXT_PUBLIC_API_URL,NEXT_PUBLIC_GATEWAY_URL,ENABLE_EXPERIMENTAL_COREPACK&envDefaults=%7B%22NEXT_PUBLIC_API_URL%22%3A%22https%3A%2F%2Fexample.com%2Fapi%2Fv3%22%2C%22NEXT_PUBLIC_GATEWAY_URL%22%3A%22https%3A%2F%2Fexample.com%22%2C%22ENABLE_EXPERIMENTAL_COREPACK%22%3A%221%22%7D&envDescription=API%20URL%20needed%20for%20the%20application.&project-name=mxspace-cyber&repository-name=mxspace-cyber) |
| 29 | + |
| 30 | +#### 环境变量说明 |
| 31 | + |
| 32 | +| 变量名 | 必填 | 说明 | |
| 33 | +| :--- | :--- | :--- | |
| 34 | +| `NEXT_PUBLIC_API_URL` | ✅ | Mix Space Core API 地址,必须以 `/api/v3` 结尾 | |
| 35 | +| `NEXT_PUBLIC_GATEWAY_URL` | ✅ | Mix Space Gateway 地址,用于 WebSocket 等功能 | |
| 36 | +| `ENABLE_EXPERIMENTAL_COREPACK` | ❌ | 建议设为 `1`,启用 Corepack 以优化依赖管理 | |
| 37 | + |
| 38 | +#### 从其他方式部署 |
| 39 | + |
| 40 | +参照 [Shiro](https://mx-space.js.org/docs/themes/shiro/deploy) |
| 41 | + |
| 42 | +### 后端配置 |
| 43 | + |
| 44 | +1. 在管理员面板中切换至`代码片段`区 |
| 45 | + |
| 46 | +2. 新建一个项: 名称为`cyber`, 分组为`theme`, 类型为`json` |
| 47 | + |
| 48 | + 填入以下内容并按需修改 |
| 49 | + ```json |
| 50 | +{ |
| 51 | + "footer": { |
| 52 | + "otherInfo": { |
| 53 | + "date": "2020-{{now}}", |
| 54 | + "icp": { |
| 55 | + "text": "萌 ICP 备 20236136 号", |
| 56 | + "link": "https://icp.gov.moe/?keyword=20236136" |
| 57 | + } |
| 58 | + }, |
| 59 | + "linkSections": [ |
| 60 | + { |
| 61 | + "name": "关于", |
| 62 | + "links": [ |
| 63 | + { |
| 64 | + "name": "关于本站", |
| 65 | + "href": "/about-site" |
| 66 | + }, |
| 67 | + { |
| 68 | + "name": "关于我", |
| 69 | + "href": "/about" |
| 70 | + }, |
| 71 | + { |
| 72 | + "name": "关于此项目", |
| 73 | + "href": "https://github.com/innei/Shiro", |
| 74 | + "external": true |
| 75 | + } |
| 76 | + ] |
| 77 | + }, |
| 78 | + { |
| 79 | + "name": "更多", |
| 80 | + "links": [ |
| 81 | + { |
| 82 | + "name": "时间线", |
| 83 | + "href": "/timeline" |
| 84 | + }, |
| 85 | + { |
| 86 | + "name": "友链", |
| 87 | + "href": "/friends" |
| 88 | + }, |
| 89 | + { |
| 90 | + "name": "监控", |
| 91 | + "href": "https://status.innei.in/status/main", |
| 92 | + "external": true |
| 93 | + } |
| 94 | + ] |
| 95 | + }, |
| 96 | + { |
| 97 | + "name": "联系", |
| 98 | + "links": [ |
| 99 | + { |
| 100 | + "name": "写留言", |
| 101 | + "href": "/message" |
| 102 | + }, |
| 103 | + { |
| 104 | + "name": "发邮件", |
| 105 | + "href": "mailto:i@innei.ren", |
| 106 | + "external": true |
| 107 | + }, |
| 108 | + { |
| 109 | + "name": "GitHub", |
| 110 | + "href": "https://github.com/innei", |
| 111 | + "external": true |
| 112 | + } |
| 113 | + ] |
| 114 | + } |
| 115 | + ] |
| 116 | + }, |
| 117 | + "config": { |
| 118 | + "color": { |
| 119 | + "light": [ |
| 120 | + "#33A6B8", |
| 121 | + "#FF6666", |
| 122 | + "#26A69A", |
| 123 | + "#fb7287", |
| 124 | + "#69a6cc", |
| 125 | + "#F11A7B", |
| 126 | + "#78C1F3", |
| 127 | + "#FF6666", |
| 128 | + "#7ACDF6" |
| 129 | + ], |
| 130 | + "dark": [ |
| 131 | + "#F596AA", |
| 132 | + "#A0A7D4", |
| 133 | + "#ff7b7b", |
| 134 | + "#99D8CF", |
| 135 | + "#838BC6", |
| 136 | + "#FFE5AD", |
| 137 | + "#9BE8D8", |
| 138 | + "#A1CCD1", |
| 139 | + "#EAAEBA" |
| 140 | + ] |
| 141 | + }, |
| 142 | + |
| 143 | + "bg": [ |
| 144 | + "/static/images/F0q8mwwaIAEtird.jpeg", |
| 145 | + "/static/images/IMG_2111.jpeg.webp.jpg" |
| 146 | + ], |
| 147 | + "custom": { |
| 148 | + "css": [], |
| 149 | + "styles": [], |
| 150 | + "js": [], |
| 151 | + "scripts": [] |
| 152 | + }, |
| 153 | + "site": { |
| 154 | + "favicon": "/innei.svg", |
| 155 | + "faviconDark": "/innei-dark.svg" |
| 156 | + }, |
| 157 | + "hero": { |
| 158 | + "title": { |
| 159 | + "template": [ |
| 160 | + { |
| 161 | + "type": "h1", |
| 162 | + "text": "Hi, I'm ", |
| 163 | + "class": "font-light text-4xl" |
| 164 | + }, |
| 165 | + { |
| 166 | + "type": "h1", |
| 167 | + "text": "Innei", |
| 168 | + "class": "font-medium mx-2 text-4xl" |
| 169 | + }, |
| 170 | + { |
| 171 | + "type": "h1", |
| 172 | + "text": "👋。", |
| 173 | + "class": "font-light text-4xl" |
| 174 | + }, |
| 175 | + { |
| 176 | + "type": "br" |
| 177 | + }, |
| 178 | + { |
| 179 | + "type": "h1", |
| 180 | + "text": "A NodeJS Full Stack ", |
| 181 | + "class": "font-light text-4xl" |
| 182 | + }, |
| 183 | + { |
| 184 | + "type": "code", |
| 185 | + "text": "<Developer />", |
| 186 | + "class": "font-medium mx-2 text-3xl rounded p-1 bg-gray-200 dark:bg-gray-800/0 hover:dark:bg-gray-800/100 bg-opacity-0 hover:bg-opacity-100 transition-background duration-200" |
| 187 | + }, |
| 188 | + { |
| 189 | + "type": "span", |
| 190 | + "class": "inline-block w-[1px] h-8 -bottom-2 relative bg-gray-800/80 dark:bg-gray-200/80 opacity-0 group-hover:opacity-100 transition-opacity duration-200 group-hover:animation-blink" |
| 191 | + } |
| 192 | + ] |
| 193 | + }, |
| 194 | + "description": "An independent developer coding with love." |
| 195 | + }, |
| 196 | + "module": { |
| 197 | + "activity": { |
| 198 | + "enable": true, |
| 199 | + "endpoint": "/fn/ps/update" |
| 200 | + }, |
| 201 | + "donate": { |
| 202 | + "enable": true, |
| 203 | + "link": "https://afdian.net/@Innei", |
| 204 | + "qrcode": [ |
| 205 | + "/static/images/20191211132347.png", |
| 206 | + "/static/images/0424213144.png" |
| 207 | + ] |
| 208 | + }, |
| 209 | + "bilibili": { |
| 210 | + "liveId": 1434499 |
| 211 | + }, |
| 212 | + "rss": { |
| 213 | + "noRSS": true |
| 214 | + } |
| 215 | + } |
| 216 | + } |
| 217 | +} |
| 218 | + ``` |
| 219 | + |
| 220 | +3. 新建一个项: 名称为`status`, 分组为`cyber`, 类型为`fuction` |
| 221 | + |
| 222 | + 填入以下内容 |
| 223 | + ```typescript |
| 224 | +export default async function handler(ctx: Context) { |
| 225 | + return 'null'; |
| 226 | +} |
| 227 | + ``` |
| 228 | + |
| 229 | +**其他配置信息参见**: [Shiro](https://mx-space.js.org/docs/themes/shiro/config) |
| 230 | + |
| 231 | +## 预览 |
| 232 | + |
| 233 | +<Image |
| 234 | + src="/assets/images/preview/cyber.png" |
| 235 | + alt="Cyber 首页预览" |
| 236 | + width={600} |
| 237 | + height={375} |
| 238 | + className="rounded-lg border" |
| 239 | +/> |
| 240 | + |
| 241 | +### 本地开发 |
| 242 | + |
| 243 | +```bash |
| 244 | +git clone https://github.com/At87668/Cyber.git |
| 245 | +cd Cyber |
| 246 | +pnpm install |
| 247 | +cp .env.template .env.local # 编辑 .env.local 填入上述环境变量 |
| 248 | +pnpm dev |
0 commit comments