Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(v2): make config validation less strict #3120

Merged
merged 6 commits into from
Jul 27, 2020

Conversation

teikjun
Copy link
Contributor

@teikjun teikjun commented Jul 24, 2020

Motivation

This PR modifies the config validation for the following fields:

  1. navbar.title
  2. rehypePlugins
  3. routeBasePath
  4. scripts
  5. stylesheets

navbar.title

It allows the following values for navbar.title: '', null, undefined. This fixes #3117.

rehypePlugins

The schema for rehypePlugins has been modified. It now accepts an array, whose items are either:

This fixes #3125.

routeBasePath

It accepts the empty string '' now. This is useful for removing /docs from url while having a landing page. This fixes #3126.

scripts and stylesheets

scripts accepts both defer and async now.
stylesheets accepts unknown fields now.
This fixes #3128

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

navbar.title

  1. In /website/docusaurus.config.js, change navbar.title to '' or null, or remove the field.
  2. There should be no validation errors in all cases.

rehypePlugins

  1. Follow the steps to reproduce Error when including rehype plugins #3125
  2. There should be no validation errors thrown now
    (I didn't add an automated test for rehype plugin because the dependency will only be used for testing)

routeBasePath

  1. Follow the steps to reproduce Can no longer remove /docs from the URL since v59 #3126. For step 3, set routeBasePath: ''
  2. There should be no validation error raised

scripts and stylesheets

  1. Refer to the steps to reproduce Validation too strict for stylesheet and scripts  #3128. Add the config for scripts and stylesheets to D2 website.
  2. There should be no validation errors raised.

@teikjun teikjun requested a review from lex111 as a code owner July 24, 2020 17:36
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jul 24, 2020
@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Jul 24, 2020

Deploy preview for docusaurus-2 ready!

Built with commit 4695af4

https://deploy-preview-3120--docusaurus-2.netlify.app

@teikjun teikjun requested a review from yangshun as a code owner July 27, 2020 07:39
@teikjun teikjun changed the title fix(v2): make navbar title validation less strict fix(v2): make config validation less strict Jul 27, 2020
@slorber
Copy link
Collaborator

slorber commented Jul 27, 2020

Thanks @teikjun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
4 participants