You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/docs/docs/theme/default-theme-config.md
+8
Original file line number
Diff line number
Diff line change
@@ -86,6 +86,7 @@ module.exports = {
86
86
These links can also be dropdown menus if you provide an array of `items` instead of a `link`:
87
87
88
88
```js
89
+
// .vuepress/config.js
89
90
module.exports= {
90
91
themeConfig: {
91
92
nav: [
@@ -105,6 +106,7 @@ module.exports = {
105
106
You can also have sub groups inside a dropdown by having nested items:
106
107
107
108
```js
109
+
// .vuepress/config.js
108
110
module.exports= {
109
111
themeConfig: {
110
112
nav: [
@@ -177,6 +179,7 @@ sidebarDepth: 2
177
179
The sidebar only displays links for headers in the current active page. You can display all header links for every page with `themeConfig.displayAllHeaders: true`:
178
180
179
181
```js
182
+
// .vuepress/config.js
180
183
module.exports= {
181
184
themeConfig: {
182
185
displayAllHeaders:true// Default: false
@@ -189,6 +192,7 @@ module.exports = {
189
192
By default, the nested header links and the hash in the URL are updated as the user scrolls to view the different sections of the page. This behavior can be disabled with the following theme config:
190
193
191
194
```js
195
+
// .vuepress/config.js
192
196
module.exports= {
193
197
themeConfig: {
194
198
activeHeaderLinks:false, // Default: true
@@ -346,6 +350,7 @@ sidebar: false
346
350
You can disable the built-in search box with `themeConfig.search: false`, and customize how many suggestions will be shown with `themeConfig.searchMaxSuggestions`:
347
351
348
352
```js
353
+
// .vuepress/config.js
349
354
module.exports= {
350
355
themeConfig: {
351
356
search:false,
@@ -383,6 +388,7 @@ If you need full text search, you can use [Algolia Search](#algolia-search).
383
388
The `themeConfig.algolia` option allows you to use [Algolia DocSearch](https://community.algolia.com/docsearch/) to replace the simple built-in search. To enable it, you need to provide at least `apiKey` and `indexName`:
384
389
385
390
```js
391
+
// .vuepress/config.js
386
392
module.exports= {
387
393
themeConfig: {
388
394
algolia: {
@@ -404,6 +410,7 @@ For more options, check out [Algolia DocSearch’s documentation](https://github
404
410
You can define a placeholder for the search box by adding the `searchPlaceholder` attribute:
405
411
406
412
```js
413
+
// .vuepress/config.js
407
414
module.exports= {
408
415
themeConfig: {
409
416
searchPlaceholder:'Search...'
@@ -416,6 +423,7 @@ module.exports = {
416
423
The `themeConfig.lastUpdated` option allows you to get the UNIX timestamp(ms) of each file’s last `git` commit, and it will also display at the bottom of each page in an appropriate format:
Copy file name to clipboardExpand all lines: packages/docs/docs/theme/inheritance.md
+4-3
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,7 @@ For now theme inheritance doesn’t support high-order inheritance, that means,
28
28
Suppose you want to create a theme inherited from the default theme, you only need to configure the [extend](./option-api.md#extend) option in your theme configuration:
29
29
30
30
```js
31
+
// .vuepress/theme/index.js
31
32
module.exports= {
32
33
extend:'@vuepress/theme-default'
33
34
}
@@ -79,7 +80,7 @@ module.exports = {
79
80
The child theme can edit the options of plugin in the following ways:
80
81
81
82
```js
82
-
//themePath/index.js
83
+
//.vuepress/theme/index.js
83
84
module.exports= {
84
85
plugins: [
85
86
['@vuepress/search', {
@@ -92,7 +93,7 @@ module.exports = {
92
93
Child theme can even disable it:
93
94
94
95
```js
95
-
//themePath/index.js
96
+
//.vuepress/theme/index.js
96
97
module.exports= {
97
98
plugins: [
98
99
['@vuepress/search', false]
@@ -160,7 +161,7 @@ This way, you can "tamper" with some part of an atomic theme.
160
161
You can use `@parent-theme` to access the root path of the parent theme. The following example shows creating a layout component with the same name in a child theme and using slots in the parent theme. [@vuepress/theme-vue](https://github.com/vuejs/vuepress/tree/master/packages/%40vuepress/theme-vue) is created in this way.
As with plugins, the theme configuration file `themeEntry` should export a `plain JavaScript object`(`#1`). If the plugin needs to take options, it can be a function that exports a plain object(`#2`). The function will be called with the `siteConfig.themeConfig` as the first argument, along with [ctx](../plugin/context-api.md) which provides some compile-time metadata.
8
8
9
9
```js
10
+
// .vuepress/theme/index.js
10
11
// #1
11
12
module.exports= {
12
13
// ...
13
14
}
14
15
```
15
16
16
17
```js
18
+
// .vuepress/theme/index.js
17
19
// #2
18
20
module.exports= (themeConfig, ctx) => {
19
21
return {
@@ -68,6 +70,7 @@ HTML template path used in `build` mode, default template see [here](https://git
68
70
- Default: undefined
69
71
70
72
```js
73
+
// .vuepress/theme/index.js
71
74
module.exports= {
72
75
extend:'@vuepress/theme-default'
73
76
}
@@ -86,7 +89,7 @@ VuePress provides the ability to inherit one theme from another. VuePress will f
86
89
- Default: undefined
87
90
88
91
```js
89
-
//themePath/index.js
92
+
//.vuepress/theme/index.js
90
93
module.exports= {
91
94
globalLayout:'/path/to/your/global/vue/sfc'
92
95
}
@@ -97,7 +100,7 @@ Global layout component is a component responsible for the global layout strateg
97
100
For example, when you want to set a global header and footer for your theme, you can do this:
0 commit comments