From a254146b04a9b9e4cb4dab2262661189ba327485 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 15 Jan 2021 00:27:44 -0800 Subject: [PATCH] feat: add icon for headers to make it easy to link to them --- gatsby-config.js | 4 ++-- gatsby/wrap-page-element.js | 43 ++++++++++++++++++++++++++++++++----- 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/gatsby-config.js b/gatsby-config.js index 265935b66..dad915a1a 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -148,8 +148,8 @@ module.exports = { { resolve: `gatsby-remark-autolink-headers`, options: { - enableCustomId: true, - icon: false, + icon: + '', }, }, ], diff --git a/gatsby/wrap-page-element.js b/gatsby/wrap-page-element.js index 103ddef00..e3c2a9351 100644 --- a/gatsby/wrap-page-element.js +++ b/gatsby/wrap-page-element.js @@ -2,6 +2,7 @@ import React from 'react'; import { BreadcrumbContext } from '../src/components/BreadcrumbContext'; import { PageContext } from '../src/components/PageContext'; +import { Global, css } from '@emotion/core'; import createBreadcrumbs from '../src/utils/create-breadcrumbs'; import pages from '../src/data/sidenav.json'; @@ -10,11 +11,43 @@ const wrapPageElement = ({ element, props }) => { const crumbs = createBreadcrumbs(props.path ?? '/404', pages); return ( - - - {element} - - + <> + + + + {element} + + + ); };