This commit is contained in:
Morten Olsen
2024-04-19 20:51:52 +02:00
committed by Morten Olsen
parent 98e39a54cc
commit ee37ac9d90
51 changed files with 604 additions and 798 deletions

View File

@@ -1,31 +1,33 @@
---
import Time from '@/components/time/absolute.astro';
import { data } from '@/data/data.js';
import { formatYearMonth } from '@/utils/time.js';
import Time from '@/components/time/absolute.astro'
import { data } from '@/data/data.js'
import { formatYearMonth } from '@/utils/time.js'
type Props = {
class?: string;
};
class?: string
}
const { class: className, ...rest } = Astro.props;
const allWork = await data.work.find();
const { class: className, ...rest } = Astro.props
const allWork = await data.work.find()
const work = allWork.sort((a, b) => {
return new Date(b.data.startDate).getTime() - new Date(a.data.startDate).getTime();
});
return (
new Date(b.data.startDate).getTime() - new Date(a.data.startDate).getTime()
)
})
---
<div class:list={[className]} {...rest}>
<h2>Work</h2>
<div class="list">
<div class='list'>
{
work.map((item) => (
<div class="item">
<div class="time">
<div class='item'>
<div class='time'>
<Time format={formatYearMonth} datetime={item.data.endDate} />
<br />
<Time format={formatYearMonth} datetime={item.data.startDate} />
</div>
<div class="content">
<div class='content'>
<h3>{item.data.position}</h3>
<h4>@ {item.data.name}</h4>
<p>{item.data.summary}</p>
@@ -34,10 +36,10 @@ const work = allWork.sort((a, b) => {
))
}
</div>
<a href="/work-history">See full work history</a>
<a href='/work-history'>See full work history</a>
</div>
<style>
<style lang='less'>
h2 {
font-size: var(--font-xl);
margin-bottom: var(--space-lg);