docs: ⬆️ on top of core, bump up docusaurus preset-classic + refacto
Signed-off-by: jffarge <jf@dagger.io>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user