Repository navigation
Expand file tree
/
Copy pathlayout.tsx
More file actions
161 lines (144 loc) · 3.54 KB
/
Copy pathlayout.tsx
File metadata and controls
161 lines (144 loc) · 3.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
import ThemeRegistry from '@components/ThemeRegistry';
import ConsentedServices from '@components/consent/services/ConsentedServices';
import seoKeywords from '@data/keywords';
import profile from '@data/profile';
import structuredData from '@data/structuredData';
import GeneralLayout from '@layouts/GeneralLayout';
import '@styles/globals.scss';
import { colors } from '@styles/tokens';
import { absoluteUrl } from '@util/absoluteUrl';
import type { Metadata, Viewport } from 'next';
const metadataValues = {
description:
"AlexJSully's Portfolio & Showcase | Software Developer & Bioinformatician - Explore my featured projects, publications and social media links.",
name: profile.name,
title: "AlexJSully's Portfolio & Showcase",
url: profile.url,
};
/** Site-wide metadata Next.js renders into `<head>`: titles, SEO, icons, and social cards. */
export const metadata: Metadata = {
// General
title: {
template: `%s | ${metadataValues.title}`,
default: metadataValues.title,
},
description: metadataValues.description,
applicationName: metadataValues.title,
referrer: 'origin',
// SEO
keywords: seoKeywords,
category: 'technology',
// Author
authors: [
{
name: metadataValues.name,
url: metadataValues.url,
},
],
creator: metadataValues.name,
publisher: metadataValues.name,
// OpenGraph
openGraph: {
description: metadataValues.description,
images: [
{
url: absoluteUrl('/icon/resoc.png'),
width: 1529,
height: 1021,
alt: metadataValues.title,
},
],
locale: 'en',
title: metadataValues.title,
type: 'website',
url: metadataValues.url,
siteName: metadataValues.title,
},
// metadataBase
metadataBase: new URL(metadataValues.url),
alternates: {
canonical: '/',
},
// Robots
robots: {
index: true,
follow: true,
googleBot: {
index: true,
follow: true,
},
indexifembedded: true,
},
// Icons
icons: {
icon: '/icon/favicon.ico',
shortcut: '/icon/apple-touch-icon.png',
apple: '/icon/apple-touch-icon.png',
other: [
{
rel: 'apple-touch-icon-precomposed',
url: '/icon/apple-touch-icon-precomposed.png',
},
{
rel: 'mask-icon',
url: '/icon/safari-pinned-tab.svg',
},
],
},
// Web manifest
manifest: '/manifest.webmanifest',
// Twitter
twitter: {
card: 'summary_large_image',
title: metadataValues.title,
description: metadataValues.description,
creator: '@AlexJSully',
images: [absoluteUrl('/icon/resoc.png')],
},
// Facebook
facebook: {
appId: process.env.NEXT_PUBLIC_FACEBOOK_APP_ID ?? '',
},
// Apple Web App
appleWebApp: {
capable: true,
title: metadataValues.title,
startupImage: '/icon/apple-touch-icon.png',
statusBarStyle: 'black-translucent',
},
// Custom Meta Tags
other: {
'msapplication-config': '/icon/browserconfig.xml',
'msapplication-TileColor': colors.surface,
'msapplication-TileImage': '/icon/mstile-144x144.png',
},
};
/** Viewport and theme-colour settings Next.js renders into `<head>`. */
export const viewport: Viewport = {
width: 'device-width',
initialScale: 1,
colorScheme: 'dark',
themeColor: colors.page,
};
/** Renders the root layout. */
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang='en'>
<body>
<section>
{/* JSON-LD */}
<script
dangerouslySetInnerHTML={{
__html: JSON.stringify(structuredData),
}}
type='application/ld+json'
/>
</section>
<ThemeRegistry>
<GeneralLayout>{children}</GeneralLayout>
</ThemeRegistry>
<ConsentedServices />
</body>
</html>
);
}