bunki 0.7.1 → 0.9.0
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 +199 -3
- package/dist/cli.js +525 -334
- package/dist/index.js +527 -336
- package/dist/utils/json-ld.d.ts +205 -0
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://coveralls.io/github/kahwee/bunki?branch=main)
|
|
5
5
|
[](https://badge.fury.io/js/bunki)
|
|
6
6
|
|
|
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, media uploads (images & videos to S3/R2), incremental uploads with year filtering, and Nunjucks templating.
|
|
7
|
+
Fast static site generator for blogs and documentation built with Bun. Supports Markdown + frontmatter, tags, year-based archives, pagination, RSS feeds, sitemaps, JSON-LD structured data for SEO, secure HTML sanitization, syntax highlighting, PostCSS pipelines, media uploads (images & videos to S3/R2), incremental uploads with year filtering, and Nunjucks templating.
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
@@ -122,6 +122,188 @@ Create `templates/styles/main.css`:
|
|
|
122
122
|
|
|
123
123
|
CSS is processed automatically during `bunki generate`.
|
|
124
124
|
|
|
125
|
+
## JSON-LD Structured Data for SEO
|
|
126
|
+
|
|
127
|
+
Bunki automatically generates [JSON-LD](https://json-ld.org/) structured data markup for enhanced SEO and search engine visibility. JSON-LD (JavaScript Object Notation for Linked Data) is Google's recommended format for structured data.
|
|
128
|
+
|
|
129
|
+
### What is JSON-LD?
|
|
130
|
+
|
|
131
|
+
JSON-LD helps search engines better understand your content by providing explicit, structured information about your pages. This can lead to:
|
|
132
|
+
|
|
133
|
+
- **Rich snippets** in search results (article previews, star ratings, etc.)
|
|
134
|
+
- **Better content indexing** and understanding by search engines
|
|
135
|
+
- **Improved click-through rates** from search results
|
|
136
|
+
- **Knowledge graph integration** with Google, Bing, and other search engines
|
|
137
|
+
|
|
138
|
+
### Automatic Schema Generation
|
|
139
|
+
|
|
140
|
+
Bunki automatically generates appropriate schemas for different page types:
|
|
141
|
+
|
|
142
|
+
#### Blog Posts (BlogPosting Schema)
|
|
143
|
+
|
|
144
|
+
Every blog post includes comprehensive `BlogPosting` schema with:
|
|
145
|
+
|
|
146
|
+
- Headline and description
|
|
147
|
+
- Publication and modification dates
|
|
148
|
+
- Author information
|
|
149
|
+
- Publisher details
|
|
150
|
+
- Article keywords (from tags)
|
|
151
|
+
- Word count
|
|
152
|
+
- Featured image (automatically extracted)
|
|
153
|
+
- Language information
|
|
154
|
+
|
|
155
|
+
Example output in your HTML:
|
|
156
|
+
|
|
157
|
+
```html
|
|
158
|
+
<script type="application/ld+json">
|
|
159
|
+
{
|
|
160
|
+
"@context": "https://schema.org",
|
|
161
|
+
"@type": "BlogPosting",
|
|
162
|
+
"headline": "Getting Started with Bun",
|
|
163
|
+
"description": "Learn how to get started with Bun, the fast JavaScript runtime.",
|
|
164
|
+
"url": "https://example.com/2025/getting-started-with-bun/",
|
|
165
|
+
"datePublished": "2025-01-15T10:30:00.000Z",
|
|
166
|
+
"dateModified": "2025-01-15T10:30:00.000Z",
|
|
167
|
+
"author": {
|
|
168
|
+
"@type": "Person",
|
|
169
|
+
"name": "John Doe",
|
|
170
|
+
"email": "john@example.com"
|
|
171
|
+
},
|
|
172
|
+
"publisher": {
|
|
173
|
+
"@type": "Organization",
|
|
174
|
+
"name": "My Blog",
|
|
175
|
+
"url": "https://example.com"
|
|
176
|
+
},
|
|
177
|
+
"keywords": "bun, javascript, performance",
|
|
178
|
+
"image": "https://example.com/images/bun-logo.png"
|
|
179
|
+
}
|
|
180
|
+
</script>
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
#### Homepage (WebSite & Organization Schemas)
|
|
184
|
+
|
|
185
|
+
The homepage includes dual schemas:
|
|
186
|
+
|
|
187
|
+
1. **WebSite Schema**: Defines the website entity
|
|
188
|
+
2. **Organization Schema**: Defines the publisher/organization
|
|
189
|
+
|
|
190
|
+
```html
|
|
191
|
+
<script type="application/ld+json">
|
|
192
|
+
{
|
|
193
|
+
"@context": "https://schema.org",
|
|
194
|
+
"@type": "WebSite",
|
|
195
|
+
"name": "My Blog",
|
|
196
|
+
"url": "https://example.com",
|
|
197
|
+
"description": "My thoughts and ideas",
|
|
198
|
+
"potentialAction": {
|
|
199
|
+
"@type": "SearchAction",
|
|
200
|
+
"target": {
|
|
201
|
+
"@type": "EntryPoint",
|
|
202
|
+
"urlTemplate": "https://example.com/search?q={search_term_string}"
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
</script>
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
#### Breadcrumbs (BreadcrumbList Schema)
|
|
210
|
+
|
|
211
|
+
All pages include breadcrumb navigation for better site hierarchy understanding:
|
|
212
|
+
|
|
213
|
+
```html
|
|
214
|
+
<script type="application/ld+json">
|
|
215
|
+
{
|
|
216
|
+
"@context": "https://schema.org",
|
|
217
|
+
"@type": "BreadcrumbList",
|
|
218
|
+
"itemListElement": [
|
|
219
|
+
{
|
|
220
|
+
"@type": "ListItem",
|
|
221
|
+
"position": 1,
|
|
222
|
+
"name": "Home",
|
|
223
|
+
"item": "https://example.com"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"@type": "ListItem",
|
|
227
|
+
"position": 2,
|
|
228
|
+
"name": "Getting Started with Bun",
|
|
229
|
+
"item": "https://example.com/2025/getting-started-with-bun/"
|
|
230
|
+
}
|
|
231
|
+
]
|
|
232
|
+
}
|
|
233
|
+
</script>
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Configuration for SEO
|
|
237
|
+
|
|
238
|
+
Enhance your JSON-LD output by providing complete author and site information in `bunki.config.ts`:
|
|
239
|
+
|
|
240
|
+
```typescript
|
|
241
|
+
import { SiteConfig } from "bunki";
|
|
242
|
+
|
|
243
|
+
export default (): SiteConfig => ({
|
|
244
|
+
title: "My Blog",
|
|
245
|
+
description: "My thoughts and ideas on web development",
|
|
246
|
+
baseUrl: "https://example.com",
|
|
247
|
+
domain: "example.com",
|
|
248
|
+
|
|
249
|
+
// Author information (used in BlogPosting schema)
|
|
250
|
+
authorName: "John Doe",
|
|
251
|
+
authorEmail: "john@example.com",
|
|
252
|
+
|
|
253
|
+
// RSS/SEO configuration
|
|
254
|
+
rssLanguage: "en-US", // Language code for content
|
|
255
|
+
copyright: "Copyright © 2025 My Blog",
|
|
256
|
+
|
|
257
|
+
// ... other config
|
|
258
|
+
});
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Testing Your JSON-LD
|
|
262
|
+
|
|
263
|
+
You can validate your structured data using these tools:
|
|
264
|
+
|
|
265
|
+
1. **[Google Rich Results Test](https://search.google.com/test/rich-results)** - Test how Google sees your structured data
|
|
266
|
+
2. **[Schema.org Validator](https://validator.schema.org/)** - Validate JSON-LD syntax
|
|
267
|
+
3. **[Structured Data Linter](http://linter.structured-data.org/)** - Check for errors and warnings
|
|
268
|
+
|
|
269
|
+
### Supported Schema Types
|
|
270
|
+
|
|
271
|
+
Bunki currently supports these Schema.org types:
|
|
272
|
+
|
|
273
|
+
- **BlogPosting** - Individual blog posts and articles
|
|
274
|
+
- **WebSite** - Homepage and site-wide metadata
|
|
275
|
+
- **Organization** - Publisher/organization information
|
|
276
|
+
- **Person** - Author information
|
|
277
|
+
- **BreadcrumbList** - Navigation breadcrumbs
|
|
278
|
+
|
|
279
|
+
### How It Works
|
|
280
|
+
|
|
281
|
+
JSON-LD generation is completely automatic:
|
|
282
|
+
|
|
283
|
+
1. **Post Creation**: When you write a post with frontmatter, Bunki extracts metadata
|
|
284
|
+
2. **Site Generation**: During `bunki generate`, appropriate schemas are created
|
|
285
|
+
3. **Template Injection**: JSON-LD scripts are automatically injected into `<head>`
|
|
286
|
+
4. **Image Extraction**: The first image in your post content is automatically used as the featured image
|
|
287
|
+
|
|
288
|
+
No manual configuration needed - just run `bunki generate` and your site will have complete structured data!
|
|
289
|
+
|
|
290
|
+
### Best Practices
|
|
291
|
+
|
|
292
|
+
To maximize SEO benefits:
|
|
293
|
+
|
|
294
|
+
1. **Use descriptive titles** - Your post title becomes the schema headline
|
|
295
|
+
2. **Write good excerpts** - These become schema descriptions
|
|
296
|
+
3. **Include images** - First image in content is used as featured image
|
|
297
|
+
4. **Tag your posts** - Tags become schema keywords
|
|
298
|
+
5. **Set author info** - Complete `authorName` and `authorEmail` in config
|
|
299
|
+
6. **Use ISO 8601 dates** - Format: `2025-01-15T10:30:00-07:00`
|
|
300
|
+
|
|
301
|
+
### Further Reading
|
|
302
|
+
|
|
303
|
+
- [Schema.org Documentation](https://schema.org/)
|
|
304
|
+
- [Google Search Central - Structured Data](https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data)
|
|
305
|
+
- [JSON-LD Official Spec](https://json-ld.org/)
|
|
306
|
+
|
|
125
307
|
## Image Management
|
|
126
308
|
|
|
127
309
|
### Overview
|
|
@@ -568,7 +750,8 @@ dist/
|
|
|
568
750
|
- **Styling**: Built-in PostCSS support for modern CSS frameworks
|
|
569
751
|
- **Media Management**: Direct S3/R2 uploads for images and MP4 videos with URL mapping
|
|
570
752
|
- **Incremental Uploads**: Year-based filtering (`--min-year`) for large media collections
|
|
571
|
-
- **SEO**: Automatic RSS feeds, sitemaps, meta tags
|
|
753
|
+
- **SEO**: Automatic RSS feeds, sitemaps, meta tags, and JSON-LD structured data
|
|
754
|
+
- **JSON-LD Structured Data**: Automatic Schema.org markup (BlogPosting, WebSite, Organization, BreadcrumbList)
|
|
572
755
|
- **Pagination**: Configurable posts per page
|
|
573
756
|
- **Archives**: Year-based and tag-based organization
|
|
574
757
|
|
|
@@ -606,7 +789,20 @@ bunki/
|
|
|
606
789
|
|
|
607
790
|
## Changelog
|
|
608
791
|
|
|
609
|
-
### v0.
|
|
792
|
+
### v0.8.0 (Current)
|
|
793
|
+
|
|
794
|
+
- **JSON-LD Structured Data**: Automatic Schema.org markup generation for enhanced SEO
|
|
795
|
+
- BlogPosting schema for individual blog posts with author, keywords, images
|
|
796
|
+
- WebSite schema for homepage with search action
|
|
797
|
+
- Organization schema for publisher information
|
|
798
|
+
- BreadcrumbList schema for navigation hierarchy
|
|
799
|
+
- Automatic featured image extraction from post content
|
|
800
|
+
- **Comprehensive SEO**: Complete structured data support following Google best practices
|
|
801
|
+
- **Zero configuration**: JSON-LD automatically generated during site build
|
|
802
|
+
- **Well documented**: Extensive README section with examples and validation tools
|
|
803
|
+
- **Fully tested**: 60+ new tests covering all JSON-LD schema types
|
|
804
|
+
|
|
805
|
+
### v0.7.0
|
|
610
806
|
|
|
611
807
|
- **Media uploads**: Added MP4 video support alongside image uploads
|
|
612
808
|
- **Incremental uploads**: Year-based filtering with `--min-year` option
|