Skip to content

Commit 9eb56b1

Browse files
Merge pull request #141 from Web-Dev-Path/fix/no-stylesheets-in-head-component
Fix warning - "no stylesheets in head component"
2 parents 6636994 + 76bf528 commit 9eb56b1

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6868
- updated mobile nav to automatically close when page route change is completed
6969
- adjust flex-basis of a few sections in the about page to better match the design file
7070
- prettierrc "end of line" to auto
71+
- fixed next.js warning - no stylesheets in head component
72+
(added _document.js and moved google fonts into _document.js)
73+

components/layout/Meta.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,6 @@ export default function Meta() {
4444
<meta property='og:image:width' content='1200' />
4545
<meta property='og:image:height' content='1200' />
4646
<meta name='robots' content='index, follow' />
47-
<link rel='preconnect' href='https://fonts.googleapis.com' />
48-
<link
49-
rel='preconnect'
50-
href='https://fonts.gstatic.com'
51-
crossOrigin='true'
52-
/>
53-
<link
54-
href='https://fonts.googleapis.com/css2?family=Assistant:wght@400;700&family=Open+Sans:wght@700&display=swap'
55-
rel='stylesheet'
56-
/>
5747
<link rel='canonical' href='https://www.webdevpath.co' />
5848
</Head>
5949
);

pages/_document.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Html, Head, Main, NextScript } from 'next/document';
2+
3+
export default function Document() {
4+
return (
5+
<Html>
6+
<Head>
7+
<link
8+
rel='stylesheet'
9+
href='https://fonts.googleapis.com/css2?family=Assistant:wght@400;700&family=Open+Sans:wght@700&display=swap'
10+
/>
11+
</Head>
12+
<body>
13+
<Main />
14+
<NextScript />
15+
</body>
16+
</Html>
17+
);
18+
}

0 commit comments

Comments
 (0)