fix: make about.md optional and copy content folder in Dockerfile

This commit is contained in:
ralksta
2026-03-08 20:53:45 +01:00
parent 170fa6e132
commit 593113e88a
2 changed files with 6 additions and 1 deletions

View File

@@ -21,7 +21,11 @@ interface AboutFrontmatter {
}
function getAboutContent() {
const raw = readFileSync(join(process.cwd(), 'content', 'about.md'), 'utf-8');
const filePath = join(process.cwd(), 'content', 'about.md');
if (!require('fs').existsSync(filePath)) {
return { meta: {} as AboutFrontmatter, body: '' };
}
const raw = readFileSync(filePath, 'utf-8');
const { data, content } = matter(raw);
return { meta: data as AboutFrontmatter, body: content.trim() };
}