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

feat(v2): add optional custom wrapper class name for pages based on theme classic Layout #3457

Merged
merged 3 commits into from
Sep 23, 2020

Conversation

Simek
Copy link
Contributor

@Simek Simek commented Sep 16, 2020

Motivation

Some custom pages may require different layout or additional customizations to the main page wrapper.

This small PR introduces an ability to specify an optional, custom wrapperClassName to the theme classic Layout component.

I have NOT updated the docs because I was not able to find the page which describes all other optional Layout props. "Theme classic" and "Creating pages" only briefly mention Layout usage. The most properties is used in the "Migration guide" but still without a description.

I can add the note about this feature if you will be able to tell me where to put it. Alternatively, I can (in a later time) try to add Layout component related section to the Theme Classic page. 🙂

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Feature has been tested with the local Docusaurus V2 website.
Screenshot 2020-09-16 124227

Related PRs

@Simek Simek requested a review from lex111 as a code owner September 16, 2020 10:50
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Sep 16, 2020
@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Sep 16, 2020

Deploy preview for docusaurus-2 ready!

Built without sensitive environment variables with commit bc0a7cd

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

Copy link
Contributor

@lex111 lex111 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice feature indeed, I think what else can we add a similar feature for MD page in its frontmatter?

---
title: my hello page title
description: my hello page description
wrapperClassName: hello
---

Content..

Alternatively, I can (in a later time) try to add Layout component related section to the Theme Classic page.

That would be great, we definitely need it.

@Simek
Copy link
Contributor Author

Simek commented Sep 16, 2020

@lex111 I have added the wrapperClassName property for Markdown pages and updated the Markdown page example within the V2 website repository:

image

@Simek Simek requested a review from lex111 September 16, 2020 12:09
@Simek
Copy link
Contributor Author

Simek commented Sep 23, 2020

@lex111 Is there anything more you would like to see implemented within this PR? 🙂

Copy link
Contributor

@lex111 lex111 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we will write docs for Layout component in a separate PR.

@lex111 lex111 merged commit f9944cb into facebook:master Sep 23, 2020
@lex111
Copy link
Contributor

lex111 commented Sep 23, 2020

@Simek thank you!

@Simek
Copy link
Contributor Author

Simek commented Sep 23, 2020

LGTM, we will write docs for Layout component in a separate PR.

@lex111 I'm happy to do this after I finish my part on the RN website migration.

@lex111 lex111 added this to the v2.0.0-alpha.65 milestone Sep 26, 2020
@lex111 lex111 added the pr: new feature This PR adds a new API or behavior. label Sep 26, 2020
slorber pushed a commit that referenced this pull request Sep 29, 2020
…heme classic Layout (#3457)

* feat(v2): add optional custom wrapper class name for pages based on theme classic Layout

* feat(v2): add optional custom wrapper class name for markdown pages

* fix TS types
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: new feature This PR adds a new API or behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants