1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2025-05-29 22:37:44 +02:00

chore: maintenance

This commit is contained in:
Divlo
2021-12-04 15:52:51 +01:00
parent e5f4615f7f
commit 729e540d04
69 changed files with 10182 additions and 18460 deletions

View File

@ -1,18 +1,23 @@
import { GetStaticProps } from 'next'
import { GetStaticProps, NextPage } from 'next'
import useTranslation from 'next-translate/useTranslation'
import { ErrorPage } from 'components/ErrorPage'
import { Head } from 'components/Head'
import { Header } from 'components/Header'
import { Footer, FooterProps } from 'components/Footer'
import { getDefaultDescription } from 'utils/getDefaultDescription'
const Error404: React.FC<FooterProps> = (props) => {
interface Error404Props extends FooterProps {
description: string
}
const Error404: NextPage<Error404Props> = (props) => {
const { t } = useTranslation()
const { version } = props
const { version, description } = props
return (
<>
<Head title='404 | Divlo' />
<Head title='404 | Divlo' description={description} />
<Header showLanguage />
<main className='flex flex-col md:mx-auto md:max-w-4xl lg:max-w-7xl'>
@ -26,7 +31,8 @@ const Error404: React.FC<FooterProps> = (props) => {
export const getStaticProps: GetStaticProps<FooterProps> = async () => {
const { readPackage } = await import('read-pkg')
const { version } = await readPackage()
return { props: { version } }
const description = getDefaultDescription()
return { props: { version, description } }
}
export default Error404

View File

@ -1,18 +1,23 @@
import { GetStaticProps } from 'next'
import { GetStaticProps, NextPage } from 'next'
import useTranslation from 'next-translate/useTranslation'
import { ErrorPage } from 'components/ErrorPage'
import { Head } from 'components/Head'
import { Header } from 'components/Header'
import { Footer, FooterProps } from 'components/Footer'
import { getDefaultDescription } from 'utils/getDefaultDescription'
const Error500: React.FC<FooterProps> = (props) => {
interface Error500Props extends FooterProps {
description: string
}
const Error500: NextPage<Error500Props> = (props) => {
const { t } = useTranslation()
const { version } = props
const { version, description } = props
return (
<>
<Head title='500 | Divlo' />
<Head title='500 | Divlo' description={description} />
<Header showLanguage />
<main className='flex flex-col md:mx-auto md:max-w-4xl lg:max-w-7xl'>
@ -26,7 +31,8 @@ const Error500: React.FC<FooterProps> = (props) => {
export const getStaticProps: GetStaticProps<FooterProps> = async () => {
const { readPackage } = await import('read-pkg')
const { version } = await readPackage()
return { props: { version } }
const description = getDefaultDescription()
return { props: { version, description } }
}
export default Error500

View File

@ -4,7 +4,7 @@ const Document: React.FC = () => {
return (
<Html>
<Head />
<body className='bg-white dark:bg-black text-black dark:text-white font-headline'>
<body className='bg-white font-headline text-black dark:bg-black dark:text-white'>
<Main />
<NextScript />
</body>

View File

@ -1,4 +1,4 @@
import { GetStaticProps, GetStaticPaths } from 'next'
import { GetStaticProps, GetStaticPaths, NextPage } from 'next'
import { MDXRemote } from 'next-mdx-remote'
import date from 'date-and-time'
import 'prism-themes/themes/prism-one-dark.css'
@ -12,7 +12,7 @@ interface BlogPostPageProps extends FooterProps {
post: Post
}
const BlogPostPage: React.FC<BlogPostPageProps> = (props) => {
const BlogPostPage: NextPage<BlogPostPageProps> = (props) => {
const { version, post } = props
return (
@ -23,8 +23,8 @@ const BlogPostPage: React.FC<BlogPostPageProps> = (props) => {
/>
<Header />
<main className='flex flex-col flex-wrap flex-1 items-center'>
<div className='flex flex-col items-center my-10'>
<main className='flex flex-1 flex-col flex-wrap items-center'>
<div className='my-10 flex flex-col items-center'>
<h1 className='text-3xl font-semibold'>{post.frontmatter.title}</h1>
<p className='mt-2' data-cy='blog-post-date'>
{date.format(new Date(post.frontmatter.publishedOn), 'DD/MM/YYYY')}

View File

@ -1,4 +1,4 @@
import { GetStaticProps } from 'next'
import { GetStaticProps, NextPage } from 'next'
import Link from 'next/link'
import date from 'date-and-time'
@ -15,7 +15,7 @@ interface BlogPageProps extends FooterProps {
posts: PostMetadata[]
}
const BlogPage: React.FC<BlogPageProps> = (props) => {
const BlogPage: NextPage<BlogPageProps> = (props) => {
const { version, posts } = props
return (
@ -23,14 +23,14 @@ const BlogPage: React.FC<BlogPageProps> = (props) => {
<Head title='Blog | Divlo' description={blogDescription} />
<Header />
<main className='flex flex-col flex-wrap flex-1 items-center'>
<div className='flex flex-col items-center mt-10'>
<main className='flex flex-1 flex-col flex-wrap items-center'>
<div className='mt-10 flex flex-col items-center'>
<h1 className='text-4xl font-semibold'>Blog</h1>
<p className='mt-6' data-cy='blog-post-date'>
{blogDescription}
</p>
</div>
<div className='w-full flex items-center justify-center p-8'>
<div className='flex w-full items-center justify-center p-8'>
<div className='w-[1600px]' data-cy='blog-posts'>
{posts.map((post, index) => {
const postPublishedOn = date.format(
@ -40,7 +40,7 @@ const BlogPage: React.FC<BlogPageProps> = (props) => {
return (
<Link href={`/blog/${post.slug}`} key={index}>
<a data-cy='blog-post'>
<ShadowContainer className='p-6 cursor-pointer transition duration-200 ease-in-out hover:-translate-y-2'>
<ShadowContainer className='cursor-pointer p-6 transition duration-200 ease-in-out hover:-translate-y-2'>
<h2
data-cy='blog-post-title'
className='text-xl font-semibold'

View File

@ -1,4 +1,4 @@
import { GetStaticProps } from 'next'
import { GetStaticProps, NextPage } from 'next'
import useTranslation from 'next-translate/useTranslation'
import { RevealFade } from 'components/design/RevealFade'
@ -12,14 +12,19 @@ import { Skills } from 'components/Skills'
import { OpenSource } from 'components/OpenSource'
import { Header } from 'components/Header'
import { Footer, FooterProps } from 'components/Footer'
import { getDefaultDescription } from 'utils/getDefaultDescription'
const Home: React.FC<FooterProps> = (props) => {
interface HomeProps extends FooterProps {
description: string
}
const Home: NextPage<HomeProps> = (props) => {
const { t } = useTranslation()
const { version } = props
const { version, description } = props
return (
<>
<Head />
<Head description={description} />
<Header showLanguage />
<main className='flex flex-col md:mx-auto md:max-w-4xl lg:max-w-7xl'>
@ -72,7 +77,8 @@ const Home: React.FC<FooterProps> = (props) => {
export const getStaticProps: GetStaticProps<FooterProps> = async () => {
const { readPackage } = await import('read-pkg')
const { version } = await readPackage()
return { props: { version } }
const description = getDefaultDescription()
return { props: { version, description } }
}
export default Home