bunki 0.5.3 โ 0.6.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/README.md +133 -513
- package/dist/cli.js +172 -128
- package/dist/index.js +133 -96
- package/dist/site-generator.d.ts +8 -0
- package/dist/types.d.ts +10 -0
- package/dist/utils/css-processor.d.ts +2 -1
- package/dist/utils/file-utils.d.ts +140 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,45 +1,60 @@
|
|
|
1
1
|
# Bunki
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/kahwee/bunki/actions/workflows/ci.yml)
|
|
4
|
+
[](https://coveralls.io/github/kahwee/bunki?branch=main)
|
|
5
|
+
[](https://badge.fury.io/js/bunki)
|
|
4
6
|
|
|
5
|
-
Fast static site generator for blogs
|
|
7
|
+
Fast static site generator for blogs and documentation built with Bun. Supports Markdown + frontmatter, tags, year-based archives, pagination, RSS feeds, sitemaps, secure HTML sanitization, syntax highlighting, PostCSS pipelines, image uploads (S3/R2), and Nunjucks templating.
|
|
6
8
|
|
|
7
9
|
## Install
|
|
8
10
|
|
|
11
|
+
Requires **Bun v1.3.0+** (recommended) or Node.js v18+
|
|
12
|
+
|
|
9
13
|
```bash
|
|
10
|
-
|
|
11
|
-
bun install -g bunki
|
|
12
|
-
npm i bunki # Node (>=18)
|
|
13
|
-
```
|
|
14
|
+
# Install globally with Bun
|
|
15
|
+
bun install -g bunki
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
# Or with npm
|
|
18
|
+
npm install -g bunki
|
|
19
|
+
|
|
20
|
+
# Or in your project
|
|
21
|
+
bun install bunki
|
|
22
|
+
```
|
|
16
23
|
|
|
17
24
|
## Quick Start
|
|
18
25
|
|
|
19
26
|
```bash
|
|
20
|
-
bunki init
|
|
21
|
-
bunki new "
|
|
22
|
-
bunki generate
|
|
23
|
-
bunki serve
|
|
27
|
+
bunki init # Create new site
|
|
28
|
+
bunki new "My First Post" --tags web,notes # Add content
|
|
29
|
+
bunki generate # Build static site
|
|
30
|
+
bunki serve --port 3000 # Preview locally
|
|
24
31
|
```
|
|
25
32
|
|
|
26
|
-
|
|
33
|
+
This creates a fully functional site with Markdown content, responsive templates, and all assets in `dist/`.
|
|
27
34
|
|
|
28
|
-
|
|
35
|
+
## Configuration
|
|
36
|
+
|
|
37
|
+
Create `bunki.config.ts` in your project root:
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
29
40
|
import { SiteConfig } from "bunki";
|
|
41
|
+
|
|
30
42
|
export default (): SiteConfig => ({
|
|
31
43
|
title: "My Blog",
|
|
32
|
-
description: "
|
|
44
|
+
description: "My thoughts and ideas",
|
|
33
45
|
baseUrl: "https://example.com",
|
|
34
46
|
domain: "example.com",
|
|
47
|
+
|
|
48
|
+
// Optional: PostCSS/Tailwind CSS support
|
|
35
49
|
css: {
|
|
36
50
|
input: "templates/styles/main.css",
|
|
37
51
|
output: "css/style.css",
|
|
38
52
|
postcssConfig: "postcss.config.js",
|
|
39
53
|
enabled: true,
|
|
40
|
-
},
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
// Optional: Image upload to Cloudflare R2 or S3
|
|
41
57
|
s3: {
|
|
42
|
-
// optional image upload
|
|
43
58
|
accessKeyId: process.env.R2_ACCESS_KEY_ID || "",
|
|
44
59
|
secretAccessKey: process.env.R2_SECRET_ACCESS_KEY || "",
|
|
45
60
|
bucket: process.env.R2_BUCKET || "",
|
|
@@ -50,181 +65,46 @@ export default (): SiteConfig => ({
|
|
|
50
65
|
});
|
|
51
66
|
```
|
|
52
67
|
|
|
53
|
-
## Frontmatter
|
|
68
|
+
## Content & Frontmatter
|
|
69
|
+
|
|
70
|
+
Create Markdown files in `content/YYYY/` (e.g., `content/2025/my-post.md`):
|
|
54
71
|
|
|
55
72
|
```markdown
|
|
56
73
|
---
|
|
57
74
|
title: "Post Title"
|
|
58
75
|
date: 2025-01-15T09:00:00-07:00
|
|
59
76
|
tags: [web, performance]
|
|
60
|
-
excerpt: Optional summary
|
|
77
|
+
excerpt: "Optional summary for listings"
|
|
61
78
|
---
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
Optional tag descriptions: `src/tags.toml`:
|
|
65
|
-
|
|
66
|
-
```toml
|
|
67
|
-
performance = "Speed & optimization"
|
|
68
|
-
web = "General web dev"
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## CSS (Tailwind example)
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
bun add -D tailwindcss @tailwindcss/postcss @tailwindcss/typography
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
`postcss.config.js`:
|
|
78
|
-
|
|
79
|
-
```js
|
|
80
|
-
module.exports = { plugins: [require("@tailwindcss/postcss")] };
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
`templates/styles/main.css`:
|
|
84
|
-
|
|
85
|
-
```css
|
|
86
|
-
@tailwind base;
|
|
87
|
-
@tailwind components;
|
|
88
|
-
@tailwind utilities;
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
Processed automatically during `bunki generate`.
|
|
92
|
-
|
|
93
|
-
## Images
|
|
94
|
-
|
|
95
|
-
Env vars (R2 / S3):
|
|
96
|
-
|
|
97
|
-
```
|
|
98
|
-
R2_ACCESS_KEY_ID=...
|
|
99
|
-
R2_SECRET_ACCESS_KEY=...
|
|
100
|
-
R2_BUCKET=...
|
|
101
|
-
R2_ENDPOINT=...
|
|
102
|
-
R2_PUBLIC_URL=https://cdn.example.com
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Upload:
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
bunki images:push --images ./images --output-json image-map.json
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
## Programmatic
|
|
112
|
-
|
|
113
|
-
```ts
|
|
114
|
-
import { SiteGenerator, loadConfig } from "bunki";
|
|
115
|
-
const cfg = await loadConfig("./bunki.config.ts");
|
|
116
|
-
const gen = new SiteGenerator({
|
|
117
|
-
contentDir: "content",
|
|
118
|
-
outputDir: "dist",
|
|
119
|
-
templatesDir: "templates",
|
|
120
|
-
config: cfg,
|
|
121
|
-
});
|
|
122
|
-
await gen.initialize();
|
|
123
|
-
await gen.generate();
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
## CLI
|
|
127
|
-
|
|
128
|
-
```
|
|
129
|
-
init | new | generate | serve | images:push | css
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
## Output
|
|
133
|
-
|
|
134
|
-
```
|
|
135
|
-
- ๐ฑ **Mobile-first** responsive templates
|
|
136
|
-
index.html
|
|
137
|
-
feed.xml
|
|
138
|
-
sitemap.xml
|
|
139
|
-
2025/... per-post dirs
|
|
140
|
-
tags/... tag pages
|
|
141
|
-
css/style.css (if enabled)
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
## Security
|
|
145
|
-
|
|
146
|
-
HTML sanitized; external links hardened; unsafe tags stripped.
|
|
147
|
-
|
|
148
|
-
## Changelog
|
|
149
|
-
|
|
150
|
-
v0.5.3 (current)
|
|
151
|
-
|
|
152
|
-
- Modularized CLI commands (init, new, generate, serve, css, images:push)
|
|
153
|
-
- Dependency-injected command handlers for easier unit testing
|
|
154
|
-
- Switched CLI entry to Bun.main/Bun.argv
|
|
155
|
-
- Added/updated tests for init/new handlers; all suites green
|
|
156
|
-
- Minor CSS command robustness and exit handling
|
|
157
|
-
|
|
158
|
-
v0.3.x
|
|
159
|
-
|
|
160
|
-
- PostCSS pipeline + `css` command
|
|
161
|
-
- Export map + sideEffects=false for tree-shaking
|
|
162
|
-
- Prepack build cleanup
|
|
163
|
-
|
|
164
|
-
## Contribute
|
|
165
|
-
|
|
166
|
-
```bash
|
|
167
|
-
bun install
|
|
168
|
-
bun run build
|
|
169
|
-
bun test
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
## License
|
|
173
|
-
|
|
174
|
-
MIT ยฉ KahWee Teng
|
|
175
|
-
|
|
176
|
-
- โก **Simple CLI interface** with intuitive commands
|
|
177
79
|
|
|
178
|
-
|
|
80
|
+
# Post Title
|
|
179
81
|
|
|
180
|
-
|
|
82
|
+
Your content here with **markdown** support.
|
|
181
83
|
|
|
182
|
-
|
|
84
|
+

|
|
183
85
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
return {
|
|
189
|
-
title: "My Blog",
|
|
190
|
-
description: "A blog built with Bunki",
|
|
191
|
-
baseUrl: "https://example.com",
|
|
192
|
-
domain: "blog",
|
|
193
|
-
// CSS processing configuration
|
|
194
|
-
css: {
|
|
195
|
-
input: "templates/styles/main.css", // Input CSS file
|
|
196
|
-
output: "css/style.css", // Output path in dist
|
|
197
|
-
postcssConfig: "postcss.config.js", // PostCSS config file
|
|
198
|
-
enabled: true, // Enable CSS processing
|
|
199
|
-
watch: false, // Watch for changes (dev mode)
|
|
200
|
-
},
|
|
201
|
-
// ... other config
|
|
202
|
-
};
|
|
203
|
-
}
|
|
86
|
+
<video controls width="640" height="360">
|
|
87
|
+
<source src="video.mp4" type="video/mp4">
|
|
88
|
+
Your browser does not support HTML5 video.
|
|
89
|
+
</video>
|
|
204
90
|
```
|
|
205
91
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
```bash
|
|
209
|
-
# Process CSS as part of site generation
|
|
210
|
-
bunki generate
|
|
92
|
+
Optional: Define tag descriptions in `src/tags.toml`:
|
|
211
93
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
# Watch CSS files for changes (development)
|
|
216
|
-
bunki css --watch
|
|
94
|
+
```toml
|
|
95
|
+
performance = "Performance optimization and speed"
|
|
96
|
+
web = "Web development and technology"
|
|
217
97
|
```
|
|
218
98
|
|
|
219
|
-
|
|
99
|
+
## CSS & Tailwind
|
|
220
100
|
|
|
221
|
-
|
|
101
|
+
To use Tailwind CSS:
|
|
222
102
|
|
|
223
103
|
```bash
|
|
224
104
|
bun add -D tailwindcss @tailwindcss/postcss @tailwindcss/typography
|
|
225
105
|
```
|
|
226
106
|
|
|
227
|
-
|
|
107
|
+
Create `postcss.config.js`:
|
|
228
108
|
|
|
229
109
|
```javascript
|
|
230
110
|
module.exports = {
|
|
@@ -232,19 +112,7 @@ module.exports = {
|
|
|
232
112
|
};
|
|
233
113
|
```
|
|
234
114
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
```javascript
|
|
238
|
-
module.exports = {
|
|
239
|
-
content: ["./content/**/*.{md,mdx}", "./templates/**/*.{njk,html}"],
|
|
240
|
-
theme: {
|
|
241
|
-
extend: {},
|
|
242
|
-
},
|
|
243
|
-
plugins: [require("@tailwindcss/typography")],
|
|
244
|
-
};
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
4. **Create your CSS file** (`templates/styles/main.css`):
|
|
115
|
+
Create `templates/styles/main.css`:
|
|
248
116
|
|
|
249
117
|
```css
|
|
250
118
|
@tailwind base;
|
|
@@ -252,377 +120,129 @@ module.exports = {
|
|
|
252
120
|
@tailwind utilities;
|
|
253
121
|
```
|
|
254
122
|
|
|
255
|
-
|
|
123
|
+
CSS is processed automatically during `bunki generate`.
|
|
256
124
|
|
|
257
|
-
##
|
|
125
|
+
## Image Management
|
|
258
126
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
### Prerequisites
|
|
127
|
+
Upload images to Cloudflare R2 or S3:
|
|
262
128
|
|
|
263
129
|
```bash
|
|
264
|
-
#
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
### Installation Options
|
|
272
|
-
|
|
273
|
-
```bash
|
|
274
|
-
# Install globally with Bun
|
|
275
|
-
bun install -g bunki
|
|
276
|
-
|
|
277
|
-
# Or with npm
|
|
278
|
-
npm install -g bunki
|
|
279
|
-
|
|
280
|
-
# Or install locally in your project
|
|
281
|
-
bun install bunki
|
|
282
|
-
# or
|
|
283
|
-
npm install bunki
|
|
284
|
-
|
|
285
|
-
# Or from GitHub for development
|
|
286
|
-
git clone git@github.com:kahwee/bunki.git
|
|
287
|
-
cd bunki
|
|
288
|
-
bun install
|
|
289
|
-
bun run build
|
|
290
|
-
bun link
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
## ๐ Quick Start
|
|
294
|
-
|
|
295
|
-
### Initialize a New Site
|
|
296
|
-
|
|
297
|
-
```bash
|
|
298
|
-
# Create a new site with default templates and configuration
|
|
299
|
-
bunki init
|
|
300
|
-
|
|
301
|
-
# This creates:
|
|
302
|
-
# - bunki.config.ts (configuration)
|
|
303
|
-
# - content/ (for markdown posts)
|
|
304
|
-
# - templates/ (Nunjucks templates)
|
|
305
|
-
# - public/ (static assets)
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
### Add Content
|
|
309
|
-
|
|
310
|
-
Create markdown files in the `content` directory with frontmatter:
|
|
311
|
-
|
|
312
|
-
````markdown
|
|
313
|
-
---
|
|
314
|
-
title: Your Post Title
|
|
315
|
-
date: 2025-01-01T09:00:00-07:00
|
|
316
|
-
tags: [web-development, javascript]
|
|
317
|
-
---
|
|
318
|
-
|
|
319
|
-
# Your Post Title
|
|
320
|
-
|
|
321
|
-
Your post content goes here with **markdown** support!
|
|
322
|
-
|
|
323
|
-
```javascript
|
|
324
|
-
console.log("Code highlighting works too!");
|
|
325
|
-
```
|
|
326
|
-
|
|
327
|
-
You can also embed videos using HTML5 video tags:
|
|
328
|
-
|
|
329
|
-
<video src="https://example.com/video.mp4" controls width="640" height="360"></video>
|
|
330
|
-
|
|
331
|
-
Or with multiple formats for better browser compatibility:
|
|
332
|
-
|
|
333
|
-
<video controls width="640" height="360" poster="thumbnail.jpg">
|
|
334
|
-
<source src="video.mp4" type="video/mp4">
|
|
335
|
-
<source src="video.webm" type="video/webm">
|
|
336
|
-
Your browser does not support the video tag.
|
|
337
|
-
</video>
|
|
338
|
-
````
|
|
339
|
-
|
|
340
|
-
````
|
|
341
|
-
|
|
342
|
-
Or use the CLI to create a new post:
|
|
343
|
-
|
|
344
|
-
```bash
|
|
345
|
-
bunki new "Your Post Title" --tags "web-development, javascript"
|
|
346
|
-
````
|
|
347
|
-
|
|
348
|
-
### Generate Your Site
|
|
349
|
-
|
|
350
|
-
```bash
|
|
351
|
-
# Generate the static site (includes CSS processing)
|
|
352
|
-
bunki generate
|
|
353
|
-
```
|
|
354
|
-
|
|
355
|
-
### Preview Your Site
|
|
356
|
-
|
|
357
|
-
```bash
|
|
358
|
-
# Start a local development server
|
|
359
|
-
bunki serve
|
|
360
|
-
|
|
361
|
-
# Custom port
|
|
362
|
-
bunki serve --port 3000
|
|
363
|
-
```
|
|
364
|
-
|
|
365
|
-
## โ๏ธ Configuration
|
|
366
|
-
|
|
367
|
-
The `bunki.config.ts` file contains the configuration for your site:
|
|
368
|
-
|
|
369
|
-
```typescript
|
|
370
|
-
import { SiteConfig } from "bunki";
|
|
371
|
-
import { config } from "dotenv";
|
|
372
|
-
|
|
373
|
-
// Load environment variables from .env file
|
|
374
|
-
config();
|
|
375
|
-
|
|
376
|
-
export default function (): SiteConfig {
|
|
377
|
-
return {
|
|
378
|
-
title: "My Blog",
|
|
379
|
-
description: "A blog built with Bunki",
|
|
380
|
-
baseUrl: "https://example.com",
|
|
381
|
-
domain: "blog",
|
|
382
|
-
|
|
383
|
-
// CSS processing configuration
|
|
384
|
-
css: {
|
|
385
|
-
input: "templates/styles/main.css",
|
|
386
|
-
output: "css/style.css",
|
|
387
|
-
postcssConfig: "postcss.config.js",
|
|
388
|
-
enabled: true,
|
|
389
|
-
watch: false,
|
|
390
|
-
},
|
|
391
|
-
|
|
392
|
-
// Cloud storage configuration for images
|
|
393
|
-
publicUrl: process.env.R2_PUBLIC_URL,
|
|
394
|
-
s3: {
|
|
395
|
-
accessKeyId: process.env.R2_ACCESS_KEY_ID || "",
|
|
396
|
-
secretAccessKey: process.env.R2_SECRET_ACCESS_KEY || "",
|
|
397
|
-
bucket: process.env.R2_BUCKET || "",
|
|
398
|
-
endpoint: process.env.R2_ENDPOINT,
|
|
399
|
-
region: process.env.R2_REGION || "auto",
|
|
400
|
-
},
|
|
401
|
-
};
|
|
402
|
-
}
|
|
403
|
-
```
|
|
404
|
-
|
|
405
|
-
## ๐ผ๏ธ Image Management
|
|
406
|
-
|
|
407
|
-
Bunki uses Bun's native S3 API for efficient image uploads to S3-compatible services like Cloudflare R2.
|
|
408
|
-
|
|
409
|
-
### Environment Configuration
|
|
410
|
-
|
|
411
|
-
Create a `.env` file with your storage credentials:
|
|
130
|
+
# Set up environment variables first
|
|
131
|
+
cat > .env << EOF
|
|
132
|
+
R2_ACCESS_KEY_ID=...
|
|
133
|
+
R2_SECRET_ACCESS_KEY=...
|
|
134
|
+
R2_BUCKET=...
|
|
135
|
+
R2_PUBLIC_URL=https://cdn.example.com
|
|
136
|
+
EOF
|
|
412
137
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
R2_ACCESS_KEY_ID=your-access-key
|
|
416
|
-
R2_SECRET_ACCESS_KEY=your-secret-key
|
|
417
|
-
R2_BUCKET=your-bucket
|
|
418
|
-
R2_PUBLIC_URL=https://your-cdn-url.com
|
|
138
|
+
# Upload images
|
|
139
|
+
bunki images:push --images ./images --output-json image-map.json
|
|
419
140
|
```
|
|
420
141
|
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
```env
|
|
424
|
-
R2_CUSTOM_DOMAIN_EXAMPLE_COM=cdn.example.com
|
|
425
|
-
```
|
|
142
|
+
Supported formats: JPG, PNG, GIF, WebP, SVG
|
|
426
143
|
|
|
427
|
-
|
|
144
|
+
## CLI Commands
|
|
428
145
|
|
|
429
146
|
```bash
|
|
430
|
-
|
|
431
|
-
bunki
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
bunki
|
|
435
|
-
|
|
436
|
-
# Output URL mapping to a JSON file for reference
|
|
437
|
-
bunki images:push --output-json image-urls.json
|
|
438
|
-
|
|
439
|
-
# Upload for a specific domain
|
|
440
|
-
bunki images:push --domain example.com
|
|
147
|
+
bunki init [--config FILE] # Initialize new site
|
|
148
|
+
bunki new <TITLE> [--tags TAG1,TAG2] # Create new post
|
|
149
|
+
bunki generate [--config FILE] # Build static site
|
|
150
|
+
bunki serve [--port 3000] # Start dev server
|
|
151
|
+
bunki css [--watch] # Process CSS
|
|
152
|
+
bunki images:push [--domain DOMAIN] # Upload images to cloud
|
|
441
153
|
```
|
|
442
154
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
## ๐ Directory Structure
|
|
155
|
+
## Output Structure
|
|
446
156
|
|
|
447
157
|
```
|
|
448
|
-
|
|
449
|
-
โโโ
|
|
450
|
-
โโโ
|
|
451
|
-
โโโ
|
|
452
|
-
โโโ .
|
|
453
|
-
โโโ
|
|
454
|
-
โ โโโ
|
|
455
|
-
โ
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
โ
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
โ โโโ tag.njk # Tag page
|
|
462
|
-
โ โโโ tags.njk # Tags index
|
|
463
|
-
โ โโโ archive.njk # Year archive
|
|
464
|
-
โ โโโ styles/ # CSS source files
|
|
465
|
-
โ โโโ main.css # Main stylesheet
|
|
466
|
-
โโโ images/ # Local images (uploaded to cloud)
|
|
467
|
-
โโโ public/ # Static assets (copied to dist)
|
|
468
|
-
โโโ src/ # Tag descriptions
|
|
469
|
-
โ โโโ tags.toml # Tag metadata
|
|
470
|
-
โโโ dist/ # Generated site (output)
|
|
471
|
-
โโโ index.html
|
|
472
|
-
โโโ css/
|
|
473
|
-
โ โโโ style.css # Processed CSS
|
|
474
|
-
โโโ 2025/
|
|
475
|
-
โ โโโ my-first-post/
|
|
476
|
-
โ โโโ index.html
|
|
477
|
-
โโโ tags/
|
|
478
|
-
โโโ feed.xml # RSS feed
|
|
479
|
-
โโโ sitemap.xml # Sitemap
|
|
158
|
+
dist/
|
|
159
|
+
โโโ index.html # Homepage
|
|
160
|
+
โโโ feed.xml # RSS feed
|
|
161
|
+
โโโ sitemap.xml # XML sitemap
|
|
162
|
+
โโโ css/style.css # Processed stylesheet
|
|
163
|
+
โโโ 2025/
|
|
164
|
+
โ โโโ my-post/
|
|
165
|
+
โ โโโ index.html # Post page
|
|
166
|
+
โโโ tags/
|
|
167
|
+
โ โโโ web/
|
|
168
|
+
โ โโโ index.html # Tag page
|
|
169
|
+
โโโ page/
|
|
170
|
+
โโโ 2/index.html # Paginated content
|
|
480
171
|
```
|
|
481
172
|
|
|
482
|
-
##
|
|
173
|
+
## Features
|
|
483
174
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
images:push [options] Upload images to cloud storage
|
|
494
|
-
help [command] Display help for command
|
|
495
|
-
|
|
496
|
-
Options:
|
|
497
|
-
-V, --version Display version number
|
|
498
|
-
-h, --help Display help for command
|
|
499
|
-
```
|
|
175
|
+
- **Markdown Processing**: Frontmatter extraction, code highlighting, HTML sanitization
|
|
176
|
+
- **Security**: XSS protection, sanitized HTML, link hardening
|
|
177
|
+
- **Performance**: Static files, optional gzip, optimized output
|
|
178
|
+
- **Templating**: Nunjucks with custom filters and macros
|
|
179
|
+
- **Styling**: Built-in PostCSS support for modern CSS frameworks
|
|
180
|
+
- **Images**: Direct S3/R2 uploads with URL mapping
|
|
181
|
+
- **SEO**: Automatic RSS feeds, sitemaps, meta tags
|
|
182
|
+
- **Pagination**: Configurable posts per page
|
|
183
|
+
- **Archives**: Year-based and tag-based organization
|
|
500
184
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
```bash
|
|
504
|
-
# Initialize new site
|
|
505
|
-
bunki init --config custom.config.ts
|
|
506
|
-
|
|
507
|
-
# Create new post
|
|
508
|
-
bunki new "My Post Title" --tags "javascript, web-dev"
|
|
509
|
-
|
|
510
|
-
# Generate with custom options
|
|
511
|
-
bunki generate --config bunki.config.ts --output dist
|
|
512
|
-
|
|
513
|
-
# CSS processing
|
|
514
|
-
bunki css --watch # Watch for changes
|
|
515
|
-
bunki css --output dist # Custom output directory
|
|
516
|
-
|
|
517
|
-
# Development server
|
|
518
|
-
bunki serve --port 3000 # Custom port
|
|
519
|
-
bunki serve --output dist # Serve from custom directory
|
|
520
|
-
|
|
521
|
-
# Image upload
|
|
522
|
-
bunki images:push --domain example.com
|
|
523
|
-
bunki images:push --images custom/path --output-json mapping.json
|
|
524
|
-
```
|
|
525
|
-
|
|
526
|
-
## ๐๏ธ Development
|
|
527
|
-
|
|
528
|
-
### Prerequisites for Contributors
|
|
185
|
+
## Development
|
|
529
186
|
|
|
530
187
|
```bash
|
|
531
188
|
git clone git@github.com:kahwee/bunki.git
|
|
532
189
|
cd bunki
|
|
533
190
|
bun install
|
|
534
|
-
```
|
|
535
|
-
|
|
536
|
-
### Development Commands
|
|
537
|
-
|
|
538
|
-
```bash
|
|
539
|
-
# Build the project
|
|
540
|
-
bun run build
|
|
541
|
-
|
|
542
|
-
# Run in development mode with watch
|
|
543
|
-
bun run dev
|
|
544
191
|
|
|
545
|
-
#
|
|
546
|
-
bun test
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
bun
|
|
550
|
-
|
|
551
|
-
# Watch tests
|
|
552
|
-
bun test:watch
|
|
553
|
-
|
|
554
|
-
# Type checking
|
|
555
|
-
bun run typecheck
|
|
556
|
-
|
|
557
|
-
# Format code
|
|
558
|
-
bun run format
|
|
559
|
-
|
|
560
|
-
# Clean build artifacts
|
|
561
|
-
bun run clean
|
|
192
|
+
bun run build # Build distribution
|
|
193
|
+
bun test # Run test suite
|
|
194
|
+
bun test:coverage # Test coverage report
|
|
195
|
+
bun run typecheck # TypeScript validation
|
|
196
|
+
bun run format # Prettier formatting
|
|
562
197
|
```
|
|
563
198
|
|
|
564
|
-
|
|
199
|
+
## Project Structure
|
|
565
200
|
|
|
566
201
|
```
|
|
567
202
|
bunki/
|
|
568
203
|
โโโ src/
|
|
569
|
-
โ โโโ cli.ts
|
|
570
|
-
โ โโโ config.ts
|
|
571
|
-
โ โโโ site-generator.ts
|
|
572
|
-
โ โโโ server.ts
|
|
573
|
-
โ โโโ parser.ts
|
|
574
|
-
โ โโโ types.ts
|
|
575
|
-
โ โโโ utils/
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
โ โโโ s3-uploader.ts # S3 API client
|
|
581
|
-
โโโ test/ # Test files
|
|
582
|
-
โโโ fixtures/ # Test fixtures
|
|
583
|
-
โโโ dist/ # Built output
|
|
204
|
+
โ โโโ cli.ts # CLI interface
|
|
205
|
+
โ โโโ config.ts # Configuration management
|
|
206
|
+
โ โโโ site-generator.ts # Core generation logic
|
|
207
|
+
โ โโโ server.ts # Development server
|
|
208
|
+
โ โโโ parser.ts # Markdown parsing
|
|
209
|
+
โ โโโ types.ts # TypeScript types
|
|
210
|
+
โ โโโ utils/ # Utility modules
|
|
211
|
+
โโโ test/ # Test suite (mirrors src/)
|
|
212
|
+
โโโ templates/ # Example templates
|
|
213
|
+
โโโ fixtures/ # Test fixtures
|
|
214
|
+
โโโ dist/ # Built output
|
|
584
215
|
```
|
|
585
216
|
|
|
586
|
-
##
|
|
587
|
-
|
|
588
|
-
### v0.3.0 (Latest)
|
|
217
|
+
## Changelog
|
|
589
218
|
|
|
590
|
-
|
|
591
|
-
- โจ **NEW**: CSS watch mode for development
|
|
592
|
-
- โจ **NEW**: Framework-agnostic CSS support (Tailwind, etc.)
|
|
593
|
-
- ๐ **IMPROVED**: Enhanced CLI with `css` command
|
|
594
|
-
- ๐ **IMPROVED**: Better error handling and fallbacks
|
|
595
|
-
- ๐ **FIXED**: Directory existence validation for development server
|
|
596
|
-
- ๐ **DOCS**: Comprehensive PostCSS integration guide
|
|
219
|
+
### v0.5.3 (Current)
|
|
597
220
|
|
|
598
|
-
|
|
221
|
+
- Modularized CLI commands with dependency injection
|
|
222
|
+
- Enhanced test coverage (130+ tests, 539+ assertions)
|
|
223
|
+
- Fixed CLI entry point detection (Bun.main compatibility)
|
|
224
|
+
- Added comprehensive server tests using Bun.serve()
|
|
225
|
+
- Improved CSS processor with fallback support
|
|
599
226
|
|
|
600
|
-
|
|
601
|
-
- ๐ **IMPROVED**: Error handling and logging
|
|
602
|
-
- ๐ **DOCS**: Enhanced documentation
|
|
227
|
+
### v0.3.0
|
|
603
228
|
|
|
604
|
-
|
|
229
|
+
- PostCSS integration with CSS processing command
|
|
230
|
+
- Framework-agnostic CSS support (Tailwind, etc.)
|
|
231
|
+
- CSS watch mode for development
|
|
232
|
+
- Better error handling and recovery
|
|
605
233
|
|
|
606
|
-
|
|
234
|
+
## Contributing
|
|
607
235
|
|
|
608
|
-
|
|
236
|
+
Contributions welcome! Areas for improvement:
|
|
609
237
|
|
|
610
|
-
-
|
|
611
|
-
-
|
|
612
|
-
-
|
|
613
|
-
-
|
|
614
|
-
-
|
|
238
|
+
- Bug fixes and error handling
|
|
239
|
+
- Documentation and examples
|
|
240
|
+
- Test coverage expansion
|
|
241
|
+
- Performance optimizations
|
|
242
|
+
- New features and plugins
|
|
615
243
|
|
|
616
|
-
##
|
|
244
|
+
## License
|
|
617
245
|
|
|
618
246
|
MIT ยฉ [KahWee Teng](https://github.com/kahwee)
|
|
619
247
|
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
## ๐โโ๏ธ Support
|
|
623
|
-
|
|
624
|
-
- ๐ [Documentation](https://github.com/kahwee/bunki)
|
|
625
|
-
- ๐ [Issues](https://github.com/kahwee/bunki/issues)
|
|
626
|
-
- ๐ฌ [Discussions](https://github.com/kahwee/bunki/discussions)
|
|
627
|
-
|
|
628
|
-
Built with โค๏ธ using [Bun](https://bun.sh)
|
|
248
|
+
Built with [Bun](https://bun.sh)
|