فهرست منبع

Revert "docs: upgrade vuepress"

This reverts commit 7808f5c424e38d295747b417348a839b7b833afb.
DIYgod 2 سال پیش
والد
کامیت
5e54f83d79
9فایلهای تغییر یافته به همراه664 افزوده شده و 505 حذف شده
  1. 1 3
      .gitignore
  2. 50 38
      docs/.vuepress/config.js
  3. 0 31
      docs/.vuepress/init.ts
  4. 0 23
      docs/.vuepress/styles/index.scss
  5. 48 0
      docs/.vuepress/styles/index.styl
  6. 1 0
      docs/.vuepress/styles/palette.styl
  7. 3 3
      docs/README.md
  8. 4 5
      package.json
  9. 557 402
      pnpm-lock.yaml

+ 1 - 3
.gitignore

@@ -7,6 +7,4 @@ DPlayer.log*
 wxw
 .vscode
 package-lock.json
-docs/.vuepress/dist
-docs/.vuepress/.cache
-docs/.vuepress/.temp
+docs/.vuepress/dist

+ 50 - 38
docs/.vuepress/config.ts → docs/.vuepress/config.js

@@ -1,39 +1,56 @@
-import { defaultTheme } from 'vuepress';
-import { googleAnalyticsPlugin } from '@vuepress/plugin-google-analytics';
-import { registerComponentsPlugin } from '@vuepress/plugin-register-components';
-import { defineUserConfig } from '@vuepress/cli';
-import path from 'path';
-
-export default defineUserConfig({
-    title: 'DPlayer',
-    description: '🍭 Wow, such a lovely HTML5 danmaku video player',
-    plugins: [
-        googleAnalyticsPlugin({
-            id: 'G-QEBJJDX922',
-        }),
-        registerComponentsPlugin({
-            componentsDir: path.resolve(__dirname, './components'),
-        }),
-    ],
-
+module.exports = {
+    plugins: {
+        '@vuepress/google-analytics': {
+            ga: 'UA-48084758-9',
+        },
+        '@vuepress/pwa': {
+            serviceWorker: true,
+            updatePopup: {
+                '/zh/': {
+                    message: '发现新内容可用',
+                    buttonText: '刷新',
+                },
+                '/': {
+                    message: 'New content is available',
+                    buttonText: 'Refresh',
+                },
+            },
+        },
+        '@vuepress/back-to-top': true,
+    },
     locales: {
         '/zh/': {
             lang: 'zh-CN',
+            title: 'DPlayer',
+            description: '🍭 Wow, such a lovely HTML5 danmaku video player',
         },
         '/': {
             lang: 'en-US',
+            title: 'DPlayer',
+            description: '🍭 Wow, such a lovely HTML5 danmaku video player',
         },
     },
-
-    theme: defaultTheme({
-        repo: 'DIYgod/DPlayer',
+    head: [
+        ['link', { rel: 'icon', href: `/logo.png` }],
+        ['script', { src: 'https://cdn.jsdelivr.net/npm/flv.js/dist/flv.min.js' }],
+        ['script', { src: 'https://cdn.jsdelivr.net/npm/hls.js/dist/hls.min.js' }],
+        ['script', { src: 'https://cdn.jsdelivr.net/npm/dashjs/dist/dash.all.min.js' }],
+        ['script', { src: 'https://cdn.jsdelivr.net/webtorrent/latest/webtorrent.min.js' }],
+        ['script', { src: 'https://cdn.jsdelivr.net/npm/dplayer/dist/DPlayer.min.js' }],
+    ],
+    theme: 'vuepress-theme-dplayer',
+    themeConfig: {
+        repo: 'MoePlayer/DPlayer',
+        editLinks: true,
         docsDir: 'docs',
-        logo: '/logo.png',
-
         locales: {
             '/zh/': {
-                selectLanguageName: '简体中文',
-                navbar: [
+                lang: 'zh-CN',
+                selectText: '选择语言',
+                label: '简体中文',
+                editLinkText: '在 GitHub 上编辑此页',
+                lastUpdated: '上次更新',
+                nav: [
                     {
                         text: '指南',
                         link: '/zh/guide/',
@@ -49,8 +66,12 @@ export default defineUserConfig({
                 ],
             },
             '/': {
-                selectLanguageName: 'English',
-                navbar: [
+                lang: 'en-US',
+                selectText: 'Languages',
+                label: 'English',
+                editLinkText: 'Edit this page on GitHub',
+                lastUpdated: 'Last Updated',
+                nav: [
                     {
                         text: 'Guide',
                         link: '/guide/',
@@ -66,14 +87,5 @@ export default defineUserConfig({
                 ],
             },
         },
-    }),
-    
-    head: [
-        ['link', { rel: 'icon', href: `/logo.png` }],
-        ['script', { src: 'https://cdn.jsdelivr.net/npm/flv.js/dist/flv.min.js' }],
-        ['script', { src: 'https://cdn.jsdelivr.net/npm/hls.js/dist/hls.min.js' }],
-        ['script', { src: 'https://cdn.jsdelivr.net/npm/dashjs/dist/dash.all.min.js' }],
-        ['script', { src: 'https://cdn.jsdelivr.net/webtorrent/latest/webtorrent.min.js' }],
-        ['script', { src: 'https://cdn.jsdelivr.net/npm/dplayer/dist/DPlayer.min.js' }],
-    ],
-});
+    },
+};

+ 0 - 31
docs/.vuepress/init.ts

@@ -1,31 +0,0 @@
-// import DPlayer from '../../src/index';
-// import ElementPlus from 'element-plus';
-// import 'element-plus/dist/index.css';
-// import { library } from '@fortawesome/fontawesome-svg-core';
-// import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
-// import { faPenToSquare, faLink } from '@fortawesome/free-solid-svg-icons';
-// import { faGithub, faTwitter, faTelegram, faDiscord, faReddit } from '@fortawesome/free-brands-svg-icons';
-// import { defineClientConfig } from '@vuepress/client';
-
-// library.add(faPenToSquare, faLink, faGithub, faTwitter, faTelegram, faDiscord, faReddit);
-
-// export default defineClientConfig({
-//     enhance({ app, router, siteData }) {
-//         app.component('font-awesome-icon', FontAwesomeIcon);
-//         app.use(ElementPlus);
-
-//         // @ts-ignore
-//         if (!__VUEPRESS_SSR__) {
-//             app.config.globalProperties.Unidata = Unidata;
-//             app.config.globalProperties.unidata = new Unidata({
-//                 moralisWeb3APIKey: 'dCYUW7mpC8lJJitfSX5nsgWBREkBIb5SW1OfFlDLiV7A0v4b2vubtkpQXsBrXqt0',
-//                 alchemyEthereumAPIKey: '4h0_z1B6WEmj9hp1HJZm7ujeWZpLR6rv',
-//                 alchemyPolygonAPIKey: 'm1tznK8U8nVecA0Zime5dzF8Pb2av70q',
-//                 alchemyFlowAPIKey: 'op8m1oqlivm297iodsezvn3hoya9960u',
-//                 nftscanAPIKey: 'YdKYhj6I',
-//             });
-
-//             (<any>window).unidata = app.config.globalProperties.unidata;
-//         }
-//     },
-// });

+ 0 - 23
docs/.vuepress/styles/index.scss

@@ -1,23 +0,0 @@
-:root {
-    // brand colors
-    --c-brand: #F5712C !important;
-    --c-brand-light: #F5712C !important;
-    --c-text-accent: #F5712C !important;
-    --back-to-top-color: #F5712C !important;
-    --back-to-top-color-hover: #F5712C !important;
-
-    --el-color-primary: #F5712C !important;
-}
-
-#指南 {
-    display: none;
-}
-
-#guide {
-    display: none;
-}
-
-#dplayer {
-    margin-top: -1.5rem;
-    margin-bottom: 1rem;
-}

+ 48 - 0
docs/.vuepress/styles/index.styl

@@ -0,0 +1,48 @@
+.navbar .home-link .site-name {
+    color: #F5712C;
+}
+
+.page .custom-block.tip {
+    border-color: #F5712C;
+}
+
+.icon.outbound {
+    display: none;
+}
+
+a {
+  word-break: break-all;
+}
+
+#指南 {
+    display: none;
+}
+
+#guide {
+    display: none;
+}
+
+#app .global-ui .sw-update-popup {
+    border: 1px solid #F5712C;
+}
+
+.routes .sidebar-group-items > li > .sidebar-sub-headers > .sidebar-sub-header > a {
+    color: $accentColor;
+}
+
+#dplayer {
+    margin-top: -1.5rem;
+    margin-bottom: 1rem;
+}
+
+.hero .description {
+    display: none;
+}
+
+.hero .action {
+    display: none;
+}
+
+.hero.custom .action {
+    display: block;
+}

+ 1 - 0
docs/.vuepress/styles/palette.styl

@@ -0,0 +1 @@
+$accentColor = #F5712C

+ 3 - 3
docs/README.md

@@ -1,5 +1,7 @@
 ---
 home: true
+actionText: Get Started →
+actionLink: /guide/
 footer: MIT Licensed | Made with love by DIYgod
 ---
 
@@ -7,6 +9,4 @@ footer: MIT Licensed | Made with love by DIYgod
   <DPlayer :immediate="true"></DPlayer>
 </div>
 
-<div class="hero custom">
-<p class="actions"><a href="/guide/" class="action-button primary" aria-label="Get Started"> Get Started </a></p>
-</div>
+<div class="hero custom"><p class="action"><router-link to="/guide/" class="nav-link action-button">Get Started →</router-link></p></div>

+ 4 - 5
package.json

@@ -39,9 +39,9 @@
     "devDependencies": {
         "@babel/core": "^7.6.0",
         "@babel/preset-env": "^7.4.5",
-        "@vuepress/client": "2.0.0-beta.49",
-        "@vuepress/plugin-google-analytics": "2.0.0-beta.49",
-        "@vuepress/plugin-register-components": "2.0.0-beta.49",
+        "@vuepress/plugin-back-to-top": "1.9.7",
+        "@vuepress/plugin-google-analytics": "1.9.7",
+        "@vuepress/plugin-pwa": "1.9.7",
         "art-template": "4.13.2",
         "art-template-loader": "1.4.3",
         "autoprefixer": "^10.4.8",
@@ -69,8 +69,7 @@
         "svg-inline-loader": "0.8.2",
         "template-string-optimize-loader": "^3.0.0",
         "url-loader": "^4.1.0",
-        "vue": "^3.2.37",
-        "vuepress": "2.0.0-beta.49",
+        "vuepress": "1.9.7",
         "webpack": "^5.74.0",
         "webpack-cli": "4.10.0",
         "webpack-dev-server": "^4.10.0",

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 557 - 402
pnpm-lock.yaml


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است