1
0
forked from bot/app

🐛 文档构建失败的问题

This commit is contained in:
2024-08-17 02:24:25 +08:00
parent 66ade9efc6
commit ee851116d8
40 changed files with 323 additions and 360 deletions

View File

@ -17,4 +17,5 @@ export default defineClientConfig({
app.component("geoComp", geoComp);
// app.use(ElementPlus);
},
});
});

View File

@ -9,18 +9,25 @@ export default defineUserConfig({
"/": {
// 设置正在使用的语言
lang: "zh-CN",
title: "LiteyukiBot 轻雪机器人",
description: "LiteyukiBot | 轻雪机器人 | An OneBot Standard ChatBot | 一个OneBot标准的聊天机器人",
head: [
["script", {"src": "/js/zh/get_data.js", "type": "module"}],
]
},
"/en/": {
// 设置正在使用的语言
lang: "en-US",
title: "LiteyukiBot",
description: "LiteyukiBot | An OneBot Standard ChatBot ",
head: [
["script", {"src": "/js/en/get_data.js", "type": "module"}],
]
},
},
title: "LiteyukiBot 轻雪机器人",
description: "LiteyukiBot | 轻雪机器人 | An OneBot Standard ChatBot | 一个OneBot标准的聊天机器人",
head: [
// 设置 favor.ico.vuepress/public 下
["script", {src: "/js/style.js", "type": "module"}],
["script", {src: "/js/get_data.js", "type": "module"}],
['link', {rel: 'icon', href: 'https://cdn.liteyuki.icu/favicon.ico'},],
['link', {rel: 'stylesheet', href: 'https://cdn.bootcdn.net/ajax/libs/firacode/6.2.0/fira_code.min.css'}],

View File

@ -0,0 +1,25 @@
import {navbar} from "vuepress-theme-hope";
export const enNavbarConfig = navbar([
"/en/",
{
text: "Deploy",
link: "/en/deploy/",
prefix: "deploy/",
},
{
text: "Usage",
link: "/en/usage/",
prefix: "usage/",
},
{
text: "Extensions",
link: "/en/store/",
prefix: "store/",
},
{
text: "Contribute",
link: "/en/dev/",
prefix: "dev/",
},
]);

View File

@ -0,0 +1,2 @@
export * from "./zh.js"
export * from "./en.js"

View File

@ -1,11 +1,12 @@
import {navbar} from "vuepress-theme-hope";
export default navbar([
export const zhNavbarConfig = navbar([
"/",
{
text: "安装及部署",
link: "/deployment/",
prefix: "deployment/",
link: "/deploy/",
prefix: "deploy/",
},
{
text: "使用及功能",
@ -21,5 +22,5 @@ export default navbar([
text: "开发及贡献",
link: "/dev/",
prefix: "dev/",
}
},
]);

View File

@ -0,0 +1,73 @@
// 定义全局变量来存储数据
let globalTotal = 0;
let globalOnline = 0;
// 从API获取数据并更新全局变量
function fetchAndUpdateData() {
Promise.all([
fetch("https://api.liteyuki.icu/count").then(res => res.json()),
fetch("https://api.liteyuki.icu/online").then(res => res.json())
])
.then(([countRes, onlineRes]) => {
globalTotal = countRes.register;
globalOnline = onlineRes.online;
})
.catch(err => {
console.error("Error fetching data:", err);
});
}
// 更新页面显示,使用全局变量中的数据
function updatePageDisplay() {
let countInfo = document.getElementById("count-info");
if (!countInfo) {
let info = `<div id="count-info" style="text-align: center; font-size: 20px; font-weight: 500">
Instances:<span id="total">${globalTotal}</span>&nbsp;&nbsp;&nbsp;&nbsp;Online:<span id="online">${globalOnline}</span></div>`;
let mainDescription = document.querySelector("#main-description");
if (mainDescription) {
mainDescription.insertAdjacentHTML('afterend', info);
}
}
}
// 初始调用更新数据
fetchAndUpdateData();
updatePageDisplay();
// 设置定时器,分别以不同频率调用更新数据和更新页面的函数
setInterval(fetchAndUpdateData, 10000); // 每10秒更新一次数据
setInterval(updatePageDisplay, 1000); // 每1秒更新一次页面显示

View File

@ -1,39 +1,73 @@
// 定义全局变量来存储数据
let globalTotal = 0;
let globalOnline = 0;
// 从API获取数据并更新全局变量
function fetchAndUpdateData() {
Promise.all([
fetch("https://api.liteyuki.icu/count").then(res => res.json()),
fetch("https://api.liteyuki.icu/online").then(res => res.json())
])
.then(([countRes, onlineRes]) => {
globalTotal = countRes.register;
globalOnline = onlineRes.online;
})
.catch(err => {
console.error("Error fetching data:", err);
});
}
// 更新页面显示,使用全局变量中的数据
function updatePageDisplay() {
let countInfo = document.getElementById("count-info");
if (!countInfo) {
let info = `<div id="count-info" style="text-align: center; font-size: 20px; font-weight: 500">
全球实例:<span id="total">${globalTotal}</span>&nbsp;&nbsp;&nbsp;&nbsp;线:<span id="online">${globalOnline}</span></div>`;
let mainDescription = document.querySelector("#main-description");
if (mainDescription) {
mainDescription.insertAdjacentHTML('afterend', info);
}
}
}
// 初始调用更新数据
fetchAndUpdateData();
updatePageDisplay();
// 设置定时器,分别以不同频率调用更新数据和更新页面的函数
setInterval(fetchAndUpdateData, 10000); // 每10秒更新一次数据
setInterval(updatePageDisplay, 1000); // 每1秒更新一次页面显示

View File

@ -0,0 +1,31 @@
import {sidebar} from "vuepress-theme-hope";
export const enSidebarConfig = sidebar({
"/en/": [
"",
{
text: "Install & Deploy",
icon: "laptop-code",
prefix: "deploy/",
children: "structure",
},
{
text: "Usage & Features",
icon: "book",
prefix: "usage/",
children: "structure",
},
{
text: "Resources & Plugins",
icon: "store",
prefix: "store/",
children: "structure",
},
{
text: "Development & Contribution",
icon: "pen-nib",
prefix: "dev/",
children: "structure",
}
],
});

View File

@ -0,0 +1,2 @@
export * from "./zh.js"
export * from "./en.js"

View File

@ -1,12 +1,12 @@
import {sidebar} from "vuepress-theme-hope";
export default sidebar({
export const zhSidebarConfig = sidebar({
"/": [
"",
{
text: "安装及部署",
icon: "laptop-code",
prefix: "deployment/",
prefix: "deploy/",
children: "structure",
},
{

View File

@ -1,14 +1,29 @@
import {hopeTheme} from "vuepress-theme-hope";
import navbar from "./navbar.js";
import sidebar from "./sidebar.js";
import {enSidebarConfig, zhSidebarConfig} from "./sidebar/index.js";
import {enNavbarConfig, zhNavbarConfig} from "./navbar/index.js";
export default hopeTheme({
hostname: "https://vuepress-theme-hope-docs-demo.netlify.app",
author: {
name: "远野千束",
url: "https://sfkm.me",
locales: {
"/": {
navbar: zhNavbarConfig,
sidebar: zhSidebarConfig,
author: {
name: "远野千束",
url: "https://sfkm.me",
}
},
"/en/": {
navbar: enNavbarConfig,
sidebar: enSidebarConfig,
author: {
name: "SnowyKami",
url: "https://sfkm.me",
}
}
},
iconAssets: "fontawesome-with-brands",
@ -19,12 +34,6 @@ export default hopeTheme({
docsDir: "docs",
// 导航栏
navbar,
// 侧边栏
sidebar,
// 页脚
footer: "LiteyukiBot",
displayFooter: true,