docs: updates

This commit is contained in:
Morten Olsen
2023-01-30 22:21:19 +01:00
parent 7ae92c5420
commit a1fc380c55
19 changed files with 8003 additions and 10456 deletions

View File

@@ -1,4 +1,7 @@
{
"name": "@morten-olsen/personal-webpage-profile",
"main": "./dist/index.js"
"main": "./dist/index.js",
"scripts": {
"build": "tsc --build"
}
}

View File

@@ -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 };