bunki 0.15.0 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/parser.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { Post } from "./types";
1
+ import { Post, CDNConfig } from "./types";
2
2
  import { type ParseError } from "./utils/markdown-utils";
3
3
  export interface ParseResult {
4
4
  posts: Post[];
5
5
  errors: ParseError[];
6
6
  }
7
- export declare function parseMarkdownDirectory(contentDir: string, strictMode?: boolean): Promise<Post[]>;
7
+ export declare function parseMarkdownDirectory(contentDir: string, strictMode?: boolean, cdnConfig?: CDNConfig): Promise<Post[]>;
package/dist/types.d.ts CHANGED
@@ -80,6 +80,17 @@ export interface CSSConfig {
80
80
  /** Whether to watch for changes in development */
81
81
  watch?: boolean;
82
82
  }
83
+ /**
84
+ * Configuration for CDN URL transformation
85
+ */
86
+ export interface CDNConfig {
87
+ /** Base URL for CDN (e.g., "https://img.beconfused.com") */
88
+ baseUrl: string;
89
+ /** Path pattern for CDN URLs (e.g., "{year}/{slug}/{filename}") */
90
+ pathPattern: string;
91
+ /** Whether CDN transformation is enabled */
92
+ enabled: boolean;
93
+ }
83
94
  /**
84
95
  * Configuration for the site
85
96
  */
@@ -98,6 +109,8 @@ export interface SiteConfig {
98
109
  s3?: S3Config;
99
110
  /** CSS processing configuration */
100
111
  css?: CSSConfig;
112
+ /** CDN URL transformation configuration */
113
+ cdn?: CDNConfig;
101
114
  /** Optional number of tags to display on homepage (sorted by count). If not set, all tags are shown */
102
115
  maxTagsOnHomepage?: number;
103
116
  /** Optional list of domains to exclude from nofollow attribute. Links to these domains will have follow attribute. */
@@ -55,10 +55,12 @@ export declare function writeFile(filePath: string, content: string): Promise<vo
55
55
  */
56
56
  export declare function writeFileBuffer(filePath: string, data: Uint8Array | ArrayBuffer): Promise<void>;
57
57
  /**
58
- * Get base filename without extension
58
+ * Get base filename without extension, handling both patterns:
59
+ * - content/2025/georgia-aquarium-atlanta.md → georgia-aquarium-atlanta
60
+ * - content/2025/georgia-aquarium-atlanta/README.md → georgia-aquarium-atlanta
59
61
  * @param filePath - Path to file
60
62
  * @param extension - Extension to remove (default: ".md")
61
- * @returns Base filename
63
+ * @returns Base filename (slug)
62
64
  */
63
65
  export declare function getBaseFilename(filePath: string, extension?: string): string;
64
66
  /**
@@ -1,7 +1,7 @@
1
- import { Post } from "../types";
1
+ import { Post, CDNConfig } from "../types";
2
2
  export declare function setNoFollowExceptions(exceptions: string[]): void;
3
3
  export declare function extractExcerpt(content: string, maxLength?: number): string;
4
- export declare function convertMarkdownToHtml(markdownContent: string): string;
4
+ export declare function convertMarkdownToHtml(markdownContent: string, cdnConfig?: CDNConfig): string;
5
5
  export interface ParseError {
6
6
  file: string;
7
7
  type: "yaml" | "missing_field" | "file_not_found" | "unknown" | "validation";
@@ -12,4 +12,4 @@ export interface ParseMarkdownResult {
12
12
  post: Post | null;
13
13
  error: ParseError | null;
14
14
  }
15
- export declare function parseMarkdownFile(filePath: string): Promise<ParseMarkdownResult>;
15
+ export declare function parseMarkdownFile(filePath: string, cdnConfig?: CDNConfig): Promise<ParseMarkdownResult>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunki",
3
- "version": "0.15.0",
3
+ "version": "0.16.1",
4
4
  "description": "An opinionated static site generator built with Bun featuring PostCSS integration and modern web development workflows",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",