|
| 1 | +import { defineConfig } from "vitepress"; |
| 2 | + |
| 3 | +const GOOGLE_ANALYTICS_ID = process.env.GOOGLE_ANALYTICS_ID || ""; |
| 4 | +const gaHead = GOOGLE_ANALYTICS_ID |
| 5 | + ? ([ |
| 6 | + [ |
| 7 | + "script", |
| 8 | + { |
| 9 | + async: "", |
| 10 | + src: `https://www.googletagmanager.com/gtag/js?id=${GOOGLE_ANALYTICS_ID}`, |
| 11 | + }, |
| 12 | + ], |
| 13 | + [ |
| 14 | + "script", |
| 15 | + {}, |
| 16 | + ` |
| 17 | + window.dataLayer = window.dataLayer || []; |
| 18 | + function gtag(){dataLayer.push(arguments);} |
| 19 | + gtag('js', new Date()); |
| 20 | + gtag('config', '${GOOGLE_ANALYTICS_ID}'); |
| 21 | + `, |
| 22 | + ], |
| 23 | + ] as any) |
| 24 | + : []; |
| 25 | + |
| 26 | +// https://vitepress.dev/reference/site-config |
| 27 | +export default defineConfig({ |
| 28 | + srcDir: "docs", |
| 29 | + title: "Mp2RSS", |
| 30 | + description: "让订阅微信公众号像订阅播客一样顺畅", |
| 31 | + base: "/", |
| 32 | + lastUpdated: true, |
| 33 | + head: [ |
| 34 | + ["link", { rel: "icon", href: "/favicon.ico" }], |
| 35 | + ["link", { rel: "apple-touch-icon", href: "/apple-touch-icon.png" }], |
| 36 | + ...gaHead, |
| 37 | + ], |
| 38 | + themeConfig: { |
| 39 | + logo: "/logo.png", |
| 40 | + nav: [ |
| 41 | + { text: "指南", link: "/guide/quick-start" }, |
| 42 | + { text: "API 列表", link: "/api/" }, |
| 43 | + { text: "FAQ", link: "/guide/faq" }, |
| 44 | + ], |
| 45 | + sidebar: { |
| 46 | + "/guide/": [ |
| 47 | + { |
| 48 | + text: "服务说明", |
| 49 | + items: [ |
| 50 | + { text: "快速开始", link: "/guide/quick-start" }, |
| 51 | + { text: "服务介绍", link: "/guide/intro" }, |
| 52 | + { text: "订阅管理", link: "/guide/subscription" }, |
| 53 | + { text: "会员与计费", link: "/guide/membership" }, |
| 54 | + { text: "服务条款", link: "/guide/terms-of-service" }, |
| 55 | + { text: "FAQ", link: "/guide/faq" }, |
| 56 | + ], |
| 57 | + }, |
| 58 | + { |
| 59 | + text: "反馈", |
| 60 | + items: [ |
| 61 | + { |
| 62 | + text: "Bug 反馈", |
| 63 | + link: "https://github.com/areyoubugcoder/Mp2RSS/issues", |
| 64 | + }, |
| 65 | + { |
| 66 | + text: "讨论区", |
| 67 | + link: "https://github.com/areyoubugcoder/Mp2RSS/discussions", |
| 68 | + }, |
| 69 | + ], |
| 70 | + }, |
| 71 | + ], |
| 72 | + "/api/": [ |
| 73 | + { |
| 74 | + text: "API 说明", |
| 75 | + items: [{ text: "API 列表", link: "/api/" }], |
| 76 | + }, |
| 77 | + { |
| 78 | + text: "反馈", |
| 79 | + items: [ |
| 80 | + { |
| 81 | + text: "Bug 反馈", |
| 82 | + link: "https://github.com/areyoubugcoder/Mp2RSS/issues", |
| 83 | + }, |
| 84 | + { |
| 85 | + text: "讨论区", |
| 86 | + link: "https://github.com/areyoubugcoder/Mp2RSS/discussions", |
| 87 | + }, |
| 88 | + ], |
| 89 | + }, |
| 90 | + ], |
| 91 | + }, |
| 92 | + socialLinks: [ |
| 93 | + { |
| 94 | + icon: "github", |
| 95 | + link: "https://github.com/areyoubugcoder/Mp2RSS", |
| 96 | + }, |
| 97 | + ], |
| 98 | + search: { |
| 99 | + provider: "local", |
| 100 | + }, |
| 101 | + }, |
| 102 | +}); |
0 commit comments