签入版本

This commit is contained in:
2026-09-12 23:12:15 +08:00
commit 91998056ca
1841 changed files with 341325 additions and 0 deletions
@@ -0,0 +1,51 @@
// import type { DefaultTheme, LocaleSpecificConfig } from "vitepress";
// export const META_URL = "https://www.djangoadmin.cn";
// export const META_TITLE = "DjangoAdmin";
// export const META_DESCRIPTION = "Enterprise Admin Framework";
// export const enConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
// description: META_DESCRIPTION,
// head: [
// ["meta", { property: "og:url", content: META_URL }],
// ["meta", { property: "og:description", content: META_DESCRIPTION }],
// ["meta", { property: "twitter:url", content: META_URL }],
// ["meta", { property: "twitter:title", content: META_TITLE }],
// ["meta", { property: "twitter:description", content: META_DESCRIPTION }],
// [
// "script",
// {},
// `
// var _hmt = _hmt || [];
// (function() {
// var hm = document.createElement("script");
// hm.src = "https://hm.baidu.com/hm.js?f2662051bbed33ef4673edf8bfe609fe";
// var s = document.getElementsByTagName("script")[0];
// s.parentNode.insertBefore(hm, s);
// })();
// `,
// ],
// ],
//
// themeConfig: {
// editLink: {
// pattern: "https://gitee.com/djangoadmin/DjangoAdmin_Fastapi_EleVue",
// text: "Suggest changes to this page",
// },
//
// nav: [
// { text: "Guide", link: "/en/introduction.html" },
// ],
//
// sidebar: {
// "/en/": [
// {
// text: "Introduction",
// items: [
// { text: "About", link: "/en/introduction.html" },
// ],
// },
// ],
// },
// },
// };
@@ -0,0 +1,39 @@
import { defineConfig } from "vitepress";
import { enConfig } from "./en";
import { sharedConfig } from "./shared";
import { zhConfig } from "./zh";
export default defineConfig({
...sharedConfig,
locales: {
root: { label: "简体中文", lang: "zh-CN", link: "/", ...zhConfig },
// root: { label: "English", lang: "en-US", link: "/", ...enConfig },
// zh: { label: "简体中文", lang: "zh-CN", link: "/zh/", ...zhConfig },
// es: {
// label: "Español",
// lang: "es-ES",
// link: "https://es-pinia.vercel.app/",
// },
// ko: {
// label: "한국어",
// lang: "ko-KR",
// link: "https://pinia.vuejs.kr/",
// },
// pt: {
// label: "Português",
// lang: "pt-PT",
// link: "https://pinia-docs-pt.netlify.app/",
// },
// uk: {
// label: "Українська",
// lang: "uk-UA",
// link: "https://pinia-ua.netlify.app",
// },
// ru: {
// label: "Русский",
// lang: "ru-RU",
// link: "https://pinia-ru.netlify.app",
// },
},
});
@@ -0,0 +1,844 @@
import type { DefaultTheme, LocaleSpecificConfig } from "vitepress";
export const META_URL = "https://www.djangoadmin.cn";
export const META_TITLE = "企业级中台解决方案";
export const META_DESCRIPTION = "企业级中台解决方案";
export const zhConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
description: META_DESCRIPTION,
head: [
["meta", { property: "og:url", content: META_URL }],
["meta", { property: "og:description", content: META_DESCRIPTION }],
["meta", { property: "twitter:url", content: META_URL }],
["meta", { property: "twitter:title", content: META_TITLE }],
["meta", { property: "twitter:description", content: META_DESCRIPTION }],
[
"script",
{},
`
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?f2662051bbed33ef4673edf8bfe609fe";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
`,
],
],
themeConfig: {
editLink: {
pattern: "https://gitee.com/djangoadmin/DjangoAdmin_Fastapi_EleVue",
text: "对本页提出修改建议",
},
outline: {
label: "本页内容",
},
docFooter: {
prev: "上一页",
next: "下一页",
},
nav: [
{ text: "官网", link: "https://www.djangoadmin.cn" },
{ text: "授权", link: "https://www.djangoadmin.cn/goods/detail/2" },
{
text: "部署文档",
items: [
{
text: "DjangoAdmin混编版Django+Layui版本",
link: "http://docs.django.layui.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离Django+ElementPlus版本",
link: "http://docs.django.elevue.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离Django+AntDesign版本",
link: "http://docs.django.antdvue.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离Django+NaiveUI版本",
link: "http://docs.django.naivevue.djangoadmin.cn",
},
{
text: "DjangoAdmin混编版Flask+Layui版本",
link: "http://docs.flask.layui.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离Flask+ElementPlus版本",
link: "http://docs.flask.elevue.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离Flask+AntDesign版本",
link: "http://docs.flask.antdvue.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离Flask+NaiveUI版本",
link: "http://docs.flask.naivevue.djangoadmin.cn",
},
{
text: "DjangoAdmin混编版FastAPI+Layui版本",
link: "http://docs.fastapi.layui.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离FastAPI+ElementPlus版本",
link: "http://docs.fastapi.elevue.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离FastAPI+AntDesign版本",
link: "http://docs.fastapi.antdvue.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离FastAPI+NaiveUI版本",
link: "http://docs.fastapi.naivevue.djangoadmin.cn",
},
{
text: "DjangoAdmin混编版Tornado+Layui版本",
link: "http://docs.tornado.layui.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离Tornado+ElementPlus版本",
link: "http://docs.tornado.elevue.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离Tornado+AntDesign版本",
link: "http://docs.tornado.antdvue.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离Tornado+NaiveUI版本",
link: "http://docs.tornado.naivevue.djangoadmin.cn",
},
],
},
{
text: "在线演示",
items: [
{
text: "DjangoAdmin混编版Django+Layui版本",
link: "http://manage.django.layui.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离Django+ElementPlus版本",
link: "http://manage.django.elevue.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离Django+AntDesign版本",
link: "http://manage.django.antdvue.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离Django+NaiveUI版本",
link: "http://manage.django.naivevue.djangoadmin.cn",
},
{
text: "DjangoAdmin混编版Flask+Layui版本",
link: "http://manage.flask.layui.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离Flask+ElementPlus版本",
link: "http://manage.flask.elevue.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离Flask+AntDesign版本",
link: "http://manage.flask.antdvue.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离Flask+NaiveUI版本",
link: "http://manage.flask.naivevue.djangoadmin.cn",
},
{
text: "DjangoAdmin混编版FastAPI+Layui版本",
link: "http://manage.fastapi.layui.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离FastAPI+ElementPlus版本",
link: "http://manage.fastapi.elevue.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离FastAPI+AntDesign版本",
link: "http://manage.fastapi.antdvue.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离FastAPI+NaiveUI版本",
link: "http://manage.fastapi.naivevue.djangoadmin.cn",
},
{
text: "DjangoAdmin混编版Tornado+Layui版本",
link: "http://manage.tornado.layui.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离Tornado+ElementPlus版本",
link: "http://manage.tornado.elevue.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离Tornado+AntDesign版本",
link: "http://manage.tornado.antdvue.djangoadmin.cn",
},
{
text: "DjangoAdmin前后端分离Tornado+NaiveUI版本",
link: "http://manage.tornado.naivevue.djangoadmin.cn",
},
],
},
{
text: "广告赞助",
link: "/zh/other/sponsor.html",
},
{
text: "相关链接",
items: [
{
text: "官方网站",
link: "https://www.djangoadmin.cn",
},
{
text: "Gitee 仓库",
link: "https://gitee.com/djangoadmin",
},
{
text: "FastAPI 文档",
link: "https://fastapi.tiangolo.com/zh/",
},
{
text: "Vue3 文档",
link: "https://cn.vuejs.org/",
},
{
text: "ElementPlus",
link: "https://element-plus.org/zh-CN/",
},
],
},
],
sidebar: {
"/zh/": [
// ================================================================
// 第 1 章:了解项目
// ================================================================
{
text: "📖 1. 了解项目",
collapsed: false,
items: [
{ text: "1.1 项目介绍", link: "/zh/introduction.html" },
{ text: "1.2 为什么选择我们?", link: "/zh/why.html" },
{ text: "1.3 项目目录结构", link: "/zh/struct.html" },
{ text: "1.4 新手入门指南", link: "/zh/course.html" },
{ text: "1.5 更新日志", link: "/zh/changelog.html" },
],
},
// ================================================================
// 第 2 章:快速入门
// ================================================================
{
text: "🚀 2. 快速入门",
collapsed: false,
items: [
{ text: "2.1 开发环境准备", link: "/zh/volume1/environment.html" },
{ text: "2.2 后端服务启动", link: "/zh/volume1/backend.html" },
{ text: "2.3 前端服务启动", link: "/zh/volume1/frontend.html" },
{ text: "2.4 数据库初始化", link: "/zh/volume1/database.html" },
{ text: "2.5 Docker 快速部署", link: "/zh/volume1/docker.html" },
{ text: "2.6 环境变量配置参考", link: "/zh/volume1/env-vars.html" },
{ text: "2.7 第一个接口调试", link: "/zh/volume1/first-api.html" },
{ text: "2.8 常见问题 FAQ", link: "/zh/volume1/faq.html" },
],
},
// ================================================================
// 第 3 章:模块开发实战(独立成章,新人快速上手)
// ================================================================
{
text: "🧪 3. 模块开发实战",
collapsed: false,
items: [
{ text: "3.1 概述与目标", link: "/zh/volume2/overview.html" },
{ text: "3.2 数据模型定义", link: "/zh/volume2/model.html" },
{
text: "3.3 参数验证(Pydantic Schema)",
link: "/zh/volume2/schema.html",
},
{
text: "3.4 数据访问层(Repository)",
link: "/zh/volume2/repository.html",
},
{
text: "3.5 业务逻辑层(Service)",
link: "/zh/volume2/service.html",
},
{
text: "3.6 端点层(Endpoint)",
link: "/zh/volume2/endpoint.html",
},
{ text: "3.7 路由注册", link: "/zh/volume2/router.html" },
{ text: "3.8 权限节点配置", link: "/zh/volume2/permission.html" },
{ text: "3.9 前端 API 层开发", link: "/zh/volume2/fe-api.html" },
{ text: "3.10 前端页面视图开发", link: "/zh/volume2/fe-view.html" },
{
text: "3.11 前端路由与菜单配置",
link: "/zh/volume2/fe-router.html",
},
{ text: "3.12 完整代码清单", link: "/zh/volume2/code-list.html" },
{ text: "3.13 常见问题与排错", link: "/zh/volume2/faq.html" },
],
},
// ================================================================
// 第 4 章:架构设计
// ================================================================
{
text: "🏛️ 4. 架构设计",
collapsed: false,
items: [
{ text: "4.1 整体架构概览", link: "/zh/volume3/overview.html" },
{ text: "4.2 技术选型与决策", link: "/zh/volume3/tech-stack.html" },
{ text: "4.3 请求处理链路", link: "/zh/volume3/request-flow.html" },
{ text: "4.4 分层架构详解", link: "/zh/volume3/layer-arch.html" },
{ text: "4.5 目录结构设计", link: "/zh/volume3/directory.html" },
{ text: "4.6 核心基类体系", link: "/zh/volume3/base-classes.html" },
{
text: "4.7 同步与异步编程模型",
link: "/zh/volume3/sync-async.html",
},
{ text: "4.8 缓存架构设计", link: "/zh/volume3/cache.html" },
{
text: "4.9 数据库设计",
link: "/zh/volume3/database-design.html",
},
{ text: "4.10 安全架构设计", link: "/zh/volume3/security.html" },
{ text: "4.11 扩展性设计", link: "/zh/volume3/extensibility.html" },
],
},
// ================================================================
// 第 5 章:开发指南
// ================================================================
{
text: "🛠️ 5. 开发指南",
collapsed: false,
items: [
// ------------------------------------------------------------
// 5.1 后端核心功能(按类别分组)
// ------------------------------------------------------------
{
text: "5.1 后端核心功能",
collapsed: false,
items: [
// 🔐 认证与安全
{
text: "🔐 认证与安全",
collapsed: false,
items: [
{
text: "5.1.1 用户认证(JWT)",
link: "/zh/volume4/core/jwt.html",
},
{
text: "5.1.2 认证流程实战",
link: "/zh/volume4/core/auth-flow.html",
},
{
text: "5.1.3 验证码机制",
link: "/zh/volume4/core/captcha.html",
},
{
text: "5.1.4 权限管理(RBAC)",
link: "/zh/volume4/core/rbac.html",
},
{
text: "5.1.5 跨域资源共享(CORS)",
link: "/zh/volume4/core/cors.html",
},
{
text: "5.1.6 演示模式",
link: "/zh/volume4/core/demo-mode.html",
},
],
},
// 📊 数据与配置
{
text: "📊 数据与配置",
collapsed: false,
items: [
{
text: "5.1.7 字典模块",
link: "/zh/volume4/core/dict.html",
},
{
text: "5.1.8 字典配置与使用",
link: "/zh/volume4/core/dict-guide.html",
},
{
text: "5.1.9 系统配置管理",
link: "/zh/volume4/core/config.html",
},
{
text: "5.1.10 参数验证(Pydantic)",
link: "/zh/volume4/core/validator.html",
},
],
},
// 📝 日志与监控
{
text: "📝 日志与监控",
collapsed: false,
items: [
{
text: "5.1.11 操作日志",
link: "/zh/volume4/core/operation-log.html",
},
{
text: "5.1.12 登录日志",
link: "/zh/volume4/core/login-log.html",
},
{
text: "5.1.13 异常与响应处理",
link: "/zh/volume4/core/exception.html",
},
],
},
// 🛡️ 防护与治理
{
text: "🛡️ 防护与治理",
collapsed: false,
items: [
{
text: "5.1.14 请求限流",
link: "/zh/volume4/core/rate-limit.html",
},
{
text: "5.1.15 防重复提交",
link: "/zh/volume4/core/idempotent.html",
},
],
},
],
},
// ------------------------------------------------------------
// 5.2 后端业务模块(功能索引,不重复 CRUD 细节)
// ------------------------------------------------------------
{
text: "5.2 后端业务模块",
collapsed: false,
items: [
{
text: "5.2.1 用户管理",
link: "/zh/volume4/business/user.html",
},
{
text: "5.2.2 角色管理",
link: "/zh/volume4/business/role.html",
},
{
text: "5.2.3 菜单管理",
link: "/zh/volume4/business/menu.html",
},
{
text: "5.2.4 部门/职级/岗位管理",
link: "/zh/volume4/business/dept.html",
},
{
text: "5.2.5 文章管理",
link: "/zh/volume4/business/article.html",
},
{
text: "5.2.6 公告与链接管理",
link: "/zh/volume4/business/content.html",
},
{
text: "5.2.7 行政区划管理",
link: "/zh/volume4/business/city.html",
},
{
text: "5.2.8 分类管理",
link: "/zh/volume4/business/category.html",
},
{
text: "5.2.9 定时任务",
link: "/zh/volume4/business/job.html",
},
{
text: "5.2.10 参数管理",
link: "/zh/volume4/business/param.html",
},
],
},
// ------------------------------------------------------------
// 5.3 后端通用工具(按类别分组)
// ------------------------------------------------------------
{
text: "5.3 后端通用工具",
collapsed: false,
items: [
// 📁 文件处理
{
text: "📁 文件处理",
collapsed: false,
items: [
{
text: "5.3.1 文件上传模块",
link: "/zh/volume4/tools/upload.html",
},
{
text: "5.3.2 上传配置与使用",
link: "/zh/volume4/tools/upload-guide.html",
},
{
text: "5.3.3 数据导入导出(Excel)",
link: "/zh/volume4/tools/excel.html",
},
],
},
// 🔧 核心工具
{
text: "🔧 核心工具",
collapsed: false,
items: [
{
text: "5.3.4 数据库会话管理",
link: "/zh/volume4/tools/db-session.html",
},
{
text: "5.3.5 请求参数解析",
link: "/zh/volume4/tools/request-util.html",
},
{
text: "5.3.6 密码加密与验证",
link: "/zh/volume4/tools/password.html",
},
{
text: "5.3.7 日志系统",
link: "/zh/volume4/tools/logger.html",
},
],
},
// 🧩 辅助工具
{
text: "🧩 辅助工具",
collapsed: false,
items: [
{
text: "5.3.8 富文本过滤",
link: "/zh/volume4/tools/rich-text.html",
},
{
text: "5.3.9 IP/UA 解析",
link: "/zh/volume4/tools/ip-ua.html",
},
{
text: "5.3.10 权限缓存",
link: "/zh/volume4/tools/perm-cache.html",
},
],
},
],
},
// ------------------------------------------------------------
// 5.4 前端开发(合并部分子项)
// ------------------------------------------------------------
{
text: "5.4 前端开发",
collapsed: false,
items: [
{
text: "5.4.1 环境搭建与快速上手",
link: "/zh/volume4/frontend/setup.html",
},
{
text: "5.4.2 API 层开发",
link: "/zh/volume4/frontend/api.html",
},
{
text: "5.4.3 页面视图开发",
link: "/zh/volume4/frontend/view.html",
},
{
text: "5.4.4 数据表格组件",
link: "/zh/volume4/frontend/table.html",
},
{
text: "5.4.5 表单组件",
link: "/zh/volume4/frontend/form.html",
},
{
text: "5.4.6 弹窗组件",
link: "/zh/volume4/frontend/modal.html",
},
{
text: "5.4.7 权限指令 v-perm",
link: "/zh/volume4/frontend/perm-directive.html",
},
{
text: "5.4.8 路由与菜单",
link: "/zh/volume4/frontend/router.html",
},
{
text: "5.4.9 状态管理(Store)",
link: "/zh/volume4/frontend/store.html",
},
{
text: "5.4.10 公共组件库",
link: "/zh/volume4/frontend/components.html",
},
{
text: "5.4.11 组合式函数(Hooks)",
link: "/zh/volume4/frontend/hooks.html",
},
{
text: "5.4.12 工具函数",
link: "/zh/volume4/frontend/utils.html",
},
{
text: "5.4.13 样式与主题",
link: "/zh/volume4/frontend/style.html",
},
{
text: "5.4.14 国际化(i18n)",
link: "/zh/volume4/frontend/i18n.html",
},
{
text: "5.4.15 前端构建",
link: "/zh/volume4/frontend/build.html",
},
],
},
// ------------------------------------------------------------
// 5.5 前后端联调
// ------------------------------------------------------------
{
text: "5.5 前后端联调",
collapsed: false,
items: [
{
text: "5.5.1 接口响应规范",
link: "/zh/volume4/integration/api-contract.html",
},
{
text: "5.5.2 代理配置",
link: "/zh/volume4/integration/proxy.html",
},
{
text: "5.5.3 权限节点联动",
link: "/zh/volume4/integration/perm-sync.html",
},
{
text: "5.5.4 文件上传联调",
link: "/zh/volume4/integration/upload-sync.html",
},
{
text: "5.5.5 字典数据联调",
link: "/zh/volume4/integration/dict-sync.html",
},
],
},
// ------------------------------------------------------------
// 5.6 API 接口速查表
// ------------------------------------------------------------
{
text: "5.6 API 接口速查表",
link: "/zh/volume4/api-cheatsheet.html",
},
],
},
// ================================================================
// 第 6 章:代码生成器(✨ 亮点独立成章)
// ================================================================
{
text: "🔧 6. 代码生成器",
collapsed: false,
items: [
{ text: "6.1 概述与架构", link: "/zh/volume5/overview.html" },
{ text: "6.2 CLI 命令行使用", link: "/zh/volume5/cli.html" },
{ text: "6.3 Web 管理界面", link: "/zh/volume5/web-ui.html" },
{ text: "6.4 表结构解析引擎", link: "/zh/volume5/parser.html" },
{ text: "6.5 代码生成引擎", link: "/zh/volume5/code-engine.html" },
{ text: "6.6 自定义模板开发", link: "/zh/volume5/templates.html" },
{ text: "6.7 配置文件详解", link: "/zh/volume5/config.html" },
{ text: "6.8 实战案例", link: "/zh/volume5/demo.html" },
{ text: "6.9 常见问题", link: "/zh/volume5/faq.html" },
],
},
// ================================================================
// 第 7 章:运维部署(Checklist 前置)
// ================================================================
{
text: "⚙️ 7. 运维部署",
collapsed: false,
items: [
{
text: "7.1 部署 Checklist",
link: "/zh/volume6/deploy-checklist.html",
},
{ text: "7.2 环境规划", link: "/zh/volume6/env-plan.html" },
{ text: "7.3 数据库迁移", link: "/zh/volume6/db-migrate.html" },
{ text: "7.4 Docker 容器化", link: "/zh/volume6/docker.html" },
{ text: "7.5 Nginx 反向代理", link: "/zh/volume6/nginx.html" },
{
text: "7.6 Supervisor 进程管理",
link: "/zh/volume6/supervisor.html",
},
{ text: "7.7 健康检查与监控", link: "/zh/volume6/monitoring.html" },
{
text: "7.8 性能调优与基线",
link: "/zh/volume6/performance.html",
},
{
text: "7.9 安全加固清单",
link: "/zh/volume6/security-hardening.html",
},
{ text: "7.10 备份与恢复", link: "/zh/volume6/backup.html" },
{ text: "7.11 版本升级与回滚", link: "/zh/volume6/upgrade.html" },
{
text: "7.12 故障排查手册",
link: "/zh/volume6/troubleshooting.html",
},
],
},
// ================================================================
// 第 8 章:规范标准(加标签/分组)
// ================================================================
{
text: "📋 8. 规范标准",
collapsed: false,
items: [
// ⭐ 必须遵守
{
text: "⭐ 必须遵守",
collapsed: false,
items: [
{
text: "8.1 API 响应规范",
link: "/zh/volume7/api-response.html",
},
{
text: "8.2 分页查询规范",
link: "/zh/volume7/pagination.html",
},
{ text: "8.3 Git 提交规范", link: "/zh/volume7/git.html" },
],
},
// 📌 建议遵守
{
text: "📌 建议遵守",
collapsed: false,
items: [
{ text: "8.4 数据删除规范", link: "/zh/volume7/deletion.html" },
{
text: "8.5 Repository 层规范",
link: "/zh/volume7/repository.html",
},
{
text: "8.6 Service 层规范",
link: "/zh/volume7/service.html",
},
{
text: "8.7 Endpoint 层规范",
link: "/zh/volume7/endpoint.html",
},
{
text: "8.8 Pydantic Schema 规范",
link: "/zh/volume7/pydantic.html",
},
{
text: "8.9 前端组件规范",
link: "/zh/volume7/fe-component.html",
},
{
text: "8.10 前端 API 模块规范",
link: "/zh/volume7/fe-api.html",
},
],
},
// 📖 参考即可
{
text: "📖 参考即可",
collapsed: false,
items: [
{ text: "8.11 测试规范", link: "/zh/volume7/testing.html" },
{
text: "8.12 代码审查清单",
link: "/zh/volume7/code-review.html",
},
{
text: "8.13 文档规范",
link: "/zh/volume7/doc-standard.html",
},
],
},
],
},
// ============================================
// 其他
// ============================================
{
text: "📄 9. 其他",
collapsed: false,
items: [
{ text: "9.1 常见问题汇总", link: "/zh/faq.html" },
{ text: "9.2 免责声明", link: "/zh/other/declare.html" },
{
text: "9.3 开源协议",
link: "https://gitee.com/djangoadmin/DjangoAdmin_Fastapi_EleVue/blob/master/LICENSE",
},
{ text: "9.4 广告赞助", link: "/zh/other/sponsor.html" },
],
},
],
},
},
};
export const zhSearch: DefaultTheme.AlgoliaSearchOptions["locales"] = {
zh: {
placeholder: "搜索文档",
translations: {
button: {
buttonText: "搜索文档",
buttonAriaLabel: "搜索文档",
},
modal: {
searchBox: {
resetButtonTitle: "清除查询条件",
resetButtonAriaLabel: "清除查询条件",
cancelButtonText: "取消",
cancelButtonAriaLabel: "取消",
},
startScreen: {
recentSearchesTitle: "搜索历史",
noRecentSearchesText: "没有搜索历史",
saveRecentSearchButtonTitle: "保存至搜索历史",
removeRecentSearchButtonTitle: "从搜索历史中移除",
favoriteSearchesTitle: "收藏",
removeFavoriteSearchButtonTitle: "从收藏中移除",
},
errorScreen: {
titleText: "无法获取结果",
helpText: "你可能需要检查你的网络连接",
},
footer: {
selectText: "选择",
navigateText: "切换",
closeText: "关闭",
searchByText: "搜索供应商",
},
noResultsScreen: {
noResultsText: "无法找到相关结果",
suggestedQueryText: "你可以尝试查询",
reportMissingResultsText: "你认为该查询应该有结果?",
reportMissingResultsLinkText: "点击反馈",
},
},
},
},
};
@@ -0,0 +1,151 @@
<script setup lang="ts">
import { computed } from "vue";
import { VPDocAsideSponsors } from "vitepress/theme";
import sponsors from "./sponsors.json";
// to avoid the never[] type in json
interface Sponsor {
alt: string;
href: string;
imgSrcDark: string;
imgSrcLight: string;
}
const asideSponsors = computed(() => {
return [
{
size: "mini",
items: sponsors.platinum.length
? sponsors.platinum.map((sponsor: Sponsor) => ({
name: sponsor.alt,
url: sponsor.href,
img: sponsor.imgSrcLight,
}))
: [
{
name: "Become a sponsor",
url: "https://www.djangoadmin.cn",
img: "/sponsor/djangoadmin.png",
},
],
},
{
size: "xmini",
// TODO: use gold instead once I have some
items: sponsors.silver.map((sponsor: Sponsor) => ({
name: sponsor.alt,
url: sponsor.href,
img: sponsor.imgSrcLight,
})),
},
];
});
</script>
<template>
<VPDocAsideSponsors :data="asideSponsors" />
<a class="banner mp" href="https://www.djangoadmin.cn" target="_blank">
<img width="22" height="22" src="/sponsor/djangoadmin.png" />
<span>
<p class="extra-info">赋能开发者</p>
<p class="heading">企业级中台解决方案</p>
<p class="extra-info">助力企业发展</p>
</span>
</a>
<a class="banner cert" href="https://www.djangoadmin.cn" target="_blank">
<img width="22" height="22" src="/sponsor/djangoadmin.png" />
<span>
<p class="extra-info">赋能开发者</p>
<p class="heading">企业级中台解决方案</p>
<p class="extra-info">助力企业发展</p>
</span>
</a>
</template>
<style scoped>
.VPDocAsideSponsors {
margin-top: 8px !important;
}
:deep(.vp-sponsor-grid.mini .vp-sponsor-grid-image) {
max-width: 158px;
max-height: 48px;
}
:deep(.vp-sponsor-grid.xmini .vp-sponsor-grid-image) {
max-width: 80px;
max-height: 32px;
}
.banner {
margin: 0.25rem 0;
padding: 0.4rem 0;
border-radius: 14px;
position: relative;
font-size: 0.9rem;
font-weight: 700;
line-height: 1.1rem;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
gap: 1rem;
background-color: var(--vp-c-bg-alt);
border: 2px solid var(--vp-c-bg-alt);
transition: border-color 0.5s;
}
.banner:last-of-type {
margin-bottom: 1rem;
}
.banner:hover {
border: 2px solid var(--vp-c-brand-1);
}
.banner.cert:hover {
border: 2px solid var(--vp-c-green-1);
}
.banner img {
transition: transform 0.5s;
transform: scale(1.25);
}
.banner:hover img {
transform: scale(1.75);
}
.banner .extra-info {
color: var(--vp-c-text-1);
opacity: 0;
font-size: 0.7rem;
padding-left: 0.1rem;
transition: opacity 0.5s;
}
.banner .heading {
background-image: linear-gradient(
120deg,
var(--vp-c-brand-3) 16%,
var(--vp-c-brand-2),
var(--vp-c-brand-1)
);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.banner.cert .heading {
background-image: linear-gradient(
120deg,
var(--vp-c-green-3) 16%,
var(--vp-c-green-2),
var(--vp-c-green-1)
);
}
.banner:hover .extra-info {
opacity: 0.9;
}
</style>
@@ -0,0 +1,59 @@
<script setup lang="ts">
import HomeSponsorsGroup from "./HomeSponsorsGroup.vue";
import sponsors from "./sponsors.json";
import { useData } from "vitepress";
const { site } = useData();
const translations = {
en: "Become a sponsor",
"en-US": "Become a Sponsor!",
"zh-CN": "成为赞助商!",
};
</script>
<template>
<div class="sponsors_outer">
<div>
<HomeSponsorsGroup
v-if="sponsors.platinum.length"
name="Platinum"
size="96"
/>
<HomeSponsorsGroup
v-if="sponsors.bronze.length"
name="Bronze"
size="38"
/>
<HomeSponsorsGroup
v-if="sponsors.silver.length"
name="Silver"
size="24"
/>
<div class="cta">
<a
class="become-sponsor"
href="/zh/other/sponsor.html"
target="_self"
>{{ translations[site.lang] || translations.en }}</a
>
</div>
</div>
</div>
</template>
<style scoped>
.sponsors_outer {
text-align: center;
padding: 35px 40px 45px;
background-color: var(--vp-c-bg-accent);
/* transition when toggling dark mode */
transition: background-color 300ms ease-in-out, color 300ms ease-in-out;
}
.cta {
margin-top: 2rem;
}
</style>
@@ -0,0 +1,122 @@
<template>
<h3>{{ getNameText() }} 赞助商</h3>
<p>
<a
v-for="sponsor in list"
:key="sponsor.href"
:href="sponsor.href"
:title="sponsor.alt"
target="_blank"
rel="sponsored noopener"
class="sponsor_wrapper"
:class="
isDark && sponsor.imgSrcLight === sponsor.imgSrcDark && 'apply-bg'
"
>
<img
:src="sponsor.imgSrc"
:class="
isDark &&
sponsor.imgSrcLight === sponsor.imgSrcDark &&
'invert-colors'
"
:alt="sponsor.alt"
:style="{ height: size + 'px' }"
/>
</a>
</p>
</template>
<script setup lang="ts">
import sponsors from "./sponsors.json";
import { computed } from "vue";
import { useData } from "vitepress";
const props = withDefaults(
defineProps<{
name: "Gold" | "Platinum" | "Silver" | "Bronze";
size?: number | string;
}>(),
{
size: 140,
}
);
/**
* 获取赞助商等级
*/
const getNameText = () => {
switch (props.name) {
case "Gold":
return "黄金";
break;
case "Platinum":
return "铂金";
break;
case "Silver":
return "白金";
break;
case "Bronze":
return "青铜";
break;
default:
return "白金";
break;
}
};
const { isDark } = useData();
const list = computed(() =>
sponsors[props.name.toLowerCase()].map((sponsor) => ({
...sponsor,
imgSrc: isDark.value ? sponsor.imgSrcDark : sponsor.imgSrcLight,
}))
);
</script>
<style scoped>
.sponsor_wrapper {
padding: 5px;
margin: 0 3px;
border-radius: 5px;
display: inline-block;
text-decoration: none;
vertical-align: middle;
transition: background-color 300ms ease-in-out;
}
p {
margin: 0;
}
h3 {
font-size: 1.35rem;
font-weight: 600;
margin: 0.75em 0;
}
img {
transition: all 0.3s ease;
filter: grayscale(100%);
opacity: 0.66;
}
html:not(.light) img.invert-colors {
filter: invert(1) grayscale(100%);
background-color: transparent;
}
.sponsor_wrapper.apply-bg:hover {
background-color: var(--c-text);
}
.sponsor_wrapper:hover img {
filter: none !important;
opacity: 1;
}
</style>
@@ -0,0 +1,176 @@
<script setup lang="ts">
import { useData } from "vitepress";
import { computed, ref } from "vue";
// TODO: split into 2 components
const { site } = useData();
const translations = {
videoLink: {
"en-US":
"Master this and much more with the official video course by the author of Pinia",
"zh-CN": "通过 Pinia 作者的官方视频课程掌握更多内容",
},
videoEmbed: {
"en-US": "Master this and much more with a free video from Mastering Pinia",
"zh-CN": "通过 VideoModule 的免费视频掌握更多内容",
},
watchMoreA: {
"en-US": "Watch more on ",
"zh-CN": "获取 ",
},
watchMoreB: {
"en-US": "",
"zh-CN": " 官方授权",
},
};
const props = defineProps<{ href: string; title: string; mpLink?: string }>();
const isVideo = computed(() => props.href.startsWith("/"));
const isVideoOpen = ref(false);
</script>
<template>
<div class="mp">
<template v-if="isVideo">
<div class="video-embed" v-if="isVideoOpen">
<div style="padding: 56.25% 0 0 0; position: relative">
<iframe
loading="lazy"
title="Gumlet video player"
false
:src="
href +
'?preload=false&autoplay=true&loop=false&disable_player_controls=false'
"
style="
border: none;
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
"
allow="
accelerometer;
gyroscope;
autoplay;
encrypted-media;
picture-in-picture;
fullscreen;
"
frameborder="0"
allowfullscreen
>
</iframe>
</div>
<div class="watch-more">
{{ translations.watchMoreA[site.lang] }}
<a
:href="mpLink || 'https://www.djangoadmin.cn'"
target="_blank"
rel="noopener"
>
小蚂蚁云
<img src="../../../public/logo.svg" alt="小蚂蚁云" />
</a>
{{ translations.watchMoreB[site.lang] }}
</div>
</div>
<button class="cta" :title v-else @click="isVideoOpen = true">
<div class="text">
<slot>{{ translations.videoEmbed[site.lang] }}</slot>
</div>
</button>
</template>
<a
v-else
:href="href"
target="_blank"
rel="noopener"
:title="title"
class="no-icon cta"
>
<div class="text">
<slot>{{ translations.videoLink[site.lang] }}</slot>
</div>
</a>
</div>
</template>
<style scoped>
.mp {
margin-top: 20px;
}
.mp:has(.cta) {
position: relative;
transition: border-color 0.5s;
padding: 1em 1.25em;
background-color: var(--vp-code-block-bg);
border-radius: 1em;
border: 2px solid var(--vp-c-bg-alt);
}
.mp:has(.cta):hover {
border: 2px solid var(--vp-c-brand-1);
}
.cta:hover {
color: var(--vp-c-brand-1);
text-decoration: underline;
}
.watch-more {
text-align: end;
font-size: 0.8em;
background-color: var(--vp-code-block-bg);
border-radius: 0 0 1em 1em;
padding-right: 1em;
}
.watch-more img {
height: 1em;
display: inline-block;
/* vertical-align: middle; */
}
.cta {
font-size: inherit;
color: var(--c-text);
position: relative;
display: flex;
gap: 1em;
grid-template-columns: 1fr auto;
align-items: center;
justify-content: space-between;
padding-left: 36px;
}
.cta .content {
flex-grow: 1;
}
.cta:before {
content: "";
position: absolute;
display: block;
width: 30px;
height: 30px;
top: calc(50% - 15px);
left: -4px;
border-radius: 50%;
background-color: var(--vp-c-brand-1);
}
html.dark .cta:after {
--play-icon-color: #000;
}
.cta:after {
content: "";
position: absolute;
display: block;
width: 0;
height: 0;
top: calc(50% - 5px);
left: 8px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 9px solid var(--play-icon-color, #fff);
}
</style>
@@ -0,0 +1,38 @@
{
"platinum": [],
"gold": [],
"silver": [
{
"alt": "企业级中台解决方案",
"href": "https://www.djangoadmin.cn",
"imgSrcDark": "/sponsor/djangoadmin.png",
"imgSrcLight": "/sponsor/djangoadmin.png"
},
{
"alt": "企业级中台解决方案",
"href": "https://www.djangoadmin.cn",
"imgSrcDark": "/sponsor/djangoadmin.png",
"imgSrcLight": "/sponsor/djangoadmin.png"
}
],
"bronze": [
{
"alt": "企业级中台解决方案",
"href": "https://www.djangoadmin.cn",
"imgSrcDark": "/sponsor/djangoadmin.png",
"imgSrcLight": "/sponsor/djangoadmin.png"
},
{
"alt": "企业级中台解决方案",
"href": "https://www.djangoadmin.cn",
"imgSrcDark": "/sponsor/djangoadmin.png",
"imgSrcLight": "/sponsor/djangoadmin.png"
},
{
"alt": "企业级中台解决方案",
"href": "https://www.djangoadmin.cn",
"imgSrcDark": "/sponsor/djangoadmin.png",
"imgSrcLight": "/sponsor/djangoadmin.png"
}
]
}
@@ -0,0 +1,53 @@
import { h } from "vue";
import { type Theme, useRoute } from "vitepress";
import DefaultTheme from "vitepress/theme";
import AsideSponsors from "./components/AsideSponsors.vue";
import VideoModuleLink from "./components/VideoModuleLink.vue";
import "./styles/vars.css";
import imageViewer from "vitepress-plugin-image-viewer";
import vImageViewer from "vitepress-plugin-image-viewer/lib/vImageViewer.vue";
import {
DocAsideLogo,
DocBox,
DocBoxCube,
DocLinks,
DocPill,
DocVideoLink,
HomeFooter,
HomeUnderline,
} from "@theojs/lumen";
const theme: Theme = {
...DefaultTheme,
Layout() {
return h(DefaultTheme.Layout, null, {
"home-hero-image": () =>
h(
"div",
{ class: "image-src" },
h("img", {
src: "/logo.png",
alt: "小蚂蚁云",
}),
),
"aside-ads-before": () => h(AsideSponsors),
});
},
setup() {
const route = useRoute();
imageViewer(route);
},
enhanceApp({ app }) {
app.component("Home", HomeUnderline);
app.component("Pill", DocPill);
app.component("Box", DocBox);
app.component("Links", DocLinks);
app.component("BoxCube", DocBoxCube);
app.component("Vid", DocVideoLink);
app.component("VideoModuleLink", VideoModuleLink);
app.component("vImageViewer", vImageViewer);
},
};
export default theme;
@@ -0,0 +1,11 @@
/* CTA link styles for the home page */
a.cta {
text-align: center;
border-radius: 8px;
}
a.cta:hover {
border-color: var(--vp-c-brand);
background-color: var(--c-bg-accent);
}
@@ -0,0 +1,204 @@
/**
* Colors
* -------------------------------------------------------------------------- */
:root {
--c-yellow-1: #165DFF;
--c-yellow-2: #165DFF;
--c-yellow-3: #165DFF;
--c-yellow-soft-1: #165DFF;
--c-yellow-soft-2: #165DFF;
--c-teal: #086367;
--c-teal-light: #33898d;
--c-white-dark: #f8f8f8;
--c-black-darker: #0d121b;
--c-black: #111827;
--c-black-light: #161f32;
--c-black-lighter: #262a44;
--c-green-1: #165DFF;
--c-green-2: #8ae99c;
--c-green-3: #165DFF;
--c-green-soft: #316334;
/* light theme is a bit different */
--vp-c-brand-1: var(--vp-c-green-1);
--vp-c-brand-2: var(--vp-c-green-2);
--vp-c-brand-3: var(--vp-c-green-3);
--vp-c-brand-soft: var(--vp-c-green-soft);
--c-text-dark-1: #d9e6eb;
--c-text-dark-2: #c4dde6;
--c-text-dark-3: #abc4cc;
--c-text-light-1: #2c3e50;
--c-text-light-2: #476582;
--c-text-light-3: #90a4b7;
--vp-c-brand-dark: var(--c-green-soft);
--vp-c-brand-darker: var(--c-green-soft);
--vp-c-brand-dimm: rgba(100, 108, 255, 0.08);
--vp-c-brand-text: var(--c-text-light-1);
--c-bg-accent: var(--c-white-dark);
--code-bg-color: var(--c-white-dark);
--code-inline-bg-color: var(--c-white-dark);
--code-font-family: 'dm', source-code-pro, Menlo, Monaco, Consolas,
'Courier New', monospace;
--code-font-size: 16px;
--vp-code-block-bg: var(--vp-c-bg-alt);
--vp-code-line-highlight-color: rgba(0, 0, 0, 0.075);
--vp-code-color: var(--vp-text-color);
}
html.dark:root {
/* --c-black: #ffffff;
--c-white: #000000; */
/* --c-divider-light: rgba(60, 60, 67, 0.12);
--c-divider-dark: rgba(84, 84, 88, 0.48); */
/* --c-brand-light: var(--c-yellow-light); */
--vp-c-brand-1: var(--c-yellow-1);
--vp-c-brand-2: var(--c-yellow-2);
--vp-c-brand-3: var(--c-yellow-3);
--vp-c-bg-alpha-with-backdrop: rgba(20, 25, 36, 0.7);
--vp-c-bg-alpha-without-backdrop: rgba(20, 25, 36, 0.9);
--vp-code-line-highlight-color: rgba(0, 0, 0, 0.5);
--vp-c-text-1: var(--c-text-dark-1);
--vp-c-brand-text: var(--c-text-light-1);
--c-text-light: var(--c-text-dark-2);
--c-text-lighter: var(--c-text-dark-3);
--c-divider: var(--c-divider-dark);
--c-bg-accent: var(--c-black-light);
/* --vp-code-inline-bg: var(--vp-c-black-light); */
--vp-c-bg: var(--c-black);
--vp-c-bg-soft: var(--c-black-light);
--vp-c-bg-soft-up: var(--c-black-lighter);
--vp-c-bg-mute: var(--c-black-light);
--vp-c-bg-soft-mute: var(--c-black-lighter);
--vp-c-bg-alt: #0d121b;
--vp-c-bg-elv: var(--vp-c-bg-soft);
--vp-c-bg-elv-mute: var(--vp-c-bg-soft-mute);
--vp-c-mute: var(--vp-c-bg-mute);
--vp-c-mute-dark: var(--c-black-lighter);
--vp-c-mute-darker: var(--c-black-darker);
--vp-home-hero-name-background: -webkit-linear-gradient(
78deg,
var(--c-yellow-2) 30%,
var(--c-green-2)
);
}
html.dark .DocSearch {
--docsearch-hit-active-color: var(--c-text-light-1);
}
/**
* Component: Button
* -------------------------------------------------------------------------- */
:root {
--vp-button-brand-border: var(--c-yellow-soft-1);
--vp-button-brand-text: var(--c-black);
--vp-button-brand-bg: var(--c-yellow-1);
--vp-button-brand-hover-border: var(--c-yellow-2);
--vp-button-brand-hover-text: var(--c-black-darker);
--vp-button-brand-hover-bg: var(--c-yellow-2);
--vp-button-brand-active-border: var(--c-yellow-soft-1);
--vp-button-brand-active-text: var(--c-black-darker);
--vp-button-brand-active-bg: var(--vp-button-brand-bg);
}
/**
* Component: Home
* -------------------------------------------------------------------------- */
:root {
--vp-home-hero-name-color: transparent;
--vp-home-hero-name-background: linear-gradient(
292deg,
var(--c-green-1) 50%,
var(--c-green-2)
);
--vp-home-hero-image-background-image: linear-gradient(
15deg,
var(--c-yellow-2) 65%,
var(--c-green-1) 30%
);
--vp-home-hero-image-filter: blur(40px);
}
.VPHero .VPImage.image-src {
max-height: 192px;
}
@media (min-width: 640px) {
:root {
--vp-home-hero-image-filter: blur(56px);
}
.VPHero .VPImage.image-src {
max-height: 256px;
}
}
@media (min-width: 960px) {
:root {
--vp-home-hero-image-filter: blur(72px);
}
.VPHero .VPImage.image-src {
max-height: 320px;
}
}
.become-sponsor {
font-size: 0.9em;
font-weight: 700;
width: auto;
text-align: center;
background-color: transparent;
padding: 0.75em 2em;
border-radius: 2em;
transition: all 0.15s ease;
box-sizing: border-box;
border: 2px solid var(--c-yellow-2);
}
.become-sponsor.become-sponsor:hover {
background-color: var(--c-yellow-1);
text-decoration: none;
border-color: var(--c-yellow-1);
color: var(--c-text-light-1);
}
.vp-doc a {
text-decoration: none;
}
.vp-doc a:hover {
text-decoration: underline;
}
.sponsors-top .become-sponsor {
font-size: 0.75em;
padding: 0.2em;
width: auto;
max-width: 150px;
}
kbd {
display: inline-block;
padding: 3px 5px;
font-size: 0.65em;
color: var(--vp-c-text-1);
vertical-align: middle;
background-color: var(--vp-c-bg-mute);
border: solid 1px var(--vp-c-bg-soft-mute);
border-radius: 6px;
box-shadow: inset 0 -1px 0 var(--vp-c-bg-soft-mute);
line-height: 0.95em;
}
@@ -0,0 +1,6 @@
{
"zh": {
"hash": "3.0.0",
"date": "2026-09-07"
}
}