Skip to content

Commit

Permalink
Merge branch 'main' into theme-hope
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Feb 6, 2024
2 parents 27c303e + bb402b9 commit 9724922
Show file tree
Hide file tree
Showing 21 changed files with 587 additions and 519 deletions.
19 changes: 16 additions & 3 deletions docs/.vuepress/configs/navbar/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const enNavbar = navbar([
prefix: '/reference/',
children: [
{
text: 'VuePress',
text: 'Core',
children: [
{
text: 'CLI',
Expand All @@ -48,6 +48,19 @@ export const enNavbar = navbar([
prefix: 'bundler/',
children: ['vite', 'webpack'],
},
{
text: 'Ecosystem',
children: [
{
text: 'Default Theme',
link: 'https://ecosystem.vuejs.press/themes/default/',
},
{
text: 'Plugins',
link: 'https://ecosystem.vuejs.press/plugins/',
},
],
},
],
},

Expand All @@ -72,11 +85,11 @@ export const enNavbar = navbar([
text: 'Resources',
children: [
{
text: 'Official Ecosystem',
text: 'Ecosystem',
link: 'https://ecosystem.vuejs.press/',
},
{
text: 'VuePress MarketPlace',
text: 'MarketPlace',
link: 'https://marketplace.vuejs.press',
},
{
Expand Down
19 changes: 16 additions & 3 deletions docs/.vuepress/configs/navbar/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const zhNavbar = navbar([
prefix: '/zh/reference/',
children: [
{
text: 'VuePress',
text: '核心',
children: [
'cli',
'config',
Expand All @@ -44,6 +44,19 @@ export const zhNavbar = navbar([
prefix: 'bundler/',
children: ['vite', 'webpack'],
},
{
text: '生态系统',
children: [
{
text: '默认主题',
link: 'https://ecosystem.vuejs.press/zh/themes/default/',
},
{
text: '插件',
link: 'https://ecosystem.vuejs.press/zh/plugins/',
},
],
},
],
},
{
Expand All @@ -67,11 +80,11 @@ export const zhNavbar = navbar([
text: '其他资源',
children: [
{
text: '官方生态系统',
text: '生态系统',
link: 'https://ecosystem.vuejs.press/zh/',
},
{
text: 'VuePress 市场',
text: '市场',
link: 'https://marketplace.vuejs.press/zh/',
},
{
Expand Down
56 changes: 33 additions & 23 deletions docs/.vuepress/configs/sidebar/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ export const enSidebar = sidebar({
{
text: 'Guide',
children: [
'/guide/introduction.md',
'/guide/getting-started.md',
'/guide/configuration.md',
'/guide/page.md',
'/guide/markdown.md',
'/guide/assets.md',
'/guide/i18n.md',
'/guide/deployment.md',
'/guide/theme.md',
'/guide/plugin.md',
'/guide/bundler.md',
'/guide/migration.md',
'/guide/troubleshooting.md',
'introduction',
'getting-started',
'configuration',
'page',
'markdown',
'assets',
'i18n',
'deployment',
'theme',
'plugin',
'bundler',
'migration',
'troubleshooting',
],
},
],
Expand All @@ -43,7 +43,7 @@ export const enSidebar = sidebar({
],
'/reference/': [
{
text: 'VuePress Reference',
text: 'Core',
icon: 'fa6-brands:vuejs',
collapsible: true,
children: [
Expand All @@ -58,21 +58,31 @@ export const enSidebar = sidebar({
],
},
{
text: 'Bundlers Reference',
text: 'Bundlers',
icon: 'fa6-solid:boxes-packing',
prefix: 'bundler/',
collapsible: true,
children: ['vite', 'webpack'],
},
{
text: 'Official Ecosystem',
icon: 'fa6-solid:leaf',
link: 'https://ecosystem.vuejs.press/',
},
{
text: 'VuePress MarketPlace',
icon: 'fa6-solid:cart-shopping',
link: 'https://marketplace.vuejs.press',
text: 'Ecosystem',
children: [
{
text: 'Default Theme',
icon: 'fa6-solid:leaf',
link: 'https://ecosystem.vuejs.press/themes/default/',
},
{
text: 'Plugins',
icon: 'fa6-solid:puzzle-piece',
link: 'https://ecosystem.vuejs.press/plugins/',
},
{
text: 'VuePress MarketPlace',
icon: 'fa6-solid:cart-shopping',
link: 'https://marketplace.vuejs.press',
},
],
},
],
})
71 changes: 41 additions & 30 deletions docs/.vuepress/configs/sidebar/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ export const zhSidebar = sidebar({
{
text: '指南',
children: [
'/zh/guide/introduction.md',
'/zh/guide/getting-started.md',
'/zh/guide/configuration.md',
'/zh/guide/page.md',
'/zh/guide/markdown.md',
'/zh/guide/assets.md',
'/zh/guide/i18n.md',
'/zh/guide/deployment.md',
'/zh/guide/theme.md',
'/zh/guide/plugin.md',
'/zh/guide/bundler.md',
'/zh/guide/migration.md',
'/zh/guide/troubleshooting.md',
'introduction',
'getting-started',
'configuration',
'page',
'markdown',
'assets',
'i18n',
'deployment',
'theme',
'plugin',
'bundler',
'migration',
'troubleshooting',
],
},
],
Expand All @@ -43,36 +43,47 @@ export const zhSidebar = sidebar({
],
'/zh/reference/': [
{
text: 'VuePress 参考',
text: '核心',
icon: 'fa6-brands:vuejs',
collapsible: true,
children: [
'/zh/reference/cli',
'/zh/reference/config',
'/zh/reference/frontmatter',
'/zh/reference/components',
'/zh/reference/plugin-api',
'/zh/reference/theme-api',
'/zh/reference/client-api',
'/zh/reference/node-api',
'cli',
'config',
'frontmatter',
'components',
'plugin-api',
'theme-api',
'client-api',
'node-api',
],
},
{
text: '打包工具参考',
text: '打包工具',
icon: 'fa6-solid:boxes-packing',
prefix: 'bundler/',
collapsible: true,
children: ['vite', 'webpack'],
},
{
text: '官方生态系统',
text: '生态系统',
icon: 'fa6-solid:leaf',
link: 'https://ecosystem.vuejs.press/zh/',
},
{
text: 'VuePress 市场',
icon: 'fa6-solid:cart-shopping',
link: 'https://marketplace.vuejs.press/zh/',
children: [
{
text: '默认主题',
icon: 'fa6-solid:palette',
link: 'https://ecosystem.vuejs.press/zh/themes/default/',
},
{
text: '插件',
icon: 'fa6-solid:puzzle-piece',
link: 'https://ecosystem.vuejs.press/zh/plugins/',
},
{
text: '市场',
icon: 'fa6-solid:cart-shopping',
link: 'https://marketplace.vuejs.press/zh/',
},
],
},
],
})
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion docs/.vuepress/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export default hopeTheme({
iconAssets: 'iconify',

logo: '/images/hero.png',
repo: 'vuepress/docs',
repo: 'vuepress/core',
docsRepo: 'vuepress/docs',
docsDir: 'docs',

locales: {
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ icon: fa6-solid:folder-tree
The above figure shows a brief overview of the VuePress architecture:

- Node App will generate temp files, including the pages, routes, etc.
- Bundler will handle Client App together with the temp files, just like a common Vue SPA.
- Bundler will handle Client App together with the temp files, just like a common Vue app.

As a developer, you must be aware of that VuePress has two main parts: **Node App** and **Client App**, which is important when developing plugins and themes:

Expand Down
14 changes: 7 additions & 7 deletions docs/guide/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ Take our documentation source files as an example:

```vue
<template>
<RouterLink to="/">Home</RouterLink>
<RouterLink to="/reference/config.html">Config Reference</RouterLink>
<RouterLink to="/guide/getting-started.html">Getting Started</RouterLink>
<RouterLink to="/guide/introduction.html">Guide &gt; Introduction</RouterLink>
<RouterLink to="/reference/config.html#links">
<RouteLink to="/">Home</RouteLink>
<RouteLink to="/reference/config.html">Config Reference</RouteLink>
<RouteLink to="/guide/getting-started.html">Getting Started</RouteLink>
<RouteLink to="/guide/introduction.html">Guide &gt; Introduction</RouteLink>
<RouteLink to="/reference/config.html#links">
Config Reference &gt; markdown.links
</RouterLink>
</RouteLink>
<a href="https://github.com" target="_blank" rel="noopener noreferrer">
GitHub
</a>
Expand All @@ -95,7 +95,7 @@ Take our documentation source files as an example:

**Explanation**

- Internal links will be converted to `<RouterLink>` for SPA navigation.
- Internal links will be converted to [RouteLink](../reference/components.md#routelink) for SPA navigation.
- Internal links to `.md` files will be converted to the [page route path](./page.md#routing), and both absolute path and relative path are supported.
- External links will get `target="_blank" rel="noopener noreferrer"` attrs.

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ See the bundler reference for how to configure bundlers properly:

See the default theme reference for how to configure the default theme properly:

- [Default Theme > Config](https://ecosystem.vuejs.press/themes/default/config.html)
- [Default Theme > Config](https://ecosystem.vuejs.press/themes/default/)
39 changes: 35 additions & 4 deletions docs/reference/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,54 @@ icon: fa6-solid:puzzle-piece

- Props:

- pageKey
- path
- Type: `string`
- Required: `false`

- Usage:

```md
<Content page-key="v-xxxxxx" />
<Content path="/path/to/page.md" />
```

- Details:

This component will render the Markdown content of a page.

The page key is the [name](https://router.vuejs.org/api/#name-2) of the page route. If the `pageKey` prop is not provided, it will render the page of current route.
If the `path` prop is not provided, it will render the page content of current route.

This component is mainly for developing themes. You won't need it in most cases.

- Also see:
- [Node API > Page Properties > key](./node-api.md#key)
- [Node API > Page Properties > path](./node-api.md#path)

## RouteLink

- Props:

- to
- Type: `string`
- Required: `true`
- active
- Type: `boolean`
- Required: `false`
- Default: `false`
- activeClass
- Type: `string`
- Required: `false`
- Default: `'route-link-active'`

- Usage:

```md
<RouteLink to="/path/to/target-page.md">target page</RouteLink>
<RouteLink active to="/path/to/current-page.md">current page</RouteLink>
```

- Details:

This component will render a link to the target page.

If the `active` prop is set to `true`, the link will have an extra `activeClass`. Notice that the active status won't be updated automatically when the route changes.

This component is mainly for developing themes. You won't need it in most cases. For theme authors, it's recommended to use this component instead of the `<RouterLink>` component from `vue-router`.
Loading

0 comments on commit 9724922

Please sign in to comment.