Personal Website, vers. 1 (pushed far to late)
This commit is contained in:
commit
c8df66d3da
103 files changed
+8977
No files matched your search
@@ -0,0 +1,35 @@
|
||||
import { mkdir, mkdtemp, writeFile } from 'node:fs/promises';
|
||||
import os from 'node:os';
|
||||
import path from 'node:path';
|
||||
import sharp from 'sharp';
|
||||
|
||||
// Builds a small content directory in /tmp so the tests don't depend on the real content.
|
||||
export async function createFixture() {
|
||||
const dir = await mkdtemp(path.join(os.tmpdir(), 'site-content-'));
|
||||
const write = async (file, text) => {
|
||||
await mkdir(path.dirname(path.join(dir, file)), { recursive: true });
|
||||
await writeFile(path.join(dir, file), text);
|
||||
};
|
||||
|
||||
await write('site.yml', 'name: Test\npronouns:\n de: alle Pronomen\n en: any pronouns\nemail: test@example.org\n');
|
||||
await write('home.yml', 'lead:\n de: Hallo\n en: Hello\nareas:\n - visual: homelab\n title: Homelab\n link: homelab\n');
|
||||
await write('journey.yml', 'entries:\n - title: Live\n from: 2024\n - title: Hidden\n from: 2023\n draft: true\n');
|
||||
await write('homelab.yml', 'draft: true\nservices:\n - group: Web\n items:\n - name: nginx\n');
|
||||
await write('pages/journey.de.md', '---\ntitle: Werdegang\n---\nÜber mich');
|
||||
await write('pages/privacy.de.md', '---\ntitle: Datenschutz\n---\nText');
|
||||
await write('pages/privacy.en.md', '---\ntitle: Privacy\n---\nText');
|
||||
|
||||
await write('projects/alpha/meta.yml', 'date: 2026-05\ntags: [web]\nfeatured: true\ncover: cover.png\nvideo: https://youtu.be/dQw4w9WgXcQ\n');
|
||||
await write('projects/alpha/de.md', '---\ntitle: Alpha\nsummary: Erstes Projekt\n---\nText mit Bild\n\n\n');
|
||||
await sharp({ create: { width: 1200, height: 750, channels: 3, background: '#c011d7' } })
|
||||
.png()
|
||||
.toFile(path.join(dir, 'projects/alpha/cover.png'));
|
||||
|
||||
await write('projects/beta/meta.yml', 'date: 2026-04\ntags: [video]\ndraft: true\n');
|
||||
await write('projects/beta/en.md', '---\ntitle: Beta\n---\nDraft');
|
||||
|
||||
await write('projects/broken/meta.yml', 'tags: [oops\n');
|
||||
await write('projects/broken/de.md', '---\ntitle: Kaputt\n---\n');
|
||||
|
||||
return dir;
|
||||
}
|
||||
Reference in new issue
Block a user