refactor: auto format

This commit is contained in:
Aaron Yarborough 2025-03-09 15:32:18 +00:00
parent 934011b72f
commit 89145ceca8
11 changed files with 47 additions and 47 deletions

View file

@ -3,7 +3,7 @@ import { NextSeo } from 'next-seo'
import Link from 'next/link' import Link from 'next/link'
import React from 'react' import React from 'react'
function Article({ attributes, html }) { function Article ({ attributes, html }) {
return ( return (
<> <>
<h1>{attributes.title}</h1> <h1>{attributes.title}</h1>

View file

@ -2,7 +2,7 @@ import React from 'react'
import style from './Footer.module.css' import style from './Footer.module.css'
function Footer() { function Footer () {
return ( return (
<footer className={style.footer} data-testid='footer'> <footer className={style.footer} data-testid='footer'>
<hr /> <hr />
@ -24,7 +24,6 @@ function Footer() {
</div> </div>
</nav> </nav>
</footer> </footer>
) )
} }

View file

@ -2,7 +2,7 @@ import React from 'react'
import style from './Resume.module.css' import style from './Resume.module.css'
function Resume({ function Resume ({
competencies, competencies,
education, education,
certifications, certifications,
@ -17,14 +17,16 @@ function Resume({
<li key={e.position}> <li key={e.position}>
<a href={'#' + e.position}>{e.position}</a> <a href={'#' + e.position}>{e.position}</a>
</li> </li>
)}</ol></li> )}
</ol>
</li>
<li><a href='#competencies'>Competencies</a></li> <li><a href='#competencies'>Competencies</a></li>
<li><a href='#competencies'>Certifications</a></li> <li><a href='#competencies'>Certifications</a></li>
<li><a href='#languages'>Languages</a></li> <li><a href='#languages'>Languages</a></li>
<li><a href='#education'>Education</a></li> <li><a href='#education'>Education</a></li>
</ol> </ol>
<div> <div>
<h2 id="experience">Professional experience</h2> <h2 id='experience'>Professional experience</h2>
{experience.map((exp, i) => ( {experience.map((exp, i) => (
<WorkExperience <WorkExperience
@ -39,14 +41,14 @@ function Resume({
))} ))}
</div> </div>
<div className='sidebar'> <div className='sidebar'>
<h2 id="competencies">Competencies</h2> <h2 id='competencies'>Competencies</h2>
<ul> <ul>
{competencies.sort().map((c, i) => ( {competencies.sort().map((c, i) => (
<li key={i}>{c}</li> <li key={i}>{c}</li>
))} ))}
</ul> </ul>
<h2 id="certifications">Certifications</h2> <h2 id='certifications'>Certifications</h2>
<ul> <ul>
{certifications.sort().map((c, i) => ( {certifications.sort().map((c, i) => (
<li key={i}>{c}</li> <li key={i}>{c}</li>
@ -70,9 +72,9 @@ function Resume({
) )
} }
export default Resume; export default Resume
function WorkExperience({ position, employer, start, end, children }) { function WorkExperience ({ position, employer, start, end, children }) {
return ( return (
<div className={style['work-experience']}> <div className={style['work-experience']}>
<div> <div>

View file

@ -1,19 +1,19 @@
import { formatDate } from "@/lib/helpers"; import { formatDate } from '@/lib/helpers'
import Link from "next/link"; import Link from 'next/link'
export default function StaticContentList({ entries, urlPrefix }) { export default function StaticContentList ({ entries, urlPrefix }) {
return ( return (
<table> <table>
<tbody> <tbody>
{entries.map((e) => ( {entries.map((e) => (
<tr key={e.slug}> <tr key={e.slug}>
<td>{!!e.attributes.pubdate && <span>{formatDate(e.attributes.pubdate)}</span>}</td> <td>{!!e.attributes.pubdate && <span>{formatDate(e.attributes.pubdate)}</span>}</td>
<td> <td>
<Link href={`${urlPrefix}${e.slug}`}>{e.attributes.title}</Link> <Link href={`${urlPrefix}${e.slug}`}>{e.attributes.title}</Link>
</td> </td>
</tr> </tr>
))} ))}
</tbody> </tbody>
</table> </table>
) )
} }

View file

@ -10,7 +10,7 @@ function DefaultLayout ({ children }) {
<main className={`${style.layout}`}> <main className={`${style.layout}`}>
<Head> <Head>
<link rel='preconnect' href='https://fonts.googleapis.com' /> <link rel='preconnect' href='https://fonts.googleapis.com' />
<link rel='preconnect' href='https://fonts.gstatic.com' crossOrigin='anonymous'/> <link rel='preconnect' href='https://fonts.gstatic.com' crossOrigin='anonymous' />
<link href='https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,100..900;1,100..900&display=swap' rel='stylesheet' /> <link href='https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,100..900;1,100..900&display=swap' rel='stylesheet' />
</Head> </Head>
<Header /> <Header />

View file

@ -52,11 +52,11 @@ export function getStaticEntryProps (contentPath, { params }) {
return { props: { ...entry, attributes } } return { props: { ...entry, attributes } }
} }
export function getStaticEntries(contentPath) { export function getStaticEntries (contentPath) {
const directoryItems = fs.readdirSync(contentPath, { withFileTypes: true }); const directoryItems = fs.readdirSync(contentPath, { withFileTypes: true })
return directoryItems.map((dirent) => return directoryItems.map((dirent) =>
getMarkdownEntry(`${dirent.path}/${dirent.name}`) getMarkdownEntry(`${dirent.path}/${dirent.name}`)
).sort((a, b) => ).sort((a, b) =>
new Date(b.attributes.pubdate).getTime() - new Date(a.attributes.pubdate).getTime() new Date(b.attributes.pubdate).getTime() - new Date(a.attributes.pubdate).getTime()
); )
} }

View file

@ -4,7 +4,7 @@ export default function Document () {
return ( return (
<Html lang='en'> <Html lang='en'>
<Head> <Head>
<link rel="stylesheet" href="https://neat.joeldare.com/neat.css"/> <link rel='stylesheet' href='https://neat.joeldare.com/neat.css' />
</Head> </Head>
<body> <body>
<Main /> <Main />

View file

@ -1,7 +1,7 @@
import ExternalLink from "@/components/ExternalLink/ExternalLink"; import ExternalLink from '@/components/ExternalLink/ExternalLink'
import DefaultLayout from "@/layouts/DefaultLayout/DefaultLayout"; import DefaultLayout from '@/layouts/DefaultLayout/DefaultLayout'
export default function About() { export default function About () {
return ( return (
<DefaultLayout> <DefaultLayout>
<h1>About me</h1> <h1>About me</h1>

View file

@ -20,11 +20,11 @@ function ResumePage ({
<NextSeo <NextSeo
title={Title} openGraph={ title={Title} openGraph={
{ {
title: Title, title: Title
} }
} }
/> />
<h1>{Title}</h1> <h1>{Title}</h1>
<section> <section>
<Resume <Resume
competencies={competencies} competencies={competencies}

View file

@ -7,11 +7,11 @@ import { getStaticEntries } from '@/lib/content'
export const getStaticProps = () => ({ export const getStaticProps = () => ({
props: { props: {
postEntries: getStaticEntries("content/writing") postEntries: getStaticEntries('content/writing')
} }
}) })
export default function Home({ postEntries }) { export default function Home ({ postEntries }) {
return ( return (
<DefaultLayout> <DefaultLayout>
<Head> <Head>
@ -33,7 +33,7 @@ export default function Home({ postEntries }) {
<section> <section>
<h2>Recent posts</h2> <h2>Recent posts</h2>
<StaticContentList entries={postEntries} urlPrefix={"writing/"} /> <StaticContentList entries={postEntries} urlPrefix='writing/' />
</section> </section>
</DefaultLayout> </DefaultLayout>

View file

@ -6,28 +6,27 @@ import StaticContentList from '@/components/StaticContentList/StaticContentList'
export const getStaticProps = () => ({ export const getStaticProps = () => ({
props: { props: {
postEntries: getStaticEntries("./content/writing") postEntries: getStaticEntries('./content/writing')
} }
}) })
export const Title = 'Writing' export const Title = 'Writing'
export default function Writing ({ postEntries }) { export default function Writing ({ postEntries }) {
return ( return (
<DefaultLayout> <DefaultLayout>
<NextSeo <NextSeo
title={Title} title={Title}
openGraph={ openGraph={
{ {
title: Title, title: Title
} }
} }
/> />
<h1>{Title}</h1> <h1>{Title}</h1>
<section> <section>
<StaticContentList entries={postEntries} urlPrefix={'writing/'} /> <StaticContentList entries={postEntries} urlPrefix='writing/' />
</section> </section>
</DefaultLayout> </DefaultLayout>
) )