Skip to content

Installation

Installiere mit deinem bevorzugten Paketmanager:

sh
$ npm install -D contentkit
sh
$ pnpm add -D contentkit
sh
$ yarn add -D contentkit
sh
$ bun add -D contentkit

Config initialisieren:

bash
npx contentkit init
bash
pnpm exec contentkit init
bash
yarn contentkit init
bash
bunx contentkit init

Dies 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.md
powershell
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.md

Build:

bash
npx contentkit build
bash
pnpm exec contentkit build
bash
yarn contentkit build
bash
bunx contentkit build

Generierte 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"],
    },
  },
}

Released under the BSD-3-Clause License.