Skip to content

Commit

Permalink
feat: update vitepress config & style
Browse files Browse the repository at this point in the history
  • Loading branch information
wangshunnn committed Jan 15, 2025
1 parent 9ab76c3 commit 53ced91
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 11 deletions.
21 changes: 15 additions & 6 deletions docs-vitepress/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ const sidebar = {
{ text: "状态管理(store)", link: "/guide/advance/store" },
{ text: "状态管理(pinia)", link: "/guide/advance/pinia" },
{ text: "使用 mixin", link: "/guide/advance/mixin" },
{ text: "使用npm", link: "/guide/advance/npm" },
{ text: "使用 npm", link: "/guide/advance/npm" },
{ text: "使用分包", link: "/guide/advance/subpackage" },
{ text: "分包异步化", link: "/guide/advance/async-subpackage" },
{ text: "跨平台", link: "/guide/advance/platform" },
{ text: "国际化i18n", link: "/guide/advance/i18n" },
{ text: "国际化 i18n", link: "/guide/advance/i18n" },
{ text: "包体积分析", link: "/guide/advance/size-report" },
{ text: "图像资源处理", link: "/guide/advance/image-process" },
{ text: "原生渐进迁移", link: "/guide/advance/progressive" },
Expand Down Expand Up @@ -71,7 +71,7 @@ const sidebar = {
collapsable: false,
items: [
{ text: "跨端输出基础", link: "/guide/platform/basic" },
{ text: "跨端输出RN", link: "/guide/platform/rn" },
{ text: "跨端输出 RN", link: "/guide/platform/rn" },
],
},
{
Expand Down Expand Up @@ -158,7 +158,7 @@ const sidebar = {
items: [
{ text: "滴滴开源小程序框架Mpx", link: "/articles/1.0" },
{
text: "Mpx发布2.0,完美支持跨平台开发",
text: "Mpx 发布2.0,完美支持跨平台开发",
link: "/articles/2.0",
},
{
Expand Down Expand Up @@ -209,7 +209,7 @@ const sidebar = {

const ogUrl = "https://mpxjs.cn/"
const ogImage = `${ogUrl}logo.png`
const title = "Mpx框架"
const title = "Mpx 框架"
const description = "深度性能优化的增强型小程序开发框架"

export default withPwa(
Expand Down Expand Up @@ -300,7 +300,16 @@ export default withPwa(
outline: [2, 3],
socialLinks: [{ icon: 'github', link: 'https://github.com/didi/mpx' }],
nav: [
{ text: '指南', activeMatch: '^/guide/', link: '/guide/basic/start' },
{ text: '指南', activeMatch: '^/guide/', link: '/guide/basic/start', },
// 未来热门的链接可以用下面的折叠标题
// {
// text: "文档",
// activeMatch: "^/guide/(basic/start|platform/basic)/",
// items: [
// { text: "快速开始", link: "/guide/basic/start" },
// { text: "跨端输出", link: "/guide/platform/basic" },
// ],
// },
{ text: 'API', activeMatch: '^/api/', link: '/api/' },
{ text: '文章', activeMatch: '^/articles/', link: '/articles/' },
{ text: '更新记录', activeMatch: '^/releases/', link: 'https://github.com/didi/mpx/releases', target: '_blank'},
Expand Down
3 changes: 2 additions & 1 deletion docs-vitepress/.vitepress/theme/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { h } from 'vue'
import Theme from 'vitepress/theme'
import Layout from './layouts/HomepageLayout.vue'
import RegisterSW from "./components/RegisterSW.vue";
import RegisterSW from "./components/RegisterSW.vue"
import './styles/index.css'

export default {
...Theme,
Expand Down
12 changes: 12 additions & 0 deletions docs-vitepress/.vitepress/theme/styles/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
:root {
--vt-c-text-1: #213547;
--vt-c-text-code: #476582;
--vt-c-text-3: rgba(60, 60, 60, 0.33);
--vt-c-green: #42b883;
--vt-c-divider: rgba(60, 60, 60, 0.29);
--vt-c-divider-light: rgba(60, 60, 60, 0.12);
--vt-c-green-light: #42d392;
--vt-c-green-lighter: #35eb9a;
--vt-c-green-dark: #33a06f;
--vt-c-green-darker: #155f3e;
}
4 changes: 2 additions & 2 deletions docs-vitepress/api/ApiIndex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1053,9 +1053,9 @@ h3 {
break-inside: avoid;
overflow: auto;
margin-bottom: 20px;
background-color: var(--vt-c-bg-soft);
background-color: var(--vp-c-bg-soft);
border-radius: 8px;
padding: 28px 26px;
padding: 28px 18px;
transition: background-color 0.5s;
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@types/jest": "^27.0.1",
"@typescript-eslint/eslint-plugin": "^5.2.0",
"@typescript-eslint/parser": "^5.2.0",
"@vite-pwa/vitepress": "^0.5.0",
"@vite-pwa/vitepress": "^0.5.3",
"eslint": "^7.32.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-html": "^6.2.0",
Expand All @@ -38,7 +38,7 @@
"lerna": "^8.1.8",
"stylus": "^0.63.0",
"typescript": "^4.1.3",
"vitepress": "^1.3.2"
"vitepress": "^1.5.0"
},
"workspaces": [
"packages/*",
Expand Down

0 comments on commit 53ced91

Please sign in to comment.