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 React from 'react'
function Article({ attributes, html }) {
function Article ({ attributes, html }) {
return (
<>
<h1>{attributes.title}</h1>

View file

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

View file

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

View file

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

View file

@ -10,7 +10,7 @@ function DefaultLayout ({ children }) {
<main className={`${style.layout}`}>
<Head>
<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' />
</Head>
<Header />

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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