summaryrefslogtreecommitdiffstats
path: root/src/pages/cv.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-04-29 12:13:34 +0200
committerArmand Philippot <git@armandphilippot.com>2022-04-29 18:30:05 +0200
commit7e16f500cb7bc0cfd8bafbf6bb1555704f771231 (patch)
treebfc2b4a475cb06a787e2c4bdf284165644e82952 /src/pages/cv.tsx
parent5324664e87bedfaa01ba62c0c847ef5b861e69b3 (diff)
chore: remove old pages, components, helpers and types
Since I'm using new components, I will also rewrite the GraphQL queries so it is easier to start from scratch.
Diffstat (limited to 'src/pages/cv.tsx')
-rw-r--r--src/pages/cv.tsx181
1 files changed, 0 insertions, 181 deletions
diff --git a/src/pages/cv.tsx b/src/pages/cv.tsx
deleted file mode 100644
index 71eb449..0000000
--- a/src/pages/cv.tsx
+++ /dev/null
@@ -1,181 +0,0 @@
-import { getLayout } from '@components/Layouts/Layout';
-import PostHeader from '@components/PostHeader/PostHeader';
-import Sidebar from '@components/Sidebar/Sidebar';
-import { CVPreview, SocialMedia, ToC } from '@components/Widgets';
-import CVContent, { intro, meta, pdf, image } from '@content/pages/cv.mdx';
-import styles from '@styles/pages/Page.module.scss';
-import { NextPageWithLayout } from '@ts/types/app';
-import { ArticleMeta } from '@ts/types/articles';
-import { settings } from '@utils/config';
-import { loadTranslation } from '@utils/helpers/i18n';
-import { GetStaticProps, GetStaticPropsContext } from 'next';
-import Head from 'next/head';
-import { useRouter } from 'next/router';
-import Script from 'next/script';
-import { useIntl } from 'react-intl';
-import { AboutPage, Graph, WebPage } from 'schema-dts';
-
-const CV: NextPageWithLayout = () => {
- const intl = useIntl();
- const router = useRouter();
- const dates = {
- publication: meta.publishedOn,
- update: meta.updatedOn,
- };
-
- const pageMeta: ArticleMeta = {
- dates,
- };
- const pageUrl = `${settings.url}${router.asPath}`;
- const pageTitle = intl.formatMessage(
- {
- defaultMessage: 'CV Front-end developer - {websiteName}',
- description: 'CVPage: SEO - Page title',
- id: 'Y1ZdJ6',
- },
- { websiteName: settings.name }
- );
- const pageDescription = intl.formatMessage(
- {
- defaultMessage:
- 'Discover the curriculum of {websiteName}, front-end developer located in France: skills, experiences and training.',
- description: 'CVPage: SEO - Meta description',
- id: 'bBdMGm',
- },
- { websiteName: settings.name }
- );
-
- const webpageSchema: WebPage = {
- '@id': `${pageUrl}`,
- '@type': 'WebPage',
- breadcrumb: { '@id': `${settings.url}/#breadcrumb` },
- name: pageTitle,
- description: pageDescription,
- reviewedBy: { '@id': `${settings.url}/#branding` },
- url: `${pageUrl}`,
- isPartOf: {
- '@id': `${settings.url}`,
- },
- };
-
- const publicationDate = new Date(dates.publication);
- const updateDate = new Date(dates.update);
-
- const cvSchema: AboutPage = {
- '@id': `${settings.url}/#cv`,
- '@type': 'AboutPage',
- name: pageTitle,
- description: intro,
- author: { '@id': `${settings.url}/#branding` },
- creator: { '@id': `${settings.url}/#branding` },
- dateCreated: publicationDate.toISOString(),
- dateModified: updateDate.toISOString(),
- datePublished: publicationDate.toISOString(),
- editor: { '@id': `${settings.url}/#branding` },
- image,
- inLanguage: settings.locales.defaultLocale,
- license: 'https://creativecommons.org/licenses/by-sa/4.0/deed.fr',
- thumbnailUrl: image,
- mainEntityOfPage: { '@id': `${pageUrl}` },
- };
-
- const schemaJsonLd: Graph = {
- '@context': 'https://schema.org',
- '@graph': [webpageSchema, cvSchema],
- };
-
- const title = intl.formatMessage(
- {
- defaultMessage: "{name}'s CV",
- description: 'CVPage: page title',
- id: 'Mj2BQf',
- },
- { name: settings.name }
- );
-
- return (
- <>
- <Head>
- <title>{pageTitle}</title>
- <meta name="description" content={pageDescription} />
- <meta property="og:url" content={`${pageUrl}`} />
- <meta property="og:type" content="article" />
- <meta property="og:title" content={title} />
- <meta property="og:description" content={intro} />
- <meta property="og:image" content={image} />
- <meta property="og:image:alt" content={title} />
- </Head>
- <Script
- id="schema-cv"
- type="application/ld+json"
- dangerouslySetInnerHTML={{ __html: JSON.stringify(schemaJsonLd) }}
- />
- <article
- id="cv"
- className={`${styles.article} ${styles['article--no-comments']}`}
- >
- <PostHeader intro={intro} meta={pageMeta} title={meta.title} />
- <Sidebar
- position="left"
- ariaLabel={intl.formatMessage({
- defaultMessage: 'Table of Contents',
- description: 'CVPage: ToC sidebar aria-label',
- id: 'g4DckL',
- })}
- >
- <ToC />
- </Sidebar>
- <div className={styles.body}>
- <CVContent />
- </div>
- <Sidebar
- position="right"
- ariaLabel={intl.formatMessage({
- defaultMessage: 'Sidebar',
- description: 'CVPage: right sidebar aria-label',
- id: 'QHOm5t',
- })}
- >
- <CVPreview
- title={intl.formatMessage({
- defaultMessage: 'Others formats',
- description: 'CVPage: cv preview widget title',
- id: 'B9OCyV',
- })}
- imgSrc={image}
- pdf={pdf}
- />
- <SocialMedia
- title={intl.formatMessage({
- defaultMessage: 'Open-source projects',
- description: 'CVPage: social media widget title',
- id: '+Dre5J',
- })}
- github={true}
- gitlab={true}
- />
- </Sidebar>
- </article>
- </>
- );
-};
-
-CV.getLayout = getLayout;
-
-export const getStaticProps: GetStaticProps = async (
- context: GetStaticPropsContext
-) => {
- const breadcrumbTitle = meta.title;
- const { locale } = context;
- const translation = await loadTranslation(locale);
-
- return {
- props: {
- breadcrumbTitle,
- locale,
- translation,
- },
- };
-};
-
-export default CV;