Skip to content

Commit

Permalink
Merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
endiliey committed Oct 26, 2019
1 parent fc94e50 commit 7d56686
Show file tree
Hide file tree
Showing 34 changed files with 330 additions and 188 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG-2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,22 @@

## Unreleased

## 2.0.0-alpha.31

- Footer is now sticky/ pinned to the bottom of the viewport in desktop browsers.
- Footer is now also displayed in docs page for consistency.
- Remove empty doc sidebar container if sidebar for a particular doc page does not exist. Otherwise, it will cause an additional empty space.
- Default PostCSS loader now only polyfills stage 3+ features (previously it was stage 2) like Create React App. Stage 2 CSS is considered relatively unstable and subject to change while Stage 3 features will likely become a standard.
- Fix search bar focus bug. When you put the focus on search input, previously the focus will remain although we have clicked to other area outside of the search input.
- New themeConfig option `sidebarCollapsible`. It is on by default. If explicitly set to `false`, all doc items in sidebar is expanded. Otherwise, it will still be a collapsible sidebar.
- Disable adding hashes to the generated class names of CSS modules in dev mode. Generating unique identifiers takes some time, which can be saved since including paths to files in class names is enough to avoid collisions.
- Update infima from 0.2.0-alpha.2 to 0.2.0-alpha.3
- Fix showing sidebar category with empty items.
- Fix pagination nav and right sidebar color contrast ratio
- Fix sidebar arrow color in dark mode
- Fix footer mobile issue
- Increase sidebar width
- etc

