Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ declare module '@theme/MDXPage' {
readonly frontMatter: {
readonly title: string;
readonly description: string;
readonly wrapperClassName?: string;
};
readonly metadata: {readonly permalink: string};
readonly rightToc: readonly MarkdownRightTableOfContents[];
Expand Down
4 changes: 3 additions & 1 deletion packages/docusaurus-theme-classic/src/theme/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

import React from 'react';
import clsx from 'clsx';
import Head from '@docusaurus/Head';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import useBaseUrl from '@docusaurus/useBaseUrl';
Expand Down Expand Up @@ -43,6 +44,7 @@ function Layout(props: Props): JSX.Element {
image,
keywords,
permalink,
wrapperClassName,
} = props;
const metaTitle = title ? `${title} | ${siteTitle}` : siteTitle;
const metaImage = image || defaultImage;
Expand Down Expand Up @@ -87,7 +89,7 @@ function Layout(props: Props): JSX.Element {

<AnnouncementBar />
<Navbar />
<div className="main-wrapper">{children}</div>
<div className={clsx('main-wrapper', wrapperClassName)}>{children}</div>
{!noFooter && <Footer />}
</Providers>
);
Expand Down
8 changes: 6 additions & 2 deletions packages/docusaurus-theme-classic/src/theme/MDXPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ import type {Props} from '@theme/MDXPage';
function MDXPage(props: Props): JSX.Element {
const {content: MDXPageContent} = props;
const {frontMatter, metadata} = MDXPageContent;
const {title, description} = frontMatter;
const {title, description, wrapperClassName} = frontMatter;
const {permalink} = metadata;

return (
<Layout title={title} description={description} permalink={permalink}>
<Layout
title={title}
description={description}
permalink={permalink}
wrapperClassName={wrapperClassName}>
<main>
<div className="container margin-vert--lg padding-vert--lg">
<MDXProvider components={MDXComponents}>
Expand Down
1 change: 1 addition & 0 deletions packages/docusaurus-theme-classic/src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ declare module '@theme/Layout' {
image?: string;
keywords?: string[];
permalink?: string;
wrapperClassName?: string;
};

const Layout: (props: Props) => JSX.Element;
Expand Down
1 change: 1 addition & 0 deletions website/src/pages/examples/markdownPageExample.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Markdown Page example title
description: Markdown Page example description
wrapperClassName: docusaurus-markdown-example
---

# Markdown page
Expand Down