implements basic site structure
and adds deploy script
This commit is contained in:
parent
5d4cafe8fb
commit
c401b1bc03
18 changed files with 951 additions and 29 deletions
60
content.config.ts
Normal file
60
content.config.ts
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
import z from "astro/zod";
|
||||
import { glob } from "astro/loaders";
|
||||
import { defineCollection } from "astro:content";
|
||||
|
||||
const writingTags = z.enum([
|
||||
'emacs',
|
||||
'neovim',
|
||||
'keyboards',
|
||||
'triathlon',
|
||||
'dev',
|
||||
'design',
|
||||
'linux',
|
||||
'nixos',
|
||||
'ghostty',
|
||||
'niri',
|
||||
]);
|
||||
|
||||
const projectTags = z.enum([
|
||||
'work',
|
||||
'open source',
|
||||
'typescript',
|
||||
'golang',
|
||||
'emacs lisp',
|
||||
'react',
|
||||
'react native',
|
||||
]);
|
||||
|
||||
const writingSchema = z.object({
|
||||
title: z.string(),
|
||||
tags: z.array(writingTags),
|
||||
author: z.string().default('Dennis'),
|
||||
publishedAt: z.coerce.date(),
|
||||
lastUpdatedAt: z.coerce.date().optional(),
|
||||
isPublic: z.boolean(),
|
||||
});
|
||||
|
||||
export type JournalData = z.infer<typeof writingSchema>;
|
||||
|
||||
const projectSchema = z.object({
|
||||
title: z.string(),
|
||||
tags: z.array(projectTags),
|
||||
isWork: z.boolean(),
|
||||
isLeisure: z.boolean(),
|
||||
year: z.number().gte(2012),
|
||||
isPublic: z.boolean(),
|
||||
});
|
||||
|
||||
export type ProjectData = z.infer<typeof projectSchema>;
|
||||
|
||||
const blog = defineCollection({
|
||||
loader: glob({ pattern: '**/*.md', base: 'src/content/blog' }),
|
||||
schema: writingSchema
|
||||
});
|
||||
|
||||
const projects = defineCollection({
|
||||
loader: glob({ pattern: '**/*.md', base: 'src/content/projects' }),
|
||||
schema: projectSchema
|
||||
});
|
||||
|
||||
export const collections = { blog, projects };
|
||||
Loading…
Add table
Add a link
Reference in a new issue