diff options
| author | Armand Philippot <git@armandphilippot.com> | 2021-12-30 19:47:21 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2021-12-30 19:47:21 +0100 |
| commit | a98b5ea6fe8e8cc98a55e0fd793e6e8660ea31c1 (patch) | |
| tree | 542810ab5aef99150db228bb54fd58303dcb31c7 /src | |
| parent | ab355897a12b7bda1089a44de326d41455a0f7a3 (diff) | |
chore: add prismjs for syntax highlighting
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/Layouts/Layout.tsx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/components/Layouts/Layout.tsx b/src/components/Layouts/Layout.tsx index 35e7d27..d3c13ad 100644 --- a/src/components/Layouts/Layout.tsx +++ b/src/components/Layouts/Layout.tsx @@ -1,9 +1,11 @@ -import { ReactElement, ReactNode } from 'react'; +import { ReactElement, ReactNode, useEffect } from 'react'; +import Prism from 'prismjs'; import Footer from '@components/Footer/Footer'; import Header from '@components/Header/Header'; import Main from '@components/Main/Main'; import Breadcrumb from '@components/Breadcrumb/Breadcrumb'; import { t } from '@lingui/macro'; +import 'prism-themes/themes/prism-coldark-cold.min.css'; const Layout = ({ children, @@ -12,6 +14,10 @@ const Layout = ({ children: ReactNode; isHome?: boolean; }) => { + useEffect(() => { + Prism.highlightAll(); + }, []); + return ( <> <a href="#main" className="screen-reader-text">{t`Skip to content`}</a> |
