Installation
Installiere mit deinem bevorzugten Paketmanager:
sh
$ npm install -D contentkitsh
$ pnpm add -D contentkitsh
$ yarn add -D contentkitsh
$ bun add -D contentkitConfig initialisieren:
bash
npx contentkit initbash
pnpm exec contentkit initbash
yarn contentkit initbash
bunx contentkit initDies erstellt contentkit.config.ts (oder .js) basierend auf der Umgebung.
Ein Beispieldokument hinzufügen:
bash
mkdir -p content
printf "---\ntitle: Hello World\ndate: 2025-01-01\ntags: [intro]\n---\n\nMein erster Post." > content/hello-world.mdpowershell
New-Item -ItemType Directory -Force -Path content | Out-Null
@"
---
title: Hello World
date: 2025-01-01
tags: [intro]
---
Mein erster Post.
"@ | Set-Content content/hello-world.mdBuild:
bash
npx contentkit buildbash
pnpm exec contentkit buildbash
yarn contentkit buildbash
bunx contentkit buildGenerierte Artefakte liegen in .contentkit/generated und ein virtuelles Package dot-contentkit wird geschrieben. Nun fügen wir das dot-contentkit Package unserem Projekt hinzu.
Öffne zuerst deine tsconfig.json (oder jsconfig.json) Datei und füge folgendes Path Mapping hinzu:
jsonc
{
"compilerOptions": {
"paths": {
"dot-contentkit": [".contentkit/generated"],
},
},
}jsonc
{
"compilerOptions": {
"paths": {
"dot-contentkit": [".contentkit/generated"],
},
},
}