refactor(website): use gatbsy link for doc links, add ids for headlines

This commit is contained in:
moklick
2020-10-14 17:58:54 +02:00
parent c1575ff948
commit 372558c538
10 changed files with 24082 additions and 26 deletions
+25
View File
@@ -0,0 +1,25 @@
import React from 'react';
import { Link as GatsbyLink } from 'gatsby';
const Link = ({ children, to, activeClassName, partiallyActive, ...other }) => {
const internal = /^\/(?!\/)/.test(to);
if (internal) {
return (
<GatsbyLink
to={to}
activeClassName={activeClassName}
partiallyActive={partiallyActive}
{...other}
>
{children}
</GatsbyLink>
);
}
return (
<a href={to} {...other}>
{children}
</a>
);
};
export default Link;