Skip to content

Commit

Permalink
Revert "docs: upgrade vuepress"
Browse files Browse the repository at this point in the history
This reverts commit 7808f5c.
  • Loading branch information
DIYgod committed Aug 15, 2022
1 parent 7808f5c commit 5e54f83
Show file tree
Hide file tree
Showing 9 changed files with 6,328 additions and 936 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ DPlayer.log*
wxw
.vscode
package-lock.json
docs/.vuepress/dist
docs/.vuepress/.cache
docs/.vuepress/.temp
docs/.vuepress/dist
88 changes: 50 additions & 38 deletions docs/.vuepress/config.ts → docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -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/',
Expand All @@ -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/',
Expand All @@ -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' }],
],
});
},
};
31 changes: 0 additions & 31 deletions docs/.vuepress/init.ts

This file was deleted.

23 changes: 0 additions & 23 deletions docs/.vuepress/styles/index.scss

This file was deleted.

48 changes: 48 additions & 0 deletions docs/.vuepress/styles/index.styl
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions docs/.vuepress/styles/palette.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$accentColor = #F5712C
6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
home: true
actionText: Get Started →
actionLink: /guide/
footer: MIT Licensed | Made with love by DIYgod
---

<div>
<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>
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Loading

0 comments on commit 5e54f83

Please sign in to comment.