Skip to content

Commit

Permalink
docs: refine plugin's doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz committed Oct 25, 2018
1 parent fd51d43 commit aa3ad68
Show file tree
Hide file tree
Showing 16 changed files with 1,408 additions and 1,461 deletions.
25 changes: 22 additions & 3 deletions packages/docs/docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ module.exports = {
lastUpdated: 'Last Updated',
nav: require('./nav/en'),
sidebar: {
'/guide/': genSidebarConfig('Guide', 'Advanced')
'/guide/': getGuideSidebar('Guide', 'Advanced'),
'/plugin/': getPluginSidebar('Plugin', 'Introduction')
}
},
'/zh/': {
Expand All @@ -52,7 +53,8 @@ module.exports = {
lastUpdated: '上次更新',
nav: require('./nav/zh'),
sidebar: {
'/zh/guide/': genSidebarConfig('指南', '深入')
'/zh/guide/': getGuideSidebar('指南', '深入'),
'/zh/plugin/': getPluginSidebar('插件', '介绍')
}
}
}
Expand All @@ -71,7 +73,7 @@ module.exports = {
clientRootMixin: path.resolve(__dirname, 'mixin.js')
}

function genSidebarConfig (gruopA, groupB) {
function getGuideSidebar (gruopA, groupB) {
return [
{
title: gruopA,
Expand All @@ -98,3 +100,20 @@ function genSidebarConfig (gruopA, groupB) {
}
]
}

function getPluginSidebar (gruopA, introduction) {
return [
{
title: gruopA,
collapsable: false,
children: [
['', introduction],
'writing-a-plugin',
'using-a-plugin',
'life-cycle',
'option-api',
'context-api',
]
},
]
}
27 changes: 1 addition & 26 deletions packages/docs/docs/.vuepress/nav/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,7 @@ module.exports = [
},
{
text: 'Plugin',
items: [
{
text: 'Write a plugin',
link: '/plugin/#writing-a-plugin'
},
{
text: 'Using a plugin',
link: '/plugin/#using-a-plugin'
},
{
text: 'Life Cycle API',
link: '/plugin/#life-cycle-api'
},
{
text: 'Option API',
link: '/plugin/#option-api'
},
{
text: 'Context API',
link: '/plugin/#context-api'
},
{
text: 'Official Plugins',
link: '/plugin/official.html'
}
]
link: '/plugin/'
},
{
text: 'Theme',
Expand Down
27 changes: 1 addition & 26 deletions packages/docs/docs/.vuepress/nav/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,7 @@ module.exports = [
},
{
text: '插件',
items: [
{
text: '开发插件',
link: '/zh/plugin/#writing-a-plugin'
},
{
text: '使用插件',
link: '/zh/plugin/#using-a-plugin'
},
{
text: '生命周期',
link: '/zh/plugin/#life-cycle-api'
},
{
text: 'Option API',
link: '/zh/plugin/#option-api'
},
{
text: 'Context API',
link: '/zh/plugin/#context-api'
},
{
text: '官方插件',
link: '/zh/plugin/official.html'
}
]
link: '/zh/plugin/'
},
{
text: '主题',
Expand Down
Loading

0 comments on commit aa3ad68

Please sign in to comment.