## 2.0.0-alpha.30

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lerna": "3.14.1",
"version": "2.0.0-alpha.30",
"version": "2.0.0-alpha.31",
"npmClient": "yarn",
"useWorkspaces": true
}
2 changes: 1 addition & 1 deletion packages/docusaurus-1.x/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "docusaurus",
"description": "Easy to Maintain Open Source Documentation Websites",
"version": "2.0.0-alpha.30",
"version": "2.0.0-alpha.31",
"license": "MIT",
"keywords": [
"documentation",
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-init/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docusaurus/init",
"version": "2.0.0-alpha.30",
"version": "2.0.0-alpha.31",
"description": "Create Docusaurus app easily",
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions packages/docusaurus-init/templates/classic/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docusaurus-2-classic-template",
"version": "2.0.0-alpha.30",
"version": "2.0.0-alpha.31",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
Expand All @@ -10,8 +10,8 @@
"deploy": "docusaurus deploy"
},
"dependencies": {
"@docusaurus/core": "^2.0.0-alpha.30",
"@docusaurus/preset-classic": "^2.0.0-alpha.30",
"@docusaurus/core": "^2.0.0-alpha.31",
"@docusaurus/preset-classic": "^2.0.0-alpha.31",
"classnames": "^2.2.6",
"react": "^16.8.4",
"react-dom": "^16.8.4"
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-mdx-loader/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docusaurus/mdx-loader",
"version": "2.0.0-alpha.30",
"version": "2.0.0-alpha.31",
"description": "Docusaurus Loader for MDX",
"main": "src/index.js",
"publishConfig": {
Expand Down
8 changes: 4 additions & 4 deletions packages/docusaurus-plugin-content-blog/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-content-blog",
"version": "2.0.0-alpha.30",
"version": "2.0.0-alpha.31",
"description": "Blog plugin for Docusaurus",
"main": "lib/index.js",
"scripts": {
Expand All @@ -11,11 +11,11 @@
},
"license": "MIT",
"devDependencies": {
"@docusaurus/types": "^2.0.0-alpha.30"
"@docusaurus/types": "^2.0.0-alpha.31"
},
"dependencies": {
"@docusaurus/mdx-loader": "^2.0.0-alpha.30",
"@docusaurus/utils": "^2.0.0-alpha.30",
"@docusaurus/mdx-loader": "^2.0.0-alpha.31",
"@docusaurus/utils": "^2.0.0-alpha.31",
"fs-extra": "^8.1.0",
"globby": "^10.0.1",
"loader-utils": "^1.2.3",
Expand Down
8 changes: 4 additions & 4 deletions packages/docusaurus-plugin-content-docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-content-docs",
"version": "2.0.0-alpha.30",
"version": "2.0.0-alpha.31",
"description": "Docs content plugin for Docusaurus",
"main": "lib/index.js",
"scripts": {
Expand All @@ -11,11 +11,11 @@
},
"license": "MIT",
"devDependencies": {
"@docusaurus/types": "^2.0.0-alpha.30"
"@docusaurus/types": "^2.0.0-alpha.31"
},
"dependencies": {
"@docusaurus/mdx-loader": "^2.0.0-alpha.30",
"@docusaurus/utils": "^2.0.0-alpha.30",
"@docusaurus/mdx-loader": "^2.0.0-alpha.31",
"@docusaurus/utils": "^2.0.0-alpha.31",
"cross-spawn": "^7.0.1",
"fs-extra": "^8.1.0",
"globby": "^10.0.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/docusaurus-plugin-content-pages/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-content-pages",
"version": "2.0.0-alpha.30",
"version": "2.0.0-alpha.31",
"description": "Pages content plugin for Docusaurus",
"main": "lib/index.js",
"scripts": {
Expand All @@ -11,8 +11,8 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/types": "^2.0.0-alpha.30",
"@docusaurus/utils": "^2.0.0-alpha.30",
"@docusaurus/types": "^2.0.0-alpha.31",
"@docusaurus/utils": "^2.0.0-alpha.31",
"globby": "^10.0.1"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-plugin-google-analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-google-analytics",
"version": "2.0.0-alpha.30",
"version": "2.0.0-alpha.31",
"description": "Global analytics (analytics.js) plugin for Docusaurus",
"main": "src/index.js",
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-plugin-google-gtag/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-google-gtag",
"version": "2.0.0-alpha.30",
"version": "2.0.0-alpha.31",
"description": "Global Site Tag (gtag.js) plugin for Docusaurus",
"main": "src/index.js",
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-plugin-ideal-image/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-ideal-image",
"version": "2.0.0-alpha.30",
"version": "2.0.0-alpha.31",
"description": "Docusaurus Plugin to generate an almost ideal image (responsive, lazy-loading, and low quality placeholder)",
"main": "src/index.js",
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-plugin-sitemap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docusaurus/plugin-sitemap",
"version": "2.0.0-alpha.30",
"version": "2.0.0-alpha.31",
"description": "Simple sitemap generation plugin for Docusaurus",
"main": "src/index.js",
"publishConfig": {
Expand Down
18 changes: 9 additions & 9 deletions packages/docusaurus-preset-classic/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"name": "@docusaurus/preset-classic",
"version": "2.0.0-alpha.30",
"version": "2.0.0-alpha.31",
"description": "Preset for classic Docusaurus",
"main": "src/index.js",
"publishConfig": {
"access": "public"
},
"license": "MIT",
"dependencies": {
"@docusaurus/plugin-content-blog": "^2.0.0-alpha.30",
"@docusaurus/plugin-content-docs": "^2.0.0-alpha.30",
"@docusaurus/plugin-content-pages": "^2.0.0-alpha.30",
"@docusaurus/plugin-google-analytics": "^2.0.0-alpha.30",
"@docusaurus/plugin-google-gtag": "^2.0.0-alpha.30",
"@docusaurus/plugin-sitemap": "^2.0.0-alpha.30",
"@docusaurus/theme-classic": "^2.0.0-alpha.30",
"@docusaurus/theme-search-algolia": "^2.0.0-alpha.30"
"@docusaurus/plugin-content-blog": "^2.0.0-alpha.31",
"@docusaurus/plugin-content-docs": "^2.0.0-alpha.31",
"@docusaurus/plugin-content-pages": "^2.0.0-alpha.31",
"@docusaurus/plugin-google-analytics": "^2.0.0-alpha.31",
"@docusaurus/plugin-google-gtag": "^2.0.0-alpha.31",
"@docusaurus/plugin-sitemap": "^2.0.0-alpha.31",
"@docusaurus/theme-classic": "^2.0.0-alpha.31",
"@docusaurus/theme-search-algolia": "^2.0.0-alpha.31"
},
"peerDependencies": {
"@docusaurus/core": "^2.0.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/docusaurus-theme-classic/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docusaurus/theme-classic",
"version": "2.0.0-alpha.30",
"version": "2.0.0-alpha.31",
"description": "Classic theme for Docusaurus",
"main": "src/index.js",
"publishConfig": {
Expand All @@ -12,7 +12,7 @@
"@mdx-js/react": "^1.5.1",
"classnames": "^2.2.6",
"clipboard": "^2.0.4",
"infima": "0.2.0-alpha.2",
"infima": "0.2.0-alpha.3",
"prism-react-renderer": "^1.0.2",
"react-toggle": "^4.1.1"
},
Expand Down
75 changes: 41 additions & 34 deletions packages/docusaurus-theme-classic/src/theme/DocSidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,35 @@ function DocSidebarItem({item, onItemClick, collapsible}) {
switch (type) {
case 'category':
return (
<li
className={classnames('menu__list-item', {
'menu__list-item--collapsed': collapsed,
})}
key={label}>
<a
className={classnames('menu__link', {
'menu__link--sublist': collapsible,
'menu__link--active': collapsible && !item.collapsed,
items.length > 0 && (
<li
className={classnames('menu__list-item', {
'menu__list-item--collapsed': collapsed,
})}
href="#!"
onClick={collapsible ? () => setCollapsed(!collapsed) : undefined}>
{label}
</a>
<ul className="menu__list">
{items.map(childItem => (
<DocSidebarItem
key={childItem.label}
item={childItem}
onItemClick={onItemClick}
collapsible={collapsible}
/>
))}
</ul>
</li>
key={label}>
<a
className={classnames('menu__link', {
'menu__link--sublist': collapsible,
'menu__link--active': collapsible && !item.collapsed,
})}
href="#!"
onClick={
collapsible ? () => setCollapsed(!collapsed) : undefined
}>
{label}
</a>
<ul className="menu__list">
{items.map(childItem => (
<DocSidebarItem
key={childItem.label}
item={childItem}
onItemClick={onItemClick}
collapsible={collapsible}
/>
))}
</ul>
</li>
)
);

case 'link':
Expand Down Expand Up @@ -164,16 +168,19 @@ function DocSidebar(props) {
)}
</button>
<ul className="menu__list">
{sidebarData.map(item => (
<DocSidebarItem
key={item.label}
item={item}
onItemClick={() => {
setShowResponsiveSidebar(false);
}}
collapsible={sidebarCollapsible}
/>
))}
{sidebarData.map(
item =>
item.items.length > 0 && (
<DocSidebarItem
key={item.label}
item={item}
onItemClick={() => {
setShowResponsiveSidebar(false);
}}
collapsible={sidebarCollapsible}
/>
),
)}
</ul>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions packages/docusaurus-theme-classic/src/theme/Navbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function Navbar() {
</Head>
<nav
className={classnames('navbar', 'navbar--light', 'navbar--fixed-top', {
'navbar--sidebar-show': sidebarShown,
'navbar-sidebar--show': sidebarShown,
})}>
<div className="navbar__inner">
<div className="navbar__items">
Expand Down Expand Up @@ -165,13 +165,13 @@ function Navbar() {
</div>
<div
role="presentation"
className="navbar__sidebar__backdrop"
className="navbar-sidebar__backdrop"
onClick={() => {
setSidebarShown(false);
}}
/>
<div className="navbar__sidebar">
<div className="navbar__sidebar__brand">
<div className="navbar-sidebar">
<div className="navbar-sidebar__brand">
<Link className="navbar__brand" onClick={hideSidebar} to={baseUrl}>
{logo != null && (
<img className="navbar__logo" src={logoUrl} alt={logo.alt} />
Expand All @@ -190,7 +190,7 @@ function Navbar() {
/>
)}
</div>
<div className="navbar__sidebar__items">
<div className="navbar-sidebar__items">
<div className="menu">
<ul className="menu__list">
{links.map((linkItem, i) => (
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-theme-live-codeblock/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docusaurus/theme-live-codeblock",
"version": "2.0.0-alpha.30",
"version": "2.0.0-alpha.31",
"description": "Docusaurus Live CodeBlock",
"main": "src/index.js",
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-theme-search-algolia/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docusaurus/theme-search-algolia",
"version": "2.0.0-alpha.30",
"version": "2.0.0-alpha.31",
"description": "Algolia search component for Docusaurus",
"main": "src/index.js",
"publishConfig": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const Search = props => {
placeholder="Search"
aria-label="Search"
className={classnames(
'navbar__search-input',
{'search-bar-expanded': props.isSearchBarExpanded},
{'search-bar': !props.isSearchBarExpanded},
)}
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docusaurus/types",
"version": "2.0.0-alpha.30",
"version": "2.0.0-alpha.31",
"description": "Common used typings for Docusaurus packages",
"main": "./src/index.js",
"types": "./src/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-types/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export interface Plugin<T> {
getThemePath?(): string;
getPathsToWatch?(): string[];
getClientModules?(): string[];
extendCli?(cli: CommanderStatic): any;
extendCli?(cli: CommanderStatic): void;
}

export type PluginConfig = [string, Object] | [string] | string;
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docusaurus/utils",
"version": "2.0.0-alpha.30",
"version": "2.0.0-alpha.31",
"description": "Node utility functions for Docusaurus packages",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
Expand Down
Loading

0 comments on commit 7d56686

Please sign in to comment.