docs: ⬆️ on top of core, bump up docusaurus preset-classic + refacto

Signed-off-by: jffarge <jf@dagger.io>
This commit is contained in:
jffarge
2021-06-28 12:01:29 +02:00
parent 9c0210d485
commit 8c2488d6fe
8 changed files with 411 additions and 376 deletions

View File

@@ -14,7 +14,20 @@ import './styles.css';
import styles from './styles.module.css';
import AnchorIcon from "./anchor.svg"
const Heading = (Tag) =>
export const MainHeading = function MainHeading({...props}) {
return (
<header>
<h1
{...props}
id={undefined} // h1 headings do not need an id because they don't appear in the TOC
className={styles.h1Heading}>
{props.children}
</h1>
</header>
);
};
const createAnchorHeading = (Tag) =>
function TargetComponent({id, ...props}) {
const {
navbar: {hideOnScroll},
@@ -49,4 +62,8 @@ const Heading = (Tag) =>
);
};
const Heading = (headingType) => {
return headingType === 'h1' ? MainHeading : createAnchorHeading(headingType);
};
export default Heading;