Skip to content

Commit

Permalink
Merge branch 'master' into feat/navbar-active-base-path
Browse files Browse the repository at this point in the history
  • Loading branch information
lex111 authored May 17, 2020
2 parents 0752d9a + 063484a commit 6839fa0
Show file tree
Hide file tree
Showing 170 changed files with 2,071 additions and 5,320 deletions.
36 changes: 36 additions & 0 deletions CHANGELOG-2.x.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# Docusaurus 2 Changelog

## 2.0.0-alpha.55

#### :boom: Breaking Change

- `infima`
- The following Infima classes have been renamed for consistency:

- `page-item``pagination__item`
- `pagination-nav__link--label``pagination-nav__label`
- `pagination-nav__link--sublabel``pagination-nav__sublabel`
- `tab-item``tabs__item`
- `tab-item--active``tabs__item--active`

If you have swizzled components, you need to replace these class names.

## 2.0.0-alpha.54

**HOTFIX for 2.0.0-alpha.53**.

#### :bug: Bug Fix

- `docusaurus-theme-classic`
- [#2688](https://github.com/facebook/docusaurus/pull/2688) fix(v2): add default value for options in theme classic ([@lex111](https://github.com/lex111))
- `docusaurus-module-type-aliases`
- [#2687](https://github.com/facebook/docusaurus/pull/2687) fix(v2): Add all webpack module aliases to type declaration file ([@SamChou19815](https://github.com/SamChou19815))

#### :memo: Documentation

- [#2680](https://github.com/facebook/docusaurus/pull/2680) docs(v2): add swizzle example ([@jsjoeio](https://github.com/jsjoeio))

#### Committers: 3

- Alexey Pyltsyn ([@lex111](https://github.com/lex111))
- Joe Previte ([@jsjoeio](https://github.com/jsjoeio))
- Sam Zhou ([@SamChou19815](https://github.com/SamChou19815))

## 2.0.0-alpha.53

**HOTFIX for 2.0.0-alpha.51**.
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ A good test plan has the exact commands you ran and their output, provides scree

- If you've changed APIs, update the documentation.

If you need help testing your changes locally, you can check out the doc on doing [local third party testing](./admin/local-third-party-project-testing.md).

#### Breaking Changes

When adding a new breaking change, follow this template in your pull request:
Expand Down
5 changes: 5 additions & 0 deletions admin/scripts/test-release.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/usr/bin/env bash

# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

set -euo pipefail

CUSTOM_REGISTRY_URL="http://localhost:4873"
Expand Down
16 changes: 8 additions & 8 deletions docs/getting-started-publishing.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ At this point, you can grab all of the files inside the `website/build` director

Deploying your Docusaurus project to [ZEIT Now](https://zeit.co/now) will provide you with [various benefits](https://zeit.co/now) in the areas of performance and ease of use.

Most importantly, however, deploying a Docusaurus project only takes a couple seconds:
Most importantly, however, deploying a Docusaurus project only takes a couple of seconds:

1. First, install their [command-line interface](https://zeit.co/download):

Expand All @@ -50,11 +50,11 @@ now

**That's all.** Your docs will automatically be deployed.

> Note that the directory structure Now supports is slightly different from the default directory structure of a Docusaurus project - The `docs` directory has to be within the `website` directory, ideally following the directory structure in this example. You will also have to specify a `customDocsPath` value in `siteConfig.js`. Take a look at the the [now-examples repository for a Docusaurus project](https://github.com/zeit/now-examples/tree/master/docusaurus).
> Note that the directory structure Now supports is slightly different from the default directory structure of a Docusaurus project - The `docs` directory has to be within the `website` directory, ideally following the directory structure in this example. You will also have to specify a `customDocsPath` value in `siteConfig.js`. Take a look at the [now-examples repository for a Docusaurus project](https://github.com/zeit/now-examples/tree/master/docusaurus).
### Using GitHub Pages

Docusaurus was designed to work really well with one of the most popular hosting solutions for open source projects: [GitHub Pages](https://pages.github.com/).
Docusaurus was designed to work well with one of the most popular hosting solutions for open source projects: [GitHub Pages](https://pages.github.com/).

#### Deploying to GitHub Pages

Expand All @@ -69,7 +69,7 @@ Docusaurus was designed to work really well with one of the most popular hosting
| Name | Description |
| --- | --- |
| `organizationName` | The GitHub user or organization that owns the repository. If you are the owner, then it is your GitHub username. In the case of Docusaurus, that would be the "_facebook_" GitHub organization. |
| `projectName` | The name of the GitHub repository for your project. For example, the source code for Docusaurus is hosted at https://github.com/facebook/docusaurus, so our project name in this case would be "docusaurus". |
| `projectName` | The name of the GitHub repository for your project. For example, the source code for Docusaurus is hosted at https://github.com/facebook/docusaurus, so our project name, in this case, would be "docusaurus". |
| `url` | Your website's URL. For projects hosted on GitHub pages, this will be "https://_username_.github.io" |
| `baseUrl` | Base URL for your project. For projects hosted on GitHub pages, it follows the format "/_projectName_/". For https://github.com/facebook/docusaurus, `baseUrl` is `/docusaurus/`. |

Expand All @@ -94,7 +94,7 @@ In case you want to deploy as a user or organization site, specify the project n

| Name | Description |
| --- | --- |
| `GIT_USER` | The username for a GitHub account that has commit access to this repo. For your own repositories, this will usually be your own GitHub username. The specified `GIT_USER` must have push access to the repository specified in the combination of `organizationName` and `projectName`. |
| `GIT_USER` | The username for a GitHub account that has to commit access to this repo. For your repositories, this will usually be your own GitHub username. The specified `GIT_USER` must have push access to the repository specified in the combination of `organizationName` and `projectName`. |

To run the script directly from the command-line, you can use the following, filling in the parameter values as appropriate.

Expand Down Expand Up @@ -132,7 +132,7 @@ However, you can automate the publishing process with continuous integration (CI

## Automating Deployments Using Continuous Integration

Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate deployment of your website is to invoke the `publish-gh-pages` script whenever your docs get updated. In the following section, we'll be covering how to do just that using [CircleCI](https://circleci.com/), a popular continuous integration service provider.
Continuous integration (CI) services are typically used to perform routine tasks whenever new commits are checked in to source control. These tasks can be any combination of running unit tests and integration tests, automating builds, publishing packages to NPM, and yes, deploying changes to your website. All you need to do to automate the deployment of your website is to invoke the `publish-gh-pages` script whenever your docs get updated. In the following section, we'll be covering how to do just that using [CircleCI](https://circleci.com/), a popular continuous integration service provider.

### Using CircleCI 2.0

Expand All @@ -147,7 +147,7 @@ If you haven't done so already, you can [setup CircleCI](https://circleci.com/si
1. Copy the text below into `.circleci/config.yml`.

```yaml
# If you only want circle to run on direct commits to master, you can uncomment this out
# If you only want the circle to run on direct commits to master, you can uncomment this out
# and uncomment the filters: *filter-only-master down below too
#
# aliases:
Expand Down Expand Up @@ -272,7 +272,7 @@ You can also configure Netlify to rebuild on every commit to your repository, or

### Hosting on Render

Render offers free [static site](https://render.com/docs/static-sites) hosting with fully managed SSL, custom domains, a global CDN and continuous auto deploys from your Git repo. Deploy your app in just a few minutes by following these steps.
Render offers free [static site](https://render.com/docs/static-sites) hosting with fully managed SSL, custom domains, a global CDN and continuous auto deploy from your Git repo. Deploy your app in just a few minutes by following these steps.

1. Create a new **Web Service** on Render, and give Render's GitHub app permission to access your Docusaurus repo.

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.0.0-alpha.53",
"version": "2.0.0-alpha.54",
"npmClient": "yarn",
"useWorkspaces": true,
"changelog": {
Expand Down
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.53",
"version": "2.0.0-alpha.54",
"license": "MIT",
"keywords": [
"documentation",
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-init-1.x/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "docusaurus-init",
"description": "Initialization script for Docusaurus",
"version": "2.0.0-alpha.53",
"version": "2.0.0-alpha.54",
"license": "MIT",
"preferGlobal": true,
"keywords": [
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.53",
"version": "2.0.0-alpha.54",
"description": "Create Docusaurus app easily",
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = {
src: 'img/logo.svg',
},
links: [
{to: 'blog', label: 'Blog', position: 'left'},
{
href: 'https://github.com/facebook/docusaurus',
label: 'GitHub',
Expand Down
6 changes: 3 additions & 3 deletions packages/docusaurus-init/templates/bootstrap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docusaurus-2-bootstrap-template",
"version": "2.0.0-alpha.53",
"version": "2.0.0-alpha.54",
"private": true,
"scripts": {
"start": "docusaurus start",
Expand All @@ -9,8 +9,8 @@
"deploy": "docusaurus deploy"
},
"dependencies": {
"@docusaurus/core": "^2.0.0-alpha.53",
"@docusaurus/preset-bootstrap": "^2.0.0-alpha.53",
"@docusaurus/core": "^2.0.0-alpha.54",
"@docusaurus/preset-bootstrap": "^2.0.0-alpha.54",
"classnames": "^2.2.6",
"react": "^16.8.4",
"react-dom": "^16.8.4"
Expand Down
32 changes: 11 additions & 21 deletions packages/docusaurus-init/templates/bootstrap/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Layout from '@theme/Layout';
import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import useBaseUrl from '@docusaurus/useBaseUrl';

import styles from './styles.module.css';

const features = [
Expand Down Expand Up @@ -61,31 +62,20 @@ function Home() {
<Layout
title={`Hello from ${siteConfig.title}`}
description="Description will go into a meta tag in <head />">
<header className={classnames('hero hero--primary', styles.heroBanner)}>
<div className="container">
<h1 className="hero__title">{siteConfig.title}</h1>
<p className="hero__subtitle">{siteConfig.tagline}</p>
<div className={styles.buttons}>
<Link
className={classnames(
'button button--outline button--secondary button--lg',
styles.getStarted,
)}
to={useBaseUrl('docs/doc1')}>
Get Started
</Link>
</div>
<header>
<h1 className="hero__title">{siteConfig.title}</h1>
<p className="hero__subtitle">{siteConfig.tagline}</p>
<div className={styles.buttons}>
<Link to={useBaseUrl('docs/doc1')}>Get Started</Link>
</div>
</header>
<main>
{features && features.length && (
{features && features.length > 0 && (
<section className={styles.features}>
<div className="container">
<div className="row">
{features.map((props, idx) => (
<Feature key={idx} {...props} />
))}
</div>
<div className="row">
{features.map((props, idx) => (
<Feature key={idx} {...props} />
))}
</div>
</section>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* stylelint-disable docusaurus/copyright-header */

/**
* CSS files with the .module.css suffix will be treated as CSS modules
* and scoped locally.
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.53",
"version": "2.0.0-alpha.54",
"private": true,
"scripts": {
"start": "docusaurus start",
Expand All @@ -9,8 +9,8 @@
"deploy": "docusaurus deploy"
},
"dependencies": {
"@docusaurus/core": "^2.0.0-alpha.53",
"@docusaurus/preset-classic": "^2.0.0-alpha.53",
"@docusaurus/core": "^2.0.0-alpha.54",
"@docusaurus/preset-classic": "^2.0.0-alpha.54",
"classnames": "^2.2.6",
"react": "^16.8.4",
"react-dom": "^16.8.4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function Home() {
</div>
</header>
<main>
{features && features.length && (
{features && features.length > 0 && (
<section className={styles.features}>
<div className="container">
<div className="row">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* stylelint-disable docusaurus/copyright-header */

/**
* CSS files with the .module.css suffix will be treated as CSS modules
* and scoped locally.
Expand Down
6 changes: 3 additions & 3 deletions packages/docusaurus-init/templates/facebook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docusaurus-2-facebook-template",
"version": "2.0.0-alpha.53",
"version": "2.0.0-alpha.54",
"private": true,
"scripts": {
"start": "docusaurus start",
Expand All @@ -13,8 +13,8 @@
"prettier:diff": "prettier --config .prettierrc --list-different \"**/*.{js,md}\""
},
"dependencies": {
"@docusaurus/core": "^2.0.0-alpha.53",
"@docusaurus/preset-classic": "^2.0.0-alpha.53",
"@docusaurus/core": "^2.0.0-alpha.54",
"@docusaurus/preset-classic": "^2.0.0-alpha.54",
"classnames": "^2.2.6",
"react": "^16.8.4",
"react-dom": "^16.8.4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function Home() {
</div>
</header>
<main>
{features && features.length && (
{features && features.length > 0 && (
<section className={styles.features}>
<div className="container">
<div className="row">
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.53",
"version": "2.0.0-alpha.54",
"description": "Docusaurus Loader for MDX",
"main": "src/index.js",
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-module-type-aliases/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docusaurus/module-type-aliases",
"version": "2.0.0-alpha.53",
"version": "2.0.0-alpha.54",
"description": "Docusaurus module type aliases",
"types": "./src/index.d.ts",
"publishConfig": {
Expand Down
12 changes: 12 additions & 0 deletions packages/docusaurus-module-type-aliases/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,15 @@ declare module '@theme/*' {
const component: any;
export default component;
}

declare module '@docusaurus/*';

declare module '*.module.css' {
const classes: {readonly [key: string]: string};
export default classes;
}

declare module '*.css' {
const src: string;
export default src;
}
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.53",
"version": "2.0.0-alpha.54",
"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.53"
"@docusaurus/types": "^2.0.0-alpha.54"
},
"dependencies": {
"@docusaurus/mdx-loader": "^2.0.0-alpha.53",
"@docusaurus/utils": "^2.0.0-alpha.53",
"@docusaurus/mdx-loader": "^2.0.0-alpha.54",
"@docusaurus/utils": "^2.0.0-alpha.54",
"feed": "^4.1.0",
"fs-extra": "^8.1.0",
"globby": "^10.0.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/docusaurus-plugin-content-blog/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,12 +470,12 @@ export default function pluginContentBlog(
const feedsConfig = {
rss: {
type: 'application/rss+xml',
path: 'blog/rss.xml',
path: 'rss.xml',
title: `${title} Blog RSS Feed`,
},
atom: {
type: 'application/atom+xml',
path: 'blog/atom.xml',
path: 'atom.xml',
title: `${title} Blog Atom Feed`,
},
};
Expand All @@ -495,7 +495,7 @@ export default function pluginContentBlog(
attributes: {
rel: 'alternate',
type,
href: normalizeUrl([baseUrl, path]),
href: normalizeUrl([baseUrl, options.routeBasePath, path]),
title,
},
});
Expand Down
Loading

0 comments on commit 6839fa0

Please sign in to comment.