profile
viewpoint
Yangshun Tay yangshun @facebook Singapore yangshun.im Full Front End Stack @facebook · Facebook Open Source webmaster via @Docusaurus · 🇸🇬

quarbby/links-and-resources 209

:books: :pencil2: :mortar_board: A collection of textbooks, links and resources during our studying years in NUS SoC

khankuan/audiosign 22

AudioSignJS allows the broadcasting/listening of an id (32-bits) to/from a device to another via sound (Ultrasound).

nusmodifications/react-redux-starter 13

Minimal non-opinionated starter for modern single-page applications.

khankuan/rtcstarjs 12

A star topology client-server framework for WebRTC using PeerJS

jin/NUSWhispers-iOS 10

iOS app for an anonymous confession platform.

khankuan/colorplus 8

Simple color game written with Flux, React and Sass

khankuan/react-catalog 7

React Catalog is a UI Component development and documentation tool

weiqingtoh/corspedia 7

Corspedia is an easy-to-use search engine for NUS CORS Bidding Archives. It provides a clean and simple interface for students to search for the bidding history of any module and displays the relevant results according to their profile: Faculty, New/Returning student and Programmes/General account.

issue commentfacebook/docusaurus

Add support deploy to Gitlab pages

Yeah you have a build directory now and it's hosting provider-agnostic, so GitLab integration will be low priority.

limkinZero

comment created time in an hour

issue commentfacebook/docusaurus

Last updated on time / author is always same for every page?

Could you try creating a custom build on your local machine and see if the timestamps work properly? If so then it's something with GitHub actions environment. Please let us know :)

Jason-2020

comment created time in 3 hours

IssuesEvent

issue commentfacebook/docusaurus

Last updated on time / author is always same for every page?

The last updated date look at Git history of a file, so I suspect it could be the environment of your build step. When you clone the repo on your deployment environment do you happen to be doing just a shallow clone? A preferably long history is needed for this to work well.

Jason-2020

comment created time in 4 hours

pull request commentfacebook/docusaurus

fix(v2): use `require.resolve` for all webpack presets and plugins

We'll cut a new release within the next few days.

SamChou19815

comment created time in 4 hours

issue commenttypescript-cheatsheets/react-typescript-cheatsheet

[Question] featuring react-typescript-cheatsheet in Docusaurus

@slorber WDYT about migrating the site to v2 to get familiar with v2?

hong4rc

comment created time in 14 hours

startedjgraph/drawio

started time in 15 hours

issue commenttypescript-cheatsheets/react-typescript-cheatsheet

[Question] featuring react-typescript-cheatsheet in Docusaurus

Any thoughts against migrating this website to Docusaurus v2? :)

hong4rc

comment created time in a day

issue commenttypescript-cheatsheets/react-typescript-cheatsheet

[Question] featuring react-typescript-cheatsheet in Docusaurus

Thanks for the note @wgao19! Yeah let's do showcase it! @hong4rc mind creating a PR for this?

hong4rc

comment created time in a day

delete branch facebook/docusaurus

delete branch : lex111/scroll-menu

delete time in a day

push eventfacebook/docusaurus

Alexey Pyltsyn

commit sha d391a2bcdbe7d5096d08be88d8bf5467e70264a8

