Skip to content

Commit 51562a4

Browse files
committed
wrap in article and add copy links
1 parent 1fa311f commit 51562a4

File tree

4 files changed

+27
-5
lines changed

4 files changed

+27
-5
lines changed

gatsby-config.ts

+7
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ export const plugins = [
5252
},
5353
{
5454
resolve: 'gatsby-plugin-mdx',
55+
options: {
56+
gatsbyRemarkPlugins: [
57+
{
58+
resolve: `gatsby-remark-autolink-headers`,
59+
},
60+
],
61+
},
5562
},
5663
{
5764
resolve: `gatsby-source-filesystem`,

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"gatsby-plugin-root-import": "^2.0.9",
6363
"gatsby-plugin-sharp": "^5.8.1",
6464
"gatsby-plugin-sitemap": "^6.12.1",
65+
"gatsby-remark-autolink-headers": "^6.14.0",
6566
"gatsby-source-filesystem": "^5.12.0",
6667
"gatsby-transformer-remark": "^6.12.0",
6768
"gatsby-transformer-sharp": "^5.3.0",

src/components/Layout/MDXWrapper.tsx

+7-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { PageProps } from 'gatsby';
44
import '../../styles/global.css';
55
import PageTitle from '../PageTitle';
66
import { MarkdownProvider } from '../Markdown';
7+
import Article from '../Article';
78

89
type PageContextType = {
910
title: string;
@@ -15,10 +16,12 @@ const MDXWrapper: React.FC<MDXWrapperProps> = ({ children, pageContext }) => {
1516
const { title } = pageContext;
1617

1718
return (
18-
<MarkdownProvider>
19-
{title && <PageTitle>{title}</PageTitle>}
20-
{children}
21-
</MarkdownProvider>
19+
<Article>
20+
<MarkdownProvider>
21+
{title && <PageTitle>{title}</PageTitle>}
22+
{children}
23+
</MarkdownProvider>
24+
</Article>
2225
);
2326
};
2427

yarn.lock

+12-1
Original file line numberDiff line numberDiff line change
@@ -8112,6 +8112,17 @@ gatsby-react-router-scroll@^6.13.1:
81128112
"@babel/runtime" "^7.20.13"
81138113
prop-types "^15.8.1"
81148114

8115+
gatsby-remark-autolink-headers@^6.14.0:
8116+
version "6.14.0"
8117+
resolved "https://registry.yarnpkg.com/gatsby-remark-autolink-headers/-/gatsby-remark-autolink-headers-6.14.0.tgz#7a37104b30c55eb666fbd4824294d90b22dc3743"
8118+
integrity sha512-hQkhnj1mMLR+Nd3VjCvgJjGGnrNZcNh+dnFyi9qv5nKtbo24yf2vS99v5c+0KLw9d90kSmdpiEkvA+Bhbh9Kzg==
8119+
dependencies:
8120+
"@babel/runtime" "^7.20.13"
8121+
github-slugger "^1.5.0"
8122+
lodash "^4.17.21"
8123+
mdast-util-to-string "^2.0.0"
8124+
unist-util-visit "^2.0.3"
8125+
81158126
gatsby-script@^2.13.0:
81168127
version "2.13.0"
81178128
resolved "https://registry.yarnpkg.com/gatsby-script/-/gatsby-script-2.13.0.tgz#0fa7316739ebc31da217091e54db8ef86f41dbb3"
@@ -8499,7 +8510,7 @@ [email protected]:
84998510
resolved "https://registry.yarnpkg.com/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce"
85008511
integrity sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==
85018512

8502-
github-slugger@^1.2.1:
8513+
github-slugger@^1.2.1, github-slugger@^1.5.0:
85038514
version "1.5.0"
85048515
resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.5.0.tgz#17891bbc73232051474d68bd867a34625c955f7d"
85058516
integrity sha512-wIh+gKBI9Nshz2o46B0B3f5k/W+WI9ZAv6y5Dn5WJ5SK1t0TnDimB4WE5rmTD05ZAIn8HALCZVmCsvj0w0v0lw==

0 commit comments

Comments
 (0)