Overview#
This PR addresses issues raised in #3 and adds developer tooling improvements.
UX Changes#
Slug Configuration#
- Custom slug from frontmatter: Use a frontmatter field (like
urlorslug) to define the post path by settingfrontmatter.slugField - Smart fallback: If the configured frontmatter field isn't present in a post, automatically falls back to using the filepath
- Hugo index.md support: Remove
/indexor/_indexsuffixes from paths automatically withremoveIndexFromSlug: true
Content Customization#
- Custom text content: Use a frontmatter field like
summaryfor the AT Protocol textContent instead of the full markdown body (settextContentField: "summary") - Description field fix: The
descriptionfield from frontmatter is now properly published to AT Protocol document records (was silently ignored before)
Frontmatter Parsing#
- YAML multiline array support: Tags can now be written in YAML multiline format:
tags: - first-tag - second-tag
Inject Command#
- Improved slug matching using stored slugs from publish state
- Better support for nested directory structures
Developer Experience#
- Added Biome for linting and formatting
- Organized imports and consistent code style across the CLI package
Example Configuration#
{
"siteUrl": "https://example.com",
"contentDir": "content/posts",
"pathPrefix": "/blog",
"publicationUri": "at://did:plc:.../site.standard.publication/...",
"frontmatter": {
"slugField": "url"
},
"removeIndexFromSlug": true,
"textContentField": "summary"
}
Example frontmatter:
---
title: "My Post Title"
date: 2024-01-15
url: "2024/my-custom-slug"
description: "A brief description for AT Protocol"
summary: "A shorter summary for text content"
tags:
- tutorial
- atproto
---
This creates a document at /blog/2024/my-custom-slug with the description and summary properly published.
File Changes#
| File | Changes |
|---|---|
src/lib/types.ts |
Added slugField to FrontmatterMapping, removeIndexFromSlug and textContentField to PublisherConfig, rawFrontmatter to BlogPost |
src/lib/markdown.ts |
Added getSlugFromOptions() with fallback logic, ScanOptions interface, YAML multiline array parsing, rawFrontmatter passthrough |
src/lib/atproto.ts |
Added description to DocumentRecord, implemented textContentField support in createDocument() and updateDocument() |
src/commands/publish.ts |
Pass new config options to scanContentDirectory() |
src/commands/sync.ts |
Pass new config options, fixed path matching with pathPrefix |
src/commands/inject.ts |
Refactored to use stored slugs from state for better matching |
src/lib/config.ts |
Updated config template with new options |
docs/docs/pages/config.mdx |
Documentation for new configuration options |
packages/cli/biome.json |
New Biome configuration for linting/formatting |
wtfff