jdysya 19912e5309 docs: 更新侧边栏并配置 PDF.js 服务
- 移除侧边栏中的幻灯片链接
- 更新 PDF.js 服务地址为 https://pdfjs.jdysya.top/
- 注释掉本地 PDF.js 路径,使用外部服务
2025-02-18 17:47:41 +08:00

207 lines
4.7 KiB
TypeScript

import { hopeTheme } from "vuepress-theme-hope";
import navbar from "./navbar.js";
import sidebar from "./sidebar.js";
export default hopeTheme({
// hostname: "https://vuepress-theme-hope-docs-demo.netlify.app",
author: {
name: "余翔",
// url: "https://mister-hope.com",
},
logo: "logo.svg",
// repo: "vuepress-theme-hope/vuepress-theme-hope",
docsDir: "src",
// 导航栏
navbar,
navbarLayout: {
start: ["Brand"],
center: ["Links"],
end: ["Outlook", "UserInfo"],
},
// 侧边栏
sidebar,
displayFooter: true,
// 加密配置
encrypt: {
config: {
"/demo/encrypt.html": {
hint: "Password: 1234",
password: "1234",
},
},
},
// 多语言配置
metaLocales: {
editLink: "在 GitHub 上编辑此页",
},
// 如果想要实时查看任何改变,启用它。注: 这对更新性能有很大负面影响
// hotReload: true,
// 此处开启了很多功能用于演示,你应仅保留用到的功能。
markdown: {
align: true,
attrs: true,
codeTabs: true,
component: true,
demo: true,
figure: true,
gfm: true,
imgLazyload: true,
imgSize: true,
include: true,
mark: true,
plantuml: true,
spoiler: true,
stylize: [
{
matcher: "Recommended",
replacer: ({ tag }) => {
if (tag === "em")
return {
tag: "Badge",
attrs: { type: "tip" },
content: "Recommended",
};
},
},
],
sub: true,
sup: true,
tabs: true,
tasklist: true,
vPre: true,
// 取消注释它们如果你需要 TeX 支持
// markdownMath: {
// // 启用前安装 katex
// type: "katex",
// // 或者安装 mathjax-full
// type: "mathjax",
// },
// 如果你需要幻灯片,安装 @vuepress/plugin-revealjs 并取消下方注释
// revealjs: {
// plugins: ["highlight", "math", "search", "notes", "zoom"],
// },
// 在启用之前安装 chart.js
// chartjs: true,
// insert component easily
// 在启用之前安装 echarts
// echarts: true,
// 在启用之前安装 flowchart.ts
// flowchart: true,
// 在启用之前安装 mermaid
// mermaid: true,
// playground: {
// presets: ["ts", "vue"],
// },
// 在启用之前安装 @vue/repl
// vuePlayground: true,
// 在启用之前安装 sandpack-vue3
// sandpack: true,
},
// 在这里配置主题提供的插件
plugins: {
// 注意: 仅用于测试! 你必须自行生成并在生产环境中使用自己的评论服务
// comment: {
// provider: "Giscus",
// repo: "vuepress-theme-hope/giscus-discussions",
// repoId: "R_kgDOG_Pt2A",
// category: "Announcements",
// categoryId: "DIC_kwDOG_Pt2M4COD69",
// },
components: {
components: ["Badge", "VPCard", "PDF"],
componentOptions: {
pdf: {
pdfjs: 'https://pdfjs.jdysya.top/',
// pdfjs: '/pdfjs/', // 假设 PDF.js 放在 public/pdfjs/web/
},
},
},
icon: {
prefix: "fa6-solid:",
},
// 如果你需要 PWA。安装 @vuepress/plugin-pwa 并取消下方注释
// pwa: {
// favicon: "/favicon.ico",
// cacheHTML: true,
// cacheImage: true,
// appendBase: true,
// apple: {
// icon: "/assets/icon/apple-icon-152.png",
// statusBarColor: "black",
// },
// msTile: {
// image: "/assets/icon/ms-icon-144.png",
// color: "#ffffff",
// },
// manifest: {
// icons: [
// {
// src: "/assets/icon/chrome-mask-512.png",
// sizes: "512x512",
// purpose: "maskable",
// type: "image/png",
// },
// {
// src: "/assets/icon/chrome-mask-192.png",
// sizes: "192x192",
// purpose: "maskable",
// type: "image/png",
// },
// {
// src: "/assets/icon/chrome-512.png",
// sizes: "512x512",
// type: "image/png",
// },
// {
// src: "/assets/icon/chrome-192.png",
// sizes: "192x192",
// type: "image/png",
// },
// ],
// shortcuts: [
// {
// name: "Demo",
// short_name: "Demo",
// url: "/demo/",
// icons: [
// {
// src: "/assets/icon/guide-maskable.png",
// sizes: "192x192",
// purpose: "maskable",
// type: "image/png",
// },
// ],
// },
// ],
// },
// },
},
});