docker shit

This commit is contained in:
rattatwinko
2025-06-16 22:20:38 +02:00
parent 1303078c2e
commit 682e006e0b
9 changed files with 439 additions and 35 deletions

View File

@@ -4,6 +4,7 @@ import matter from 'gray-matter';
import { remark } from 'remark';
import html from 'remark-html';
import chokidar from 'chokidar';
import type { FSWatcher } from 'chokidar';
export interface Post {
slug: string;
@@ -64,12 +65,13 @@ export async function getPostsByTag(tag: string): Promise<Post[]> {
const allPosts = await getAllPosts();
return allPosts.filter((post) => post.tags.includes(tag));
}
// File watcher setup
let watcher: chokidar.FSWatcher | null = null;
let onChangeCallback: (() => void) | null = null;
export function watchPosts(callback: () => void) {
if (watcher) {
// File watcher setup
let watcher: FSWatcher | null = null;
let onChangeCallback: (() => void) | null = null;
export function watchPosts(callback: () => void) {
if (watcher) {
watcher.close();
}