From 3138fa039f38bf425eaa3bf2d03b196ee268bce4 Mon Sep 17 00:00:00 2001 From: "Mr.Hope" Date: Mon, 8 Apr 2024 15:28:29 +0800 Subject: [PATCH] chore(docs): format files and fix typos (#825) * style: format config files * docs: format docs and fix typos * chore: tweaks --- .prettierignore | 1 + docs/docs/.vitepress/config.ts | 237 ++++---- docs/docs/.vitepress/theme/Artalk.vue | 67 +-- docs/docs/.vitepress/theme/Artransfer.vue | 12 +- docs/docs/.vitepress/theme/Layout.vue | 3 - docs/docs/.vitepress/theme/index.ts | 2 +- docs/docs/.vitepress/theme/style.scss | 53 +- docs/docs/.vitepress/types/shims-vue.d.ts | 6 +- docs/docs/develop/api-old.md | 546 +++++++++---------- docs/docs/develop/event.md | 53 +- docs/docs/develop/fe-api.md | 6 +- docs/docs/develop/index.md | 17 +- docs/docs/develop/plugs.md | 46 +- docs/docs/guide/backend/admin_notify.md | 143 +++-- docs/docs/guide/backend/build.md | 6 +- docs/docs/guide/backend/captcha.md | 55 +- docs/docs/guide/backend/config.md | 78 +-- docs/docs/guide/backend/daemon.md | 2 +- docs/docs/guide/backend/docker.md | 2 +- docs/docs/guide/backend/email.md | 72 ++- docs/docs/guide/backend/fe-control.md | 10 +- docs/docs/guide/backend/img-upload.md | 30 +- docs/docs/guide/backend/moderator.md | 42 +- docs/docs/guide/backend/multi-site.md | 22 +- docs/docs/guide/backend/notify.md | 5 +- docs/docs/guide/backend/relative-path.md | 12 +- docs/docs/guide/backend/reverse-proxy.md | 3 +- docs/docs/guide/deploy.md | 49 +- docs/docs/guide/describe.md | 2 +- docs/docs/guide/extras.md | 1 - docs/docs/guide/frontend/config.md | 12 +- docs/docs/guide/frontend/emoticons.md | 137 ++--- docs/docs/guide/frontend/i18n.md | 20 +- docs/docs/guide/frontend/import-blog.md | 25 +- docs/docs/guide/frontend/import-framework.md | 82 +-- docs/docs/guide/frontend/ip-region.md | 16 +- docs/docs/guide/frontend/latex.md | 12 +- docs/docs/guide/frontend/lightbox.md | 32 +- docs/docs/guide/frontend/pv.md | 12 +- docs/docs/guide/intro.md | 54 +- docs/docs/guide/transfer.md | 60 +- docs/docs/tsconfig.json | 2 +- 42 files changed, 1033 insertions(+), 1014 deletions(-) diff --git a/.prettierignore b/.prettierignore index 6d2127e9d..54884097d 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,4 @@ CHANGELOG.md CHANGELOG.tpl.md pnpm-lock.yaml +CDN.html diff --git a/docs/docs/.vitepress/config.ts b/docs/docs/.vitepress/config.ts index 1cdbadca2..329372e77 100644 --- a/docs/docs/.vitepress/config.ts +++ b/docs/docs/.vitepress/config.ts @@ -1,45 +1,44 @@ -import { defineConfig } from "vitepress"; -import iterator from "markdown-it-for-inline"; -import * as Version from "../code/ArtalkVersion.json"; +import { defineConfig } from 'vitepress' +import iterator from 'markdown-it-for-inline' +import * as Version from '../code/ArtalkVersion.json' export default defineConfig({ - title: "Artalk", - description: "一款简洁的自托管评论系统", - lang: "zh-CN", + title: 'Artalk', + description: '一款简洁的自托管评论系统', + lang: 'zh-CN', head: [ - ["link", { rel: "icon", href: "/favicon.png" }], + ['link', { rel: 'icon', href: '/favicon.png' }], [ - "meta", + 'meta', { - name: "viewport", + name: 'viewport', content: - "width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi", + 'width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi', }, ], - // artalk - // ['link', { href: `https://npm.elemecdn.com/artalk@${Version.latest}/dist/Artalk.css`, rel: 'stylesheet' }], - // [ - // "link", - // { href: `https://artalk.qwqaq.com/dist/Artalk.css`, rel: "stylesheet" }, - // ], - // ['script', { src: ArtalkCDN.JS }], // light gallery [ - "link", + 'link', { - href: "https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.3.0/css/lightgallery.css", - rel: "stylesheet", + href: 'https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.3.0/css/lightgallery.css', + rel: 'stylesheet', }, ], [ - "script", + 'script', { - src: "https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.3.0/lightgallery.min.js", + src: 'https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.3.0/lightgallery.min.js', }, ], // katex - ['link', { href: "https://unpkg.com/katex@0.15.3/dist/katex.min.css", rel: 'stylesheet' }], + [ + 'link', + { + href: 'https://unpkg.com/katex@0.15.3/dist/katex.min.css', + rel: 'stylesheet', + }, + ], ['script', { src: 'https://unpkg.com/katex@0.15.3/dist/katex.min.js' }], // ['script', { src: 'https://unpkg.com/@artalk/plugin-katex/dist/artalk-plugin-katex.js' }], ], @@ -49,132 +48,132 @@ export default defineConfig({ markdown: { // @link https://github.com/shikijs/shiki theme: { - light: "github-light", - dark: "github-dark", + light: 'github-light', + dark: 'github-dark', }, config: (md) => { - md.use(iterator, "artalk_version", "text", function (tokens, idx) { + md.use(iterator, 'artalk_version', 'text', function (tokens, idx) { tokens[idx].content = tokens[idx].content.replace( /:ArtalkVersion:/g, - Version.latest - ); - }); - md.use(iterator, "artalk_version_link", "link_open", (tokens, idx) => { - const href = tokens[idx].attrGet("href"); + Version.latest, + ) + }) + md.use(iterator, 'artalk_version_link', 'link_open', (tokens, idx) => { + const href = tokens[idx].attrGet('href') tokens[idx].attrSet( - "href", - href.replace(/:ArtalkVersion:/g, Version.latest) - ); - }); + 'href', + href.replace(/:ArtalkVersion:/g, Version.latest), + ) + }) }, }, locales: { root: { - label: "简体中文", - lang: "zh", - link: "https://artalk.js.org/", + label: '简体中文', + lang: 'zh', + link: 'https://artalk.js.org/', }, en: { - label: "English", - lang: "en", - link: "https://artalk-js-org.translate.goog/guide/intro?_x_tr_sl=auto&_x_tr_tl=en-US&_x_tr_hl=en-US&_x_tr_pto=wapp", + label: 'English', + lang: 'en', + link: 'https://artalk-js-org.translate.goog/guide/intro?_x_tr_sl=auto&_x_tr_tl=en-US&_x_tr_hl=en-US&_x_tr_pto=wapp', }, }, themeConfig: { sidebar: { - "/guide/": [ + '/guide/': [ { - text: "快速开始", + text: '快速开始', collapsed: false, items: [ - { text: "项目介绍", link: "/guide/intro.md" }, - { text: "程序部署", link: "/guide/deploy.md" }, - { text: "数据迁移", link: "/guide/transfer.md" }, + { text: '项目介绍', link: '/guide/intro.md' }, + { text: '程序部署', link: '/guide/deploy.md' }, + { text: '数据迁移', link: '/guide/transfer.md' }, ], }, { - text: "核心指南", + text: '核心指南', collapsed: false, items: [ - { text: "侧边栏", link: "/guide/frontend/sidebar.md" }, - { text: "邮件通知", link: "/guide/backend/email.md" }, - { text: "多元推送", link: "/guide/backend/admin_notify.md" }, - { text: "评论审核", link: "/guide/backend/moderator.md" }, - { text: "验证码", link: "/guide/backend/captcha.md" }, - { text: "图片上传", link: "/guide/backend/img-upload.md" }, - { text: "账户与多站点", link: "/guide/backend/multi-site.md" }, - { text: "解析相对路径", link: "/guide/backend/relative-path.md" }, - { text: "如何配置界面", link: "/guide/backend/fe-control.md" }, - { text: "English (i18n)", link: "/guide/frontend/i18n.md" }, + { text: '侧边栏', link: '/guide/frontend/sidebar.md' }, + { text: '邮件通知', link: '/guide/backend/email.md' }, + { text: '多元推送', link: '/guide/backend/admin_notify.md' }, + { text: '评论审核', link: '/guide/backend/moderator.md' }, + { text: '验证码', link: '/guide/backend/captcha.md' }, + { text: '图片上传', link: '/guide/backend/img-upload.md' }, + { text: '账户与多站点', link: '/guide/backend/multi-site.md' }, + { text: '解析相对路径', link: '/guide/backend/relative-path.md' }, + { text: '如何配置界面', link: '/guide/backend/fe-control.md' }, + { text: 'English (i18n)', link: '/guide/frontend/i18n.md' }, ], }, { - text: "进阶指南", + text: '进阶指南', collapsed: false, items: [ - { text: "表情包", link: "/guide/frontend/emoticons.md" }, - { text: "浏览量统计", link: "/guide/frontend/pv.md" }, - { text: "Latex", link: "/guide/frontend/latex.md" }, - { text: "图片灯箱", link: "/guide/frontend/lightbox.md" }, - { text: "IP 属地", link: "/guide/frontend/ip-region.md" }, - { text: "精简版本", link: "/guide/frontend/artalk-lite.md" }, - { text: "置入博客", link: "/guide/frontend/import-blog.md" }, - { text: "置入框架", link: "/guide/frontend/import-framework.md" }, - { text: "前端 API", link: "/develop/fe-api.md" }, - { text: "开发文档", link: "/develop/index.md" }, + { text: '表情包', link: '/guide/frontend/emoticons.md' }, + { text: '浏览量统计', link: '/guide/frontend/pv.md' }, + { text: 'Latex', link: '/guide/frontend/latex.md' }, + { text: '图片灯箱', link: '/guide/frontend/lightbox.md' }, + { text: 'IP 属地', link: '/guide/frontend/ip-region.md' }, + { text: '精简版本', link: '/guide/frontend/artalk-lite.md' }, + { text: '置入博客', link: '/guide/frontend/import-blog.md' }, + { text: '置入框架', link: '/guide/frontend/import-framework.md' }, + { text: '前端 API', link: '/develop/fe-api.md' }, + { text: '开发文档', link: '/develop/index.md' }, ], }, { - text: "配置文档", + text: '配置文档', collapsed: true, items: [ - { text: "后端配置", link: "/guide/backend/config.md" }, - { text: "前端配置", link: "/guide/frontend/config.md" }, + { text: '后端配置', link: '/guide/backend/config.md' }, + { text: '前端配置', link: '/guide/frontend/config.md' }, ], }, { - text: "部署说明", + text: '部署说明', collapsed: true, items: [ - { text: "守护进程", link: "/guide/backend/daemon.md" }, - { text: "反向代理", link: "/guide/backend/reverse-proxy.md" }, - { text: "编译构建", link: "/guide/backend/build.md" }, - { text: "程序升级", link: "/guide/backend/update.md" }, - { text: "Docker", link: "/guide/backend/docker.md" }, + { text: '守护进程', link: '/guide/backend/daemon.md' }, + { text: '反向代理', link: '/guide/backend/reverse-proxy.md' }, + { text: '编译构建', link: '/guide/backend/build.md' }, + { text: '程序升级', link: '/guide/backend/update.md' }, + { text: 'Docker', link: '/guide/backend/docker.md' }, ], }, { - text: "更多内容", + text: '更多内容', collapsed: true, items: [ - { text: "安全防范", link: "/guide/security.md" }, - { text: "扩展阅读", link: "/guide/extras.md" }, - { text: "案例展示", link: "/guide/cases.md" }, - { text: "关于我们", link: "/guide/about.md" }, + { text: '安全防范', link: '/guide/security.md' }, + { text: '扩展阅读', link: '/guide/extras.md' }, + { text: '案例展示', link: '/guide/cases.md' }, + { text: '关于我们', link: '/guide/about.md' }, ], }, ], - "/develop/": [ + '/develop/': [ { - text: "开发文档", + text: '开发文档', items: [ - { text: "开发说明", link: "/develop/index.md" }, - { text: "前端 API", link: "/develop/fe-api.md" }, - { text: "前端 Event", link: "/develop/event.md" }, - { text: "插件开发", link: "/develop/plugs.md" }, + { text: '开发说明', link: '/develop/index.md' }, + { text: '前端 API', link: '/develop/fe-api.md' }, + { text: '前端 Event', link: '/develop/event.md' }, + { text: '插件开发', link: '/develop/plugs.md' }, { - text: "🔬 HTTP API", - link: "https://artalk.js.org/http-api.html", + text: '🔬 HTTP API', + link: 'https://artalk.js.org/http-api.html', }, { - text: "📖 Contributing Guide", - link: "https://github.com/ArtalkJS/Artalk/blob/master/CONTRIBUTING.md", + text: '📖 Contributing Guide', + link: 'https://github.com/ArtalkJS/Artalk/blob/master/CONTRIBUTING.md', }, { - text: "🔖 Code of Conduct", - link: "https://github.com/ArtalkJS/Artalk/blob/master/CODE_OF_CONDUCT.md", + text: '🔖 Code of Conduct', + link: 'https://github.com/ArtalkJS/Artalk/blob/master/CODE_OF_CONDUCT.md', }, ], }, @@ -184,36 +183,36 @@ export default defineConfig({ nav: [ // NavbarItem { - text: "介绍", - link: "/guide/intro", + text: '介绍', + link: '/guide/intro', }, { - text: "部署", - link: "/guide/deploy", + text: '部署', + link: '/guide/deploy', }, { - text: "配置", - link: "/guide/backend/config", + text: '配置', + link: '/guide/backend/config', }, { - text: "迁移", - link: "/guide/transfer", + text: '迁移', + link: '/guide/transfer', }, { - text: "案例", - link: "/guide/cases", + text: '案例', + link: '/guide/cases', }, { - text: "开发", - link: "/develop/", + text: '开发', + link: '/develop/', }, // NavbarGroup { - text: "传送", + text: '传送', items: [ { - text: "代码仓库", - link: "https://github.com/ArtalkJS/Artalk", + text: '代码仓库', + link: 'https://github.com/ArtalkJS/Artalk', }, // { // text: "文档镜像 (国内)", @@ -224,30 +223,30 @@ export default defineConfig({ ], socialLinks: [ - { icon: "github", link: "https://github.com/ArtalkJS/Artalk" }, + { icon: 'github', link: 'https://github.com/ArtalkJS/Artalk' }, ], search: { - provider: "algolia", + provider: 'algolia', options: { - appId: "2WNJ32WVTY", - apiKey: "6c6ebc345a87b738264f19095b78c91c", - indexName: "artalk-js", + appId: '2WNJ32WVTY', + apiKey: '6c6ebc345a87b738264f19095b78c91c', + indexName: 'artalk-js', searchParameters: { - facetFilters: ["lang:zh-CN"], + facetFilters: ['lang:zh-CN'], }, }, }, editLink: { - pattern: "https://github.com/ArtalkJS/Artalk/edit/master/docs/:path", - text: "完善文档", + pattern: 'https://github.com/ArtalkJS/Artalk/edit/master/docs/:path', + text: '完善文档', }, }, vite: { server: { - open: "/guide/intro.html", + open: '/guide/intro.html', }, }, -}); +}) diff --git a/docs/docs/.vitepress/theme/Artalk.vue b/docs/docs/.vitepress/theme/Artalk.vue index 967011e75..a0ed84a23 100644 --- a/docs/docs/.vitepress/theme/Artalk.vue +++ b/docs/docs/.vitepress/theme/Artalk.vue @@ -1,5 +1,5 @@ - - diff --git a/docs/docs/.vitepress/theme/Artransfer.vue b/docs/docs/.vitepress/theme/Artransfer.vue index 613eca6b8..c20ee4b61 100644 --- a/docs/docs/.vitepress/theme/Artransfer.vue +++ b/docs/docs/.vitepress/theme/Artransfer.vue @@ -1,5 +1,9 @@ - - diff --git a/docs/docs/.vitepress/theme/Layout.vue b/docs/docs/.vitepress/theme/Layout.vue index 27a1ec69b..9f6b2f53b 100644 --- a/docs/docs/.vitepress/theme/Layout.vue +++ b/docs/docs/.vitepress/theme/Layout.vue @@ -4,9 +4,6 @@ import { onMounted } from 'vue' import './style.scss' const { Layout } = DefaultTheme - -onMounted(() => { -})