Skip to content

Commit 7d4b5ee

Browse files
authored
Merge pull request #20 from ThePythonLedger/feature-isDraft-badge
Added new frontmatter tag: "isDraft: true" to show the lessons but mark them as draft
2 parents 0a40bd8 + b9b1d0a commit 7d4b5ee

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

src/theme/DocItem/Layout/index.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import React from 'react';
2+
import Layout from '@theme-original/DocItem/Layout';
3+
import { useDoc } from '@docusaurus/plugin-content-docs/client';
4+
5+
export default function LayoutWrapper(props) {
6+
const { frontMatter } = useDoc();
7+
8+
return (
9+
<>
10+
{frontMatter?.isDraft && (
11+
<div className="margin-bottom--md">
12+
<span
13+
className="badge badge--warning"
14+
style={{ fontSize: '0.85rem', padding: '0.4rem 0.8rem' }}
15+
>
16+
🚧 Work in Progress / Draft
17+
</span>
18+
</div>
19+
)}
20+
<Layout {...props} />
21+
</>
22+
);
23+
}

0 commit comments

Comments
 (0)