validateSlug prüft regex ^[a-z0-9][a-z0-9-]*$ (lowercase, digits, hyphen; kein führender hyphen). validatePost checkt title, slug und date (muss Date-instanz mit gültigem timestamp sein). 7 tests grün. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src/core | ||
| tests | ||
| .env.example | ||
| .gitignore | ||
| README.md | ||
| deno.jsonc | ||
README.md
publish — Nostr-Publish-Pipeline
Markdown-Posts aus einem Hugo-ähnlichen Content-Ordner zu kind:30023-Events,
Bilder zu Blossom, Signatur via NIP-46-Bunker.
Blaupause für Nostr-Repos: keinerlei Projekt-Konstanten im Code, alles über Env-Variablen konfigurierbar.
Setup
cp .env.example .envund Werte eintragen.- Oder:
.env.localim Eltern-Ordner pflegen unddeno.jsoncanpassen (siehe--env-file=../.env.local-Tasks). deno task check— verifiziert Bunker, Relay-Liste, Blossom-Server.
Befehle
deno task publish— Git-Diff-Modus: publisht nur geänderte Posts.deno task publish --force-all— alle Posts (Migration / Reimport).deno task publish --post <slug>— nur ein Post.deno task publish --dry-run— zeigt, was publiziert würde, ohne Uploads.deno task validate-post content/posts/<ordner>/index.md— Frontmatter-Check.deno task test— Tests.
Struktur
src/core/— Library (Frontmatter, Markdown, Events, Signer, Relays, Blossom).src/subcommands/— CLI-Befehle.src/cli.ts— Entrypoint, Subcommand-Dispatcher.tests/— Unit- und Integration-Tests..github/workflows/publish.yml— CI-Workflow.