mirror of
https://github.com/morten-olsen/morten-olsen.github.io.git
synced 2026-02-08 01:46:28 +01:00
docs: updates
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
{
|
||||
"name": "@morten-olsen/personal-webpage-profile",
|
||||
"main": "./dist/index.js"
|
||||
"main": "./dist/index.js",
|
||||
"scripts": {
|
||||
"build": "tsc --build"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
import { Position } from "../types/positions";
|
||||
import { Position } from '../types/positions';
|
||||
|
||||
const context = (require as any).context('../../positions', true, /\.md$/)
|
||||
const context = (require as any).context('../../positions', true, /\.md$/);
|
||||
|
||||
const getPositions = () => context.keys().map((key: string) => context(key)).map((a: any) => ({
|
||||
...a,
|
||||
attributes: {
|
||||
...a.attributes,
|
||||
start: a.attributes.start ? new Date(a.attributes.start).getTime() : null,
|
||||
end: a.attributes.end ? new Date(a.attributes.end).getTime() : null,
|
||||
},
|
||||
})) as Position[];
|
||||
const getPositions = () =>
|
||||
context
|
||||
.keys()
|
||||
.map((key: string) => context(key))
|
||||
.map((a: any) => ({
|
||||
...a,
|
||||
attributes: {
|
||||
...a.attributes,
|
||||
start: a.attributes.start
|
||||
? new Date(a.attributes.start).getTime()
|
||||
: null,
|
||||
end: a.attributes.end ? new Date(a.attributes.end).getTime() : null,
|
||||
},
|
||||
})) as Position[];
|
||||
|
||||
export { getPositions };
|
||||
|
||||
Reference in New Issue
Block a user