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
|
import type { ReactElement } from 'react';
import { GetStaticProps } from 'next';
import Head from 'next/head';
import Layout from '@components/Layouts/Layout';
import { seo } from '@config/seo';
import { NextPageWithLayout } from '@ts/types/app';
import { loadTranslation } from '@utils/helpers/i18n';
import HomePageContent from '@content/pages/homepage.mdx';
import { ButtonLink } from '@components/Buttons';
import styles from '@styles/pages/Home.module.scss';
import { t } from '@lingui/macro';
import FeedIcon from '@assets/images/icon-feed.svg';
import { ContactIcon } from '@components/Icons';
import { Graph, WebPage } from 'schema-dts';
import { config } from '@config/website';
const Home: NextPageWithLayout = () => {
const CodingLinks = () => {
return (
<ul className={styles['links-list']}>
<li>
<ButtonLink target="/thematique/developpement-web">
{t`Web development`}
</ButtonLink>
</li>
<li>
<ButtonLink target="/projets">{t`Projects`}</ButtonLink>
</li>
</ul>
);
};
const ColdarkRepos = () => {
return (
<ul className={styles['links-list']}>
<li>
<ButtonLink
target="https://github.com/ArmandPhilippot/coldark"
isExternal={true}
>
Github
</ButtonLink>
</li>
<li>
<ButtonLink
target="https://gitlab.com/ArmandPhilippot/coldark"
isExternal={true}
>
Gitlab
</ButtonLink>
</li>
</ul>
);
};
const LibreLinks = () => {
return (
<ul className={styles['links-list']}>
<li>
<ButtonLink target="/thematique/libre">{t`Free`}</ButtonLink>
</li>
<li>
<ButtonLink target="/thematique/linux">{t`Linux`}</ButtonLink>
</li>
</ul>
);
};
const MoreLinks = () => {
return (
<ul className={styles['links-list']}>
<li>
<ButtonLink target="/contact">
<ContactIcon />
{t`Contact me`}
</ButtonLink>
</li>
<li>
<ButtonLink target="/feed">
<FeedIcon className={styles['icon--feed']} />
{t`Subscribe`}
</ButtonLink>
</li>
</ul>
);
};
const components = {
CodingLinks: CodingLinks,
ColdarkRepos: ColdarkRepos,
LibreLinks: LibreLinks,
MoreLinks: MoreLinks,
};
const webpageSchema: WebPage = {
'@id': `${config.url}/#home`,
'@type': 'WebPage',
breadcrumb: { '@id': `${config.url}/#breadcrumb` },
name: seo.legalNotice.title,
description: seo.legalNotice.description,
author: { '@id': `${config.url}/#branding` },
creator: { '@id': `${config.url}/#branding` },
editor: { '@id': `${config.url}/#branding` },
inLanguage: config.locales.defaultLocale,
license: 'https://creativecommons.org/licenses/by-sa/4.0/deed.fr',
reviewedBy: { '@id': `${config.url}/#branding` },
url: `${config.url}`,
};
const schemaJsonLd: Graph = {
'@context': 'https://schema.org',
'@graph': [webpageSchema],
};
return (
<>
<Head>
<title>{seo.homepage.title}</title>
<meta name="description" content={seo.homepage.description} />
<meta property="og:type" content="website" />
<meta property="og:url" content={`${config.url}`} />
<meta property="og:title" content={seo.homepage.title} />
<meta property="og:description" content={seo.homepage.description} />
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(schemaJsonLd) }}
></script>
</Head>
<div id="home">
<HomePageContent components={components} />
</div>
</>
);
};
Home.getLayout = function getLayout(page: ReactElement) {
return <Layout isHome={true}>{page}</Layout>;
};
export const getStaticProps: GetStaticProps = async (ctx) => {
const translation = await loadTranslation(
ctx.locale!,
process.env.NODE_ENV === 'production'
);
return {
props: {
translation,
},
};
};
export default Home;
|