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: website-1.x/blog/2019-12-30-docusaurus-2019-recap.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ tags: [recap]
16
16
17
17
In 2018, we proposed to rebuild [Docusaurus from the ground up](https://github.com/facebook/docusaurus/issues/789). It involved a major rearchitecture effort - we created a content-centric CSS framework from scratch, a plugins system, and moved from static HTML pages to be a single page-app with prerendered routes. It was a wild adventure and a tough feat, especially with no dedicated FTE working on the project. With the help of [@endilie](https://github.com/endiliey), our ex-intern-turned-contributor-turned-maintainer, we made really good progress on D2 and are currently on version 2.0.0-alpha.40. All features in Docusaurus 1 except for translations have been ported over.
18
18
19
-
D2's killer features are **Dark Mode** and its **superb performance**. D2 has dark mode support out-of-the-box and its near effortless to create a dark mode-friendly documentation site. Endilie put in great effort into optimizing the performance of the site and a bunch of performance optimization tricks have been done under the hood by default - optimized images, prerendering every route to static HTML and client-side routing thereafter, prefetching assets needed by future navigations whenever the user hovers over a navigation link, etc.
19
+
D2's killer features are **Dark Mode** and its **superb performance**. D2 has dark mode support out-of-the-box and it is near effortless to create a dark mode-friendly documentation site. Endilie put in great effort into optimizing the performance of the site and a bunch of performance optimization tricks have been done under the hood by default - optimized images, prerendering every route to static HTML and client-side routing thereafter, prefetching assets needed by future navigations whenever the user hovers over a navigation link, etc.
20
20
21
21
Last but not least, we implemented a plugins architecture and turned the repo into a [Lerna monorepo](https://github.com/facebook/docusaurus/tree/master/packages). We believe this plugin architecture will be helpful towards building a community and also allowing users to build their own features for their unique use cases.
To remove the ability to switch on dark mode, there is an option `themeConfig.disableDarkMode`, which is implicitly set to `false`.
13
13
14
-
```js
14
+
```js {5}
15
15
// docusaurus.config.js
16
16
module.exports= {
17
17
...
@@ -26,15 +26,13 @@ module.exports = {
26
26
27
27
You can configure a default image that will be used for your meta tag, in particular `og:image` and `twitter:image`.
28
28
29
-
```js
29
+
```js {5-7}
30
30
// docusaurus.config.js
31
31
module.exports= {
32
32
...
33
33
themeConfig: {
34
-
/**
35
-
* Relative to your site's "static" directory.
36
-
* Cannot be SVGs. Can be external URLs too.
37
-
*/
34
+
// Relative to your site's "static" directory.
35
+
// Cannot be SVGs. Can be external URLs too.
38
36
image:'img/docusaurus.png',
39
37
...
40
38
},
@@ -47,7 +45,7 @@ module.exports = {
47
45
48
46
You can add a logo and title to the navbar via `themeConfig.navbar`. Logo can be placed in [static folder](static-assets.md). Logo URL is set to base URL of your site by default. Although you can specify your own URL for the logo, if it is an external link, it will open in a new tab. You can also set a different logo for dark mode.
49
47
50
-
```js
48
+
```js {6-12}
51
49
// docusaurus.config.js
52
50
module.exports= {
53
51
...
@@ -70,7 +68,7 @@ module.exports = {
70
68
71
69
You can add links to the navbar via `themeConfig.navbar.links`:
72
70
73
-
```js
71
+
```js {6-16}
74
72
// docusaurus/config.js
75
73
module.exports= {
76
74
...
@@ -81,6 +79,9 @@ module.exports = {
81
79
to:'docs/docusaurus.config.js',
82
80
label:'docusaurus.config.js',
83
81
position:'left',
82
+
// To apply the active class styling on all
83
+
// routes starting with this path.
84
+
activeBasePath:'docs',
84
85
},
85
86
// ... other links
86
87
],
@@ -90,13 +91,13 @@ module.exports = {
90
91
}
91
92
```
92
93
93
-
Outbound links automatically get `target="_blank" rel="noopener noreferrer"`.
94
+
Outbound links automatically get `target="_blank" rel="noopener noreferrer"` attributes.
94
95
95
96
### Auto-hide sticky navbar
96
97
97
98
You can enable this cool UI feature that automatically hides the navbar when a user starts scrolling down the page, and show it again when the user scrolls up.
98
99
99
-
```js
100
+
```js {6}
100
101
// docusaurus/config.js
101
102
module.exports= {
102
103
...
@@ -137,7 +138,7 @@ module.exports = {
137
138
138
139
You can set a default language for code blocks if no language is added after the opening triple backticks (i.e. ```). Note that a valid [language name](https://prismjs.com/#supported-languages) must be passed, e.g.:
0 commit comments