fix(v2): enable scrolling for sidebar menu only (#2645) * fix(v2): enable scrolling for sidebar menu only * Add support for announcement bar * fix: remove redundant styles

view details

push time in a day

PR merged facebook/docusaurus

Reviewers
fix(v2): enable scrolling for sidebar menu only CLA Signed tag: bug fix

<!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md

Happy contributing!

-->

Motivation

This PR resolves #2620 and includes complex changes, mainly due to support for announcement bar. Since the height of the sidebar is based on the full height of viewport, when we are at the very top of the page, we see an announcement bar, which has a certain height, which should be taken into account when calculating the height of the sidebar.

In the screenshots below are full reflection of this challenge, for the solution of which we need to expose announcement bar info (to find out whether the announcement bar was dismissed or not) and limit the height of the announcement bar to a fixed height on the desktop.

Without announcement bar, sidebar menu scrolling is fully visible and everything is fine:

снимок

But if the announcement bar is shown, then bottom part of the sidebar menu scrolling is no longer visible, since we need to somehow take into account the height of this bar. I think it's not so easy to do.

снимок_1

To solve that, I created Provider+Context for the announcement bar, so that I could know from the DocSidebar component whether the bar was dismissed, and if not, then "adjust" the height of sidebar menu so that scrolling sidebar menu looks as expected. As a result, we have the desired result! However how much code was needed to solve this!🤕

снимок_2


This PR contains two commits to show how much effort it took to get things to work with the enabled announcement bar. Enough changes from the first commit https://github.com/facebook/docusaurus/commit/20bc7cc9911beadad9d564a263b1dd684a8373f1 however we will have new issue with a scrolling of sidebar menu (as shown in the second screenshot). We definitely do not want this, but I could not find an easier solution, maybe there will be thoughts on how to simplify this (@yangshun maybe I missed something?)

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Preview

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

+186 -65

6 comments

9 changed files

lex111

pr closed time in a day

issue closedfacebook/docusaurus

Sidebar scrolling thumb is not always visible when hideOnScroll = false

🐛 Bug Report

The sidebar has some problems with scrolling when hideOnScroll = false. The scrolling thumb is only partially visible when scrolled to top, as it is hidden by the NavBar. If the sidebar content is long enough, the thumb can disappear completely behind the NavBar.

Have you read the Contributing Guidelines on issues?

Yes.

To Reproduce

  1. Go to our documentation site: support.touchgfx.com
  2. Expand enough categories in the sidebar such that the scrollbar appears
  3. Part of the scrollbar is now hidden behind the NavBar.

Expected behavior

I expect to see the whole scrollbar when scrolled all the way to the top in the sidebar and on the page.

Actual Behavior

Part of the scrollbar is hidden. The whole scrollbar is hidden if the content of the sidebar is long enough.

hidden-scrollbar-bug

Your Environment

  • Docusaurus version used: v. 2.0.0-alpha.50
  • Version 78.0.3904.97 (Official Build) (32-bit)

closed time in a day

krillboi

issue commentfacebook/docusaurus

Feature: referencing variables from markdown pages

I don't know if you can use variables within the markdown syntax (fenced code blocks), but you can use it within JSX.

import {siteVariables} from '@site/src/versions';

// ...

<Tabs
  groupId="installation"
  defaultValue="java"
  values={[
    { label: 'Java', value: 'java', },
  ]
}>
<TabItem value="java">
// Cannot use Markdown syntax here
<code>compile 'mylib:mylib:{siteVariables.versionNumber}'</code>

</TabItem>
</Tabs>
julen

comment created time in a day

push eventfacebook/docusaurus

Sylvain Pace

commit sha 34e664ac277072319d49b263bb6761d1c424aff1

docs(v2): add mention on DocSearch when you run the crawler on your own (#2809)

view details

push time in 2 days

PR merged facebook/docusaurus

docs(v2): add mention on DocSearch when you run the crawler on your own CLA Signed tag: documentation

…r own

<!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md

Happy contributing!

-->

Motivation

Make sure v1 and v2 are synchronized

Have you read the Contributing Guidelines on pull requests?

Yes

+1 -0

2 comments

1 changed file

s-pace

pr closed time in 2 days

issue commentfacebook/docusaurus

Feature: referencing variables from markdown pages

Yeah you can write JS in MDX so you can import anything and use variables.

julen

comment created time in 2 days

delete branch facebook/docusaurus

delete branch : lex111/h1-size-mobiles

delete time in 3 days

pull request commentfacebook/docusaurus

fix(v2): make proper h1 font size on mobiles

Let's see if the timeout error still persists.

lex111

comment created time in 3 days

push eventfacebook/docusaurus

Alexey Pyltsyn

commit sha b52b7d64ff679c81259468ad6e5704edbae277b7

fix(v2): make proper h1 font size on mobiles (#2800)

view details

push time in 3 days

PR merged facebook/docusaurus

fix(v2): make proper h1 font size on mobiles CLA Signed tag: bug fix

<!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md

Happy contributing!

-->

Motivation

According to Infima styles https://github.com/facebookincubator/infima/blob/master/packages/core/styles/content/markdown.css#L36-L41

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Before After
image image

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

+1 -8

2 comments

1 changed file

lex111

pr closed time in 3 days

delete branch facebook/docusaurus

delete branch : lex111/init-templates-imp

delete time in 3 days

push eventfacebook/docusaurus

Alexey Pyltsyn

commit sha ca90b429917b040048e71920828564898b49070a

misc: minor improvements for init templates (#2802)

view details

push time in 3 days

PR merged facebook/docusaurus

misc: minor improvements for init templates CLA Signed tag: polish

<!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md

Happy contributing!

-->

Motivation

  • Fix external links (by analogy in https://github.com/facebook/docusaurus/pull/2801)
  • Fix demo MDX example.
  • Fix spelling of GitHub

screenshot_3

Have you read the Contributing Guidelines on pull requests?

(Write your answer here.)

Test Plan

:ok_hand:

screenshot_2

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

+24 -24

1 comment

9 changed files

lex111

pr closed time in 3 days

delete branch facebook/docusaurus

delete branch : lex111/doc-external-link

delete time in 3 days

push eventfacebook/docusaurus

Alexey Pyltsyn

commit sha 4cc36a535eff333f7f6a499506d3585b899441e8

docs(v2): add trailing slash to external links (#2801)

view details

push time in 3 days

PR merged facebook/docusaurus

docs(v2): add trailing slash to external links CLA Signed

<!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md

Happy contributing!

-->

Motivation

External links that contain a period in the last segment of the path (.com or .js) will now be considered as file links, and therefore they will not open in a new tab.

See https://github.com/facebook/docusaurus/blob/master/packages/docusaurus-theme-classic/src/theme/MDXComponents/index.js#L24

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Preview.

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

+8 -8

3 comments

3 changed files

lex111

pr closed time in 3 days

delete branch facebook/docusaurus

delete branch : lex111/docu-favicon-init

delete time in 3 days

push eventfacebook/docusaurus

Sam Zhou

commit sha 9001c49880dc18ffacd7e450560bde53abe10919

fix(v2): Properly declare peerDependencies (#2806)

view details

push time in 3 days

PR merged facebook/docusaurus

Reviewers
fix(v2): Properly declare peerDependencies CLA Signed

<!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md

Happy contributing!

-->

Motivation

If a package a declare a peerDependency b, then package that depends on a should either declare b as a dependency or peerDependency. i.e. no implicit transitive peer dependencies. See https://dev.to/arcanis/implicit-transitive-peer-dependencies-ed0

Fixed issues:

  • theme-classic, theme-bootstrap lists react and react-dom as peer dependencies, so their presets should also list react and react-dom as peer dependencies. This eliminates the following warnings:
warning " > @docusaurus/preset-classic@2.0.0-alpha.55" has unmet peer dependency "react@^16.8.4".
warning " > @docusaurus/preset-classic@2.0.0-alpha.55" has unmet peer dependency "react-dom@^16.8.4".
warning " > @docusaurus/theme-bootstrap@2.0.0-alpha.55" has unmet peer dependency "react@^16.8.4".
warning " > @docusaurus/theme-bootstrap@2.0.0-alpha.55" has unmet peer dependency "react-dom@^16.8.4".
warning " > @docusaurus/theme-classic@2.0.0-alpha.55" has unmet peer dependency "react@^16.8.4".
warning " > @docusaurus/theme-classic@2.0.0-alpha.55" has unmet peer dependency "react-dom@^16.8.4".
  • Remove webpack as a peer dependency for theme-classic, since we explicitly use webpack from core in #2795, so there is no need to expect parent of theme-classic to give us webpack. This eliminates the following warning:
warning " > @docusaurus/theme-classic@2.0.0-alpha.55" has unmet peer dependency "webpack@^4.41.2".
  • Remove webpack as a peer dependency for theme-bootstrap, since it doesn't actually use it. This eliminates the following warning:
warning " > @docusaurus/theme-bootstrap@2.0.0-alpha.55" has unmet peer dependency "webpack@^4.41.2".
  • Add prop-types as a dependency of theme-classic. theme-classic has a dependency (react-toggle) that list prop-types as a peerDependency. This eliminates the following warning:
warning "workspace-aggregator-052d4f38-24ac-4105-b7a7-b24c2ddc4001 > @docusaurus/theme-classic > react-toggle@4.1.1" has unmet peer dependency "prop-types@^15.3.0 || ^16.0.0".
  • Add @docusaurus/theme-live-codeblock as a dependency to website, since website actually depends on it here. This eliminates the following warnings:
warning " > @docusaurus/theme-search-algolia@2.0.0-alpha.55" has unmet peer dependency "react@^16.8.4".
warning " > @docusaurus/theme-search-algolia@2.0.0-alpha.55" has unmet peer dependency "react-dom@^16.8.4".

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

This changes result in no yarn.lock change in this repo, which means that it won't break existing resolution behavior. But you see fewer warnings about bad peer dependencies in yarn install.

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

+10 -6

1 comment

5 changed files

SamChou19815

pr closed time in 3 days

push eventfacebook/docusaurus

Alexey Pyltsyn

commit sha 2e12269f94d7d9461a1d2c4e4174ca4019bf2dfc

misc: use branded favicon in init templates (#2803)

view details

push time in 3 days

PR merged facebook/docusaurus

misc: use branded favicon in init templates CLA Signed

<!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md

Happy contributing!

-->

Motivation

Currently init templates use favicon from HTML5 Boilerplate (gray-orange star icon on a dark background), it seems to me that instead we need to use own favicons.

https://raw.githubusercontent.com/h5bp/html5-boilerplate/master/src/favicon.ico

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

See diffs.

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

+0 -0

1 comment

3 changed files

lex111

pr closed time in 3 days

pull request commentfacebook/docusaurus

docs(v2): add trailing slash to external links

Why the need for this change?

lex111

comment created time in 3 days

delete branch facebook/docusaurus

delete branch : lex111/search-input-medium-screens

delete time in 3 days

push eventfacebook/docusaurus

Alexey Pyltsyn

commit sha 604f9f5b25fa4355099726f5a31054c8f0f75a6f

refactor(v2): increase search input on medium screens (#2799) * refactor(v2): show only search icon on mobiles * refactor(v2): increase search input on medium screens

view details

push time in 3 days

PR merged facebook/docusaurus

refactor(v2): increase search input on medium screens CLA Signed tag: polish

<!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md

Happy contributing!

-->

Motivation

A follow-up and based on #2791.

On medium screens (tablets) it makes sense to increase the search input width, similar to mobiles screens.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Before:

screenshot_6

After:

screenshot_5

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

+13 -5

1 comment

2 changed files

lex111

pr closed time in 3 days

Pull request review commentfacebook/docusaurus

feat(v2): allow user to toggle sidebar open default

 module.exports = { }; ``` +#### Toggling category open by default++For sites that have collapsible categories, you may want more fine grain control over certain categories. If you want specific categories to be alwasy expanded, you can set `collapsed` to `false`:++```js title="sidebars.js"+module.exports = {+  docs: {+    Guides: [+      'creating-pages',+      {+        type: 'category',+        label: 'Docs',+        collapsed: false,+        items: ['markdown-features', 'sidebar', 'versioning'],+      },+    ],+  },+};+```+

This looks fine. What's the current default value for the collapsed field? The default should be true to preserve backward compatibility.

jsjoeio

comment created time in 4 days

Pull request review commentfacebook/docusaurus

feat(v2): allow user to toggle sidebar open default

 function DocSidebarItem({item, onItemClick, collapsible, ...props}) {             <a               className={classnames('menu__link', {                 'menu__link--sublist': collapsible,-                'menu__link--active': collapsible && !item.collapsed,+                'menu__link--active':+                  collapsible && !item.collapsed && isCategoryOfActivePage(),

It'd be better to make the function a pure one and pass in the require parameters. That makes it easier to test and move around.

jsjoeio

comment created time in 4 days

issue closedfacebook/docusaurus

Last updated on time is always same for every page?

📚 Documentation

enableUpdateTime option enables Last updated on DD/MM/YYYY feature. However this value is same for every page. I guess this was working fine in version 1 (it's broken when we started using github actions tho..) But it's not working as expected in v2. Is this bug or limitation? image

related: https://github.com/facebook/docusaurus/issues/1015

Have you read the Contributing Guidelines on issues?

yes

closed time in 4 days

Jason-2020

issue commentfacebook/docusaurus

Last updated on time is always same for every page?

Closing this out as it's not a bug.

Jason-2020

comment created time in 4 days

issue commentfacebook/docusaurus

Last updated on time is always same for every page?

If you're looking at the pages under https://v2.docusaurus.io/docs/, it's pointing to the latest released/stable version of the docs, and that's created when a new documentation version is cut, which was few days ago when we released alpha.55. If you see the trunk version of the docs under docs/next/ (e.g. https://v2.docusaurus.io/docs/next/using-plugins), you'll see that the author is different.

Jason-2020

comment created time in 4 days

push eventfacebook/docusaurus

Sam Zhou

commit sha 705f8f3c51c977216e7a76209d9d5997075de2d6

fix(v2): Consistently use require.resolve in official plugins to resolve modules (#2797) * fix(v2): Use require.resolve to resolve loaders in official plugins * Use require.resolve to resolve client modules

view details

push time in 4 days

PR merged facebook/docusaurus

Reviewers
fix(v2): Consistently use require.resolve in official plugins to resolve modules CLA Signed

<!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md

Happy contributing!

-->

Motivation

Continuing the effort in #2788, #2794, using require.resolve to resolve absolute paths for loaders and client modules to ensure it can work under yarn pnp.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

The website can build, and preview can load.

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

+8 -8

1 comment

5 changed files

SamChou19815

pr closed time in 4 days

push eventfacebook/docusaurus

Sam Zhou

commit sha 78136e77a27bfdb678c104e720e1b2142d3dbe4b

feat(v2): Use pnp-webpack-plugin to support pnp module resolution (#2796)

view details

push time in 4 days

PR merged facebook/docusaurus

feat(v2): Use pnp-webpack-plugin to support pnp module resolution CLA Signed

<!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md

Happy contributing!

-->

Motivation

According to the discussion in #2795, I think we should add pnp-webpack-plugin directly to docusaurus core to enable a zero-config experience for yarn pnp users. It adds very little space overhead to non-pnp users: adding this to an empty projects only creates a 20kb node_modules.

Note

After testing it on a local project after manually apply my pnp fix changes, including this one, I found that we are still one or two diffs away from fully supporting Yarn pnp mode. Here are some problems I found so far:

  • Some code in the docs and blog plugin still uses plain string to refer to plugins. (Fixed in #2797)
  • There are some issues of requires with generated code.
    • client-modules.js related issues fixed in #2797
    • @mdx-js/react issue (generated blog code has import { mdx } from '@mdx-js/react'), we might need to recommend pnp users to add @mdx-js/react as a dependency to fix this.
  • Some react dependencies of docusaurus doesn't properly declare their dependencies.
    • We might need to instruct users to use pnpMode: loose as a workaround.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

  • Check the docs to see the config is correct: https://github.com/arcanis/pnp-webpack-plugin#usage
  • Everything still builds.

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

+18 -0

1 comment

3 changed files

SamChou19815

pr closed time in 4 days

issue commentfacebook/docusaurus

Last updated on time is always same for every page?

Any live repro example? If you're talking about versioned pages that's expected.

On Sat, May 23, 2020, 9:54 AM Jason-2020 notifications@github.com wrote:

📚 Documentation

enableUpdateTime option enables Last updated on DD/MM/YYYY feature. However this value is same for every page. I guess this was working fine in version 1 (it's broken when we started using github actions tho..) But it's not working as expected in v2. Is this bug or limitation? [image: image] https://user-images.githubusercontent.com/58852063/82719167-e1177280-9c6d-11ea-8c92-7b2a88e8ddd6.png

related: #1015 https://github.com/facebook/docusaurus/issues/1015 Have you read the Contributing Guidelines on issues https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md#reporting-new-issues ?

yes

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/facebook/docusaurus/issues/2798, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKBCHMZNH5EZNYOV7IW74LRS4UG7ANCNFSM4NIHI7AQ .

Jason-2020

comment created time in 4 days

pull request commentfacebook/docusaurus

feat(v2): allow user to toggle sidebar open default

The reason we had the initial behavior is because if users opened a category that's nearer to the bottom of the sidebar, they would have to scroll down before they can access the new one. Collapsing all others categories helps a little bit with the issue of reducing the non-relevant vertical space needed. That said, this is not critical and I think there's no common industry practice. Spark AR docs has our current behavior but [Android docs].

Another issue that we might face here if we decide to stick with the current behavior is what we should do about the categories which are open by default but user decides to click on some other category. Do we close them or keep them open? If we keep them open that logic could be harder to maintain.

I'd prefer to stick with the current behavior if possible, assuming we have a feasible solution to the issue I raised above. WDYT?

jsjoeio

comment created time in 4 days

push eventfacebook/docusaurus

Yangshun Tay

commit sha 2dbd0488d72832e340fb711900abbe16cea61669

docs(v2): document beforeDefaultRemarkPlugins and beforeDefaultRehypePlugins

view details

push time in 4 days

push eventfacebook/docusaurus

Kasper Bøgebjerg Pedersen

commit sha 0e61da8f69cb8e59907233263079a7f5f34ab7c0

feat(v2): allow specifying of remark and rehype plugins before default plugins (#2689) * feat(v2): swap order of markdown plugins * feat(v2): remark/rehype plugins can override default plugins

view details

push time in 4 days

PR merged facebook/docusaurus

feat(v2): allow specifying of remark and rehype plugins before default plugins CLA Signed

Motivation

I use a remark plugin that allows me to use variables in markdown, while it works great for the content, in the right-side TOC the variables don't get interpolated. I figured this was because custom markdown plugins get loaded after the remark/rightToc plugin. This swaps the order of the if the default plugins and the custom plugins for both remark and rehype.

Have you read the [Contributing Guidelines on pull requests]

Yes!

Test Plan

I have run the docusaurus website locally as described here and have verified that swapping the order of the plugins works with these changes.

Without the order swapped image

With the order swapped image

Please advise if more testing, automated, or manual is needed.

👍 Thanks for a great project!

+2 -0

2 comments

1 changed file

kasperp

pr closed time in 4 days

delete branch facebook/docusaurus

delete branch : lex111/prettier-init-templates

delete time in 4 days

pull request commentfacebook/docusaurus

fix(v2): Ensure that theme classic require webpack provided by `@docusaurus/core`

Thanks for the explanation! I'd go for adding to @docusaurus/core if there are negligible costs to non-pnp users in doing so. What do you recommend?

SamChou19815

comment created time in 4 days

pull request commentfacebook/docusaurus

feat(v2): feature/docs slug frontmatter (v2)

@lex111 what do you think about this PR? Since you're more familiar with the docs plugin now.

slorber

comment created time in 4 days

push eventfacebook/docusaurus

Alexey Pyltsyn

commit sha 0ff6dd31f4ade91f8dc5cb55fdf3c3cb45819be5

style(v2): disable Prettier checks for Markdown files of init templates (#2792)

view details

push time in 4 days

PR merged facebook/docusaurus

style(v2): disable Prettier checks for Markdown files of init templates CLA Signed

<!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md

Happy contributing!

-->

Motivation

Just small improvement after #2786 -- we can use .prettierignore file to specify Prettier, what files we do not want to check.

It does not make much sense to format the init templates files, so I think it is quite acceptable to completely disable any style checks for these files. Moreover, the user may not use Prettier, and they will be confused by Prettier-specific comments, IMO.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Run yarn prettier-docs and make sure that there are no changes.

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

+1 -15

1 comment

4 changed files

lex111

pr closed time in 4 days

PR closed facebook/docusaurus

Reviewers
feat: Show icon-only for small devices CLA Signed

Motivation

fix #2699

Show icon-only search bar for devices under 768px. This fix is useful to solve an issue with long app name causing a rendering problem with search

I hope to make something right :)

Regards Marco

Have you read the Contributing Guidelines on pull requests?

YES

+16 -41

10 comments

3 changed files

marcosvega91

pr closed time in 4 days

pull request commentfacebook/docusaurus

feat: Show icon-only for small devices

Thank you for this PR! As #2791 is more robust, we'll go with that. We'll definitely credit you in our next release as a collaborator of #2791 :)

marcosvega91

comment created time in 4 days

delete branch facebook/docusaurus

delete branch : lex111/search-icon-mobile

delete time in 4 days

push eventfacebook/docusaurus

Alexey Pyltsyn

commit sha 83f980cadfd495b721c359320abea29aac371650

refactor(v2): show only search icon on mobiles (#2791)

view details

push time in 4 days

PR merged facebook/docusaurus

refactor(v2): show search icon only on mobiles CLA Signed tag: breaking change tag: polish

<!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md

Happy contributing!

-->

Motivation

Remastered version of #2702, closes #2699

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

ezgif com-video-to-gif (3)

Now the search input width is adaptive, it changes depending on the width of the viewport, see the screenshot below:

screenshot_4

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

+97 -74

1 comment

4 changed files

lex111

pr closed time in 4 days

issue closedfacebook/docusaurus

alpha-54: Site title no longer wraps - search box moves

🐛 Bug Report

In alpha-0.49 and previous (I believe but I'm struggling to get these to build now), longer site titles would wrap at the search in the header bar. This was especially important on mobile browsers where the width is obviously limited. As of alpha-54, the title is not wrapping and search box is being pushed out of the header.

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

  1. Install Docusaurus and set up with a multi-word site title (total length more than 12 characters or so)
  2. Enable the search plug in
  3. Visit site on a mobile browser

Expected behavior

Words should wrap to ensure proper placement of search box

Actual Behavior

Title is shown on one line and search is moved iOS: IMG_0993

Pixel 4 (on BrowserStack) image

Your Environment

<!-- Include as many relevant details about the environment you experienced the bug in -->

  • Docusaurus version used: alpha-54
  • Environment name and version: Chrome and Safari on iOS,
  • Operating system and version (desktop or mobile): iOS on iPhone XS. Using browser stack I see it on other devices, including android, depending on screen size/resolution

closed time in 4 days

TomBrien

pull request commentfacebook/docusaurus

fix(v2): Ensure that theme classic require webpack provided by `@docusaurus/core`

@SamChou19815 I'd like to complete most of the Yarn v2 pnp compatibility before we launch the next alpha version. Do you know what else is needed?

SamChou19815

comment created time in 4 days

push eventfacebook/docusaurus

Sam Zhou

commit sha 85a694448f47a5dd86650d1ec9629a7339fbf846

fix(v2): Ensure that theme classic require webpack provided by `@docusaurus/core` (#2795)

view details

push time in 4 days

PR merged facebook/docusaurus

Reviewers
fix(v2): Ensure that theme classic require webpack provided by `@docusaurus/core` CLA Signed

<!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md

Happy contributing!

-->

Motivation

This diff continues the progress of making docusaurus v2 work under yarn v2's pnp mode.

The Problem

There is a tricky require inside @docusaurus/theme-classic:

const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin');

@docusaurus/theme-classic also declares webpack as a peer dependency. Currently at runtime, webpack is likely to be provided by @docusaurus/core, which declares it as a direct dependency. However, this setup is theoretically not guaranteed to work, and it will certainly break in Yarn v2 pnp's strict mode. To understand why it's the issue, let me draw an layout of the node_modules.

In a package manager doesn't implement any hoisting optimization, the layout will be like

- node_modules
  - @docusaurus/core
    - node_modules
      - webpack
  - @docusaurus/theme-classic
    - index.js (that requires `webpack`)

Therefore, when index.js require webpack it will fail, because it doesn't exist in these paths:

  • project-root/@docusaurus/theme-classic/node_modules
  • project-root/@docusaurus/node_modules
  • project-root/node_modules

The current setup happens to work because popular package managers implement hoisting optimization, which results in a layout like

- node_modules
  - webpack
  - @docusaurus/core
  - @docusaurus/theme-classic
    - index.js (that requires `webpack`)

Under yarn's pnp mode, things will break. Although Yarn knows that @docusaurus/theme-classic declares webpack as a peer dependency, it still doesn't know where to find it.

The Fix

I think the code author's intention is to use the webpack provided by @docusaurus/core. Therefore, I decide to make this more explicit by using Module.createRequire, which can be understood by Yarn's pnp runtime. I discussed how createRequire works in #2789.

Have you read the Contributing Guidelines on pull requests?

Yes.

Test Plan

Everything can still be properly loaded, and the preview site still works.

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

+9 -1

1 comment

1 changed file

SamChou19815

pr closed time in 4 days

push eventfacebook/docusaurus

Sam Zhou

commit sha 1503943e3f4cc2eb1f006f9d83f9b6bb539cb99f

fix(v2): Use `require.resolve` to resolve plugin path in presets (#2794)

view details

push time in 4 days

PR merged facebook/docusaurus

fix(v2): Use require.resolve to resolve plugin path in presets CLA Signed

<!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md

Happy contributing!

-->

Motivation

This diff continues the progress of making docusaurus v2 work under yarn v2's pnp mode.

  • In #2788, I ensured that all webpack presets and plugins can be correctly resolved by @docusaurus/core.
  • In #2789, I ensured that all user defined plugins can be correctly resolved by @docusaurus/core.

It would almost resolve almost all module resolution issues with yarn v2 pnp, except for presets. Docusaurus's presets still use plain string to refer to modules, which will make pnp module resolution fail.

In this diff, I fixed all the presets to use require.resolve in this repo. I also updated the docs to educate preset writers to use require.resolve in their code.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Everything can still be properly loaded, and the preview site still works.

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

+19 -14

2 comments

3 changed files

SamChou19815

pr closed time in 4 days

pull request commentfacebook/docusaurus

docs(v2): change docs for markdown features

Thanks for catching! Fixed in 20fbceb9f. I'm removing the paragraph example as it's obscure syntax.

piotros

comment created time in 5 days

push eventfacebook/docusaurus

Yangshun Tay

commit sha 20fbceb9f1883a0d23ba52e79a4517b92631f7fd

docs(v2): fix markdown syntax examples in templates

view details

push time in 5 days

fork yangshun/nycdh-jekyll

Base Jekyll site for NYCDH 2018 Workshop

fork in 5 days

push eventfacebook/docusaurus

Piotr Baran

commit sha 926cbb818bf84ae832694340e77681f6549bed2e

docs(v2): change docs for markdown features (#2786) * fix(v2): change docs for markdown features * Update doc1.md * Update doc1.md * Update doc1.md Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>

view details

push time in 5 days

PR merged facebook/docusaurus

fix(v2): change docs for markdown features CLA Signed

<!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md

Happy contributing!

-->

Motivation

This PR fixes the templates used by @docusaurus/init.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

  • Created a new project using @docusaurus/init using the fixed templates.
  • Previewed updated docs.
+44 -23

4 comments

3 changed files

piotros

pr closed time in 5 days

push eventpiotros/docusaurus

Yangshun Tay

commit sha 436035bb5dcab5e631fd9e3106ba6b5707f39be0

Update doc1.md

view details

push time in 5 days

push eventpiotros/docusaurus

Yangshun Tay

commit sha 4389bd9c90d385c3a3cc7bd82c321737ab7ad65d

Update doc1.md

view details

push time in 5 days

push eventpiotros/docusaurus

Yangshun Tay

commit sha e3389982aae82aee38e84909bc539f1cb2e4745b

Update doc1.md

view details

push time in 5 days

pull request commentfacebook/docusaurus

Add more static classes to Classic Theme components.

I started a discussion on #2790, feel free to chime in there!

sambauers

comment created time in 5 days

PR closed facebook/docusaurus

fix: MDX transclusion from outside `docs/` CLA Signed

<!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md

Happy contributing!

-->

Motivation

Make it possible to import .md(x) files from outside website/docs/. This can be used for referencing files like ../CONTRIBUTING.md and ../CODE_OF_CONDUCT.md.

Have you read the Contributing Guidelines on pull requests?

Yes.

Related issue

Partial fix for #2618.

+17 -0

5 comments

1 changed file

kripod

pr closed time in 5 days

pull request commentfacebook/docusaurus

fix: MDX transclusion from outside `docs/`

After putting in more thought, I think this is going to cause more issues than not due to the "features" of the docs plugin approach of converting every markdown file to a corresponding doc page. It's really unintuitive to have files outside of the base docs dir also have pages created for them, and it'll lead to nasty surprises. Sorry about that.

kripod

comment created time in 5 days

push eventfacebook/docusaurus

Sam Zhou

commit sha faf48e9b166e3e6e2ce90bd1349d526c7e53c890

fix(v2): Resolve plugins relative to siteDir (#2789)

view details

push time in 5 days

PR merged facebook/docusaurus

fix(v2): Resolve plugins relative to siteDir CLA Signed

<!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md

Happy contributing!

-->

Motivation

This diff tries to address the plugin loading issue in #2576. Even after this diff, docusaurus v2 still won't be completely compatible with Yarn v2's strict pnp mode, nevertheless it's a good step to start.

The current plugin resolution system basically does require(whateverStringUserGiveInPlugins). This strategy will work in normal settings where node_modules are laid out by package managers like this:

- website
  - node_modules
    - @docusaurus/core
      - index.js
    - docusaurus-plugin-abc
      - index.js
  - package.json
    { dependencies: ['@docusaurus/core', 'docusaurus-plugin-abc' }

In this case, when code in @docusaurus/core/index.js runs require('docusaurus-plugin-abc''), it can be correctly resolved to docusaurus-plugin-abc/index.js due to how node module resolution algorithm works.

However, with Yarn v2 pnp, the pnp runtime will reject this require. From the perspective of pnp runtime after reading in all the package.json during yarn install, it doesn't see docusaurus-plugin-abc in the dependency list of @docusaurus/core so it doesn't know which module it can be resolved to.

Since docusaurus v2 uses a plugin system, it is impossible to declare every possible plugins as dependency in core's package.json. The solution is to run the require in the path that declares those dependencies, instead of running the require by @docusaurus/core. The path that declares the dependencies happens to be the siteDir appear in loadContext.

Fortunately, we don't have to do some extensive hacking to achieve that. Since node 10, createRequireFromPath is available that does exactly what we want. (Node 12 deprecates it and replaced it with createRequire, that's why there is a fallback in my code. See https://nodejs.org/api/modules.html#modules_module_createrequire_filename)

In summary, this diff changes the plugin loading from require(pluginToLoad) to

require(Module.createRequire(context.siteDir).resolve(pluginToLoad))

Have you read the Contributing Guidelines on pull requests?

(Write your answer here.)

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)

Preview can still work. Test passes.

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

+12 -2

1 comment

1 changed file

SamChou19815

pr closed time in 5 days

issue commentyangshun/tech-interview-handbook

Add solution to a leetcode problem.

I ask him to create an issue and I'll make the PR. The website doesn't have a blog now

On Fri, May 22, 2020, 3:04 PM Louie Tan notifications@github.com wrote:

Closed #165 https://github.com/yangshun/tech-interview-handbook/issues/165.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/yangshun/tech-interview-handbook/issues/165#event-3363520517, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKBCHKUEGRJTDKN65UUPNTRSYPYNANCNFSM4NHQU2ZA .

raivatshah

comment created time in 5 days

IssuesEvent

push eventfacebook/docusaurus

Sam Zhou

commit sha a7925f28be863854fafaeea75d9d8ceab9cf5687

fix(v2): use `require.resolve` for all webpack presets and plugins (#2788)

view details

push time in 5 days

PR merged facebook/docusaurus

fix(v2): use `require.resolve` for all webpack presets and plugins CLA Signed

<!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md

Happy contributing!

-->

Motivation

Issue #2576 shows that docusaurus v2 doesn't work with Yarn v2 with pnp enabled.

This diff doesn't try to resolve the issue of the plugin system caused by the incompatibility: it can be solved by using the pnpLoose mode for now. Instead, it will fix some of the webpack plugin loading issue related to yarn pnp.

Inside the webpack config file, it refers to presets and plugins by strings, like '@babel/plugin-transform-runtime'. This setup happens to work with the traditional package managers' behavior on node_modules, which tries to hoist @babel/plugin-transform-runtime to the top-level node_modules if it can. However, it won't work under pnp, which expects that all dependencies are explictly declared.

In this case, since it's declared in a string form, it's webpack instead of @docusaurus/core that will resolve this module to an absolute path. Since webpack doesn't declare @babel/plugin-transform-runtime as dependency, the resolution failed. By using require.resolve, we ensure that @docusaurus/core will resolve the path. Since @docusaurus/core declared @babel/plugin-transform-runtime as a dependency, the resolution will succeed and results in a correct absolute path for webpack to consume.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)

I have setup a repo to show that these are the minimal changes necessary to make docusaurus work under pnpMode: loose.

Also, all the tests still passes and deploy preview still works.

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

+8 -6

1 comment

1 changed file

SamChou19815

pr closed time in 5 days

push eventfacebook/docusaurus

Alexey Pyltsyn

commit sha 783e7e7663a0593ab17a7682dc2377e1ee017a3c

fix(v2): do not show sidebar on reserved docs home page (#2785)

view details

push time in 5 days

PR merged facebook/docusaurus

fix(v2): do not show sidebar on reserved docs home page CLA Signed tag: bug fix

<!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md

Happy contributing!

-->

Motivation

Closes #2784.

In fact, doc sidebar had to be redefined only for reserved docs home page route (i.e. _index) so that sidebar will be shown for this kind of document (which is not supposed to be defined in any sidebar).

I had not considered that there could be multiple sidebars, which caused the bug described in #2784.

However, I have now realized that it was counterintuitive to display the sidebar on the reserved docs home page route, so this whole mess was due to my overengineering, which I want to fix in this PR.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

See #2784

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

+1 -5

1 comment

1 changed file

lex111

pr closed time in 5 days

issue closedfacebook/docusaurus

(v2) new home page feature in alpha-55 appears to randomly choose sidebars to show

🐛 Bug Report

I have a docusaurus-built site with multiple sidebars, and recently took advantage of #2652 to designate a page to be the "home" page.

The home page appears to choose a random sidebar of the my five available to present alongside the home page.

I'm not sure how the sidebar shown alongside the home page is chosen, nor why a seemingly random one shows up with each compilation of my site.

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

(Write your steps here:)

Using alpha-55, create a docusaurus page with multiple sidebars and a page designated the 'home' page. Refresh the home page several times, sometimes in different browsers. Stop and restart your development server. You'll find that you see different sidebars, seemingly randomly.

I have a sample at https://github.com/taylorreece/docusaurus-bug-poc If you pull that repo down, and

cd website
yarn run start

The sidebar you see at http://localhost:3000/docs will be a random side bar. If you stop and restart your dev server a few times you'll see other random side bars crop up.

Expected behavior

I guess I would expect the first sidebar defined in sidebars.js to be used... maybe it would be good to be able to designate which sidebar to present?

(Write what you thought would happen.)

Actual Behavior

<!-- Did something go wrong? Is something broken, or not behaving as you expected? Describe this section in detail, and attach screenshots if possible. Don't only say "it doesn't work"! -->

Refresh the home page several times, sometimes in different browsers. Stop and restart your development server. You'll find that you see different sidebars, seemingly randomly.

Your Environment

<!-- Include as many relevant details about the environment you experienced the bug in -->

  • Docusaurus version used: 2.0.0-alpha.55
  • Environment name and version (e.g. Chrome 81.0.4044.138, Node.js 12.16.2):
  • Operating system and version (desktop or mobile): MacOS 10.15.4

Reproducible Demo

(Paste the link to an example repo, including a siteConfig.js, and exact instructions to reproduce the issue.)

<!-- What happens if you skip this step?

Someone will read your bug report, and maybe will be able to help you, but it’s unlikely that it will get much attention from the team. Eventually, the issue will likely get closed in favor of issues that have reproducible demos.

Please remember that:

* Issues without reproducible demos have a very low priority.
* The person fixing the bug would have to do that anyway. Please be respectful of their time.
* You might figure out the issues yourself as you work on extracting it.

Thanks for helping us help you! -->

closed time in 5 days

taylorreece

push eventfacebook/docusaurus

James McShane

commit sha b6b108e5b115c926223ca937058b283d089b7d91

misc: update debug config for Docusaurus v2 in VS Code (#2775) Adding instructions that work to debug docusaurus locally

view details

push time in 5 days

PR merged facebook/docusaurus

misc: update debug config for Docusaurus v2 in VS Code CLA Signed

Adding instructions that work to debug docusaurus locally

<!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md

Happy contributing!

-->

Motivation

Updating local VSCode debug docs for docusaurus

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

I have run this debug configuration locally on the latest version of nodejs and vscode

Related PRs

N/A

+2 -3

1 comment

1 changed file

jmcshane

pr closed time in 5 days

push eventfacebook/docusaurus

Muhammad Ali

commit sha e6cdeba603ad373f862a1ade3d4c881fe7c95adb

docs(v2): add articles section to resources page (#2781)

view details

push time in 5 days

PR merged facebook/docusaurus

docs(v2): add articles section to resources page

Motivation

I saw resources page but there was no section for Articles. As I recently published my article so I added this section which will help users as well as publishers of docusaurus.

+4 -0

2 comments

1 changed file

mrmuhammadali

pr closed time in 5 days

pull request commentfacebook/docusaurus

Add more static classes to Classic Theme components.

What if the user could, instead of swizzling the whole component, create a component specific css modules file that would combine with the pre-existing css module file?

That sounds interesting. I do agree swizzling is not ideal. We'll look into allowing for more customization via outlets (injecting your React components into certain slots) and class name props are possible additions. Please add more of your swizzling use cases here so we know how why people are swizzling components and what APIs we can add such that you can customize your components without swizzling.

sambauers

comment created time in 5 days

push eventfacebook/docusaurus

Alexey Pyltsyn

commit sha 7448501c7cb0192e6f99b17ffb920ba836c9216a

refactor(v2): make external links more secure (#2783)

view details

push time in 5 days

PR merged facebook/docusaurus

refactor(v2): make external links more secure CLA Signed tag: polish

<!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md

Happy contributing!

-->

Motivation

For security reasons, it is recommended that we add the optional rel="noopener noreferrer" attribute for external links. Beside this, external links in navbar/footer have the same behavior.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

See #2780

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

+3 -2

1 comment

2 changed files

lex111

pr closed time in 5 days

push eventfacebook/docusaurus

John Knox

commit sha 70c201c24dcf3acc338704cd71c54b21bdc0b77e

feat(v2): open external links in new tab by default (#2780) Docusaurus is already opinionated about doing this, for example the navbar and footer do this already. This changes the Link component to do the same. This includes links in markdown in the form of `[label](url)`. You can override this behaviour by passing the target: '_self' prop.

view details

push time in 6 days

PR merged facebook/docusaurus

feat(v2): open external links in new tab by default CLA Signed tag: breaking change

This changes the Link component to open external URLs in new tabs. This includes links in markdown in the form of [label](url), and also explicit use of the Link component.

You can override this behavior by passing target: '_self' as a prop when using Link.

Motivation

Docusaurus is already opinionated about doing this, for example the Navbar and Footer do this already for external links. This is making it consistent across the entire site.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

cd website; yarn start;

  • In browser navigate to http://localhost:3000/docs/design-principles and click on "Minimal Surface Area" - Verify it opens in new tab. Do the same on other pages.
  • Verify anchor links continue to use the same tab.
  • Verify internal links continue to use the same tab.
  • Edit docs/design-principles.md to use Link instead of markdown syntax.
    • Verify it opens in a new tab.
  • Edit docs/design-principles.md to add the target="_self" attribute.
    • Verify it opens in the same tab.

Related PRs

None

+4 -1

1 comment

1 changed file

jknoxville

pr closed time in 6 days

issue closedfacebook/docusaurus

Docusaurus is hiring contractors!

Do you have experience in React, Node.js, webpack, (just take a look at our package.json) and want to work on a really cool Facebook Open Source project (this one)?

The Facebook Open Source Team is looking for a contractor to help us deliver the next version of Docusaurus. You will work alongside @yangshun and @lex111 to deliver new features, fix bugs and improve the website framework used by most Facebook's Open Source websites.

Required Experience

  • JavaScript/TypeScript
  • React
  • HTML and CSS
  • Node.js
  • Git
  • webpack

Preferred Experience

  • Experience with static site generators (Next.js, Gatsby, VuePress, Jekyll, etc)
  • Experience maintaining existing open source projects

If interested, please apply here.

closed time in 7 days

yangshun

issue commentfacebook/docusaurus

Docusaurus is hiring contractors!

@slorber will be working with us!

yangshun

comment created time in 7 days

push eventfacebook/docusaurus

Alexey Pyltsyn

commit sha 05c3aa31f4969c83188a15c6c19aa7a14be7ab92

fix(v2): do not highlight root docs path in navbar (#2778)

view details

push time in 7 days

PR merged facebook/docusaurus

fix(v2): do not highlight root docs path in navbar CLA Signed tag: internal

<!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md

Happy contributing!

-->

Motivation

Fixes this bug on website v2:

image

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Preview.

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

+1 -0

1 comment

1 changed file

lex111

pr closed time in 7 days

more