Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yangshun committed Feb 21, 2020
1 parent 9dba46e commit 16b5f10
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = {
label: 'Docs',
position: 'left',
},
{to: 'blog', activeBasePath: 'blog', label: 'Blog', position: 'left'},
{to: 'blog', label: 'Blog', position: 'left'},
{
href: 'https://github.com/facebook/docusaurus',
label: 'GitHub',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = {
label: 'Docs',
position: 'left',
},
{to: 'blog', activeBasePath: 'blog', label: 'Blog', position: 'left'},
{to: 'blog', label: 'Blog', position: 'left'},
// Please keep GitHub link to the right for consistency.
{
href: 'https://github.com/facebook/docusaurus',
Expand Down
14 changes: 6 additions & 8 deletions packages/docusaurus-theme-classic/src/theme/Navbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ import styles from './styles.module.css';
function NavLink({activeBasePath, to, href, label, position, ...props}) {
const toUrl = useBaseUrl(to);
const activeBaseUrl = useBaseUrl(activeBasePath);
const activeBaseProps =
activeBasePath != null
? {
isActive: (_match, location) =>
location.pathname.startsWith(activeBaseUrl),
}
: {};

return (
<Link
Expand All @@ -44,7 +37,12 @@ function NavLink({activeBasePath, to, href, label, position, ...props}) {
: {
activeClassName: 'navbar__link--active',
to: toUrl,
...activeBaseProps,
...(activeBasePath
? {
isActive: (_match, location) =>
location.pathname.startsWith(activeBaseUrl),
}
: null),
})}
{...props}>
{label}
Expand Down
2 changes: 1 addition & 1 deletion website-1.x/blog/2019-12-30-docusaurus-2019-recap.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tags: [recap]

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.

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.
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.

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.

Expand Down
2 changes: 1 addition & 1 deletion website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ module.exports = {
label: 'Docs',
position: 'left',
},
{to: 'blog', activeBasePath: 'blog', label: 'Blog', position: 'left'},
{to: 'blog', label: 'Blog', position: 'left'},
{to: 'showcase', label: 'Showcase', position: 'left'},
{to: 'feedback', label: 'Feedback', position: 'left'},
{
Expand Down

0 comments on commit 16b5f10

Please sign in to comment.