mirror of
https://github.com/morten-olsen/morten-olsen.github.io.git
synced 2026-02-08 01:46:28 +01:00
init
This commit is contained in:
committed by
Morten Olsen
parent
98e39a54cc
commit
ee37ac9d90
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user