bunki 0.13.2 → 0.14.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/cli.js CHANGED
@@ -33105,33 +33105,39 @@ async function parseMarkdownFile(filePath) {
33105
33105
  excerpt: data.excerpt || extractExcerpt(content),
33106
33106
  html: sanitizedHtml,
33107
33107
  ...data.location && {
33108
- location: {
33109
- name: data.location.name,
33110
- address: data.location.address,
33111
- lat: data.location.lat,
33112
- lng: data.location.lng
33113
- }
33108
+ location: (() => {
33109
+ const loc = Array.isArray(data.location) ? data.location[0] : data.location;
33110
+ return {
33111
+ name: loc.name,
33112
+ address: loc.address,
33113
+ lat: loc.lat || loc.latitude,
33114
+ lng: loc.lng || loc.longitude
33115
+ };
33116
+ })()
33114
33117
  },
33115
33118
  ...data.category && { category: data.category },
33116
33119
  ...data.business && {
33117
- business: {
33118
- type: data.business.type,
33119
- name: data.business.name,
33120
- address: data.business.address,
33121
- lat: data.business.lat,
33122
- lng: data.business.lng,
33123
- ...data.business.cuisine && { cuisine: data.business.cuisine },
33124
- ...data.business.priceRange && {
33125
- priceRange: data.business.priceRange
33126
- },
33127
- ...data.business.telephone && {
33128
- telephone: data.business.telephone
33129
- },
33130
- ...data.business.url && { url: data.business.url },
33131
- ...data.business.openingHours && {
33132
- openingHours: data.business.openingHours
33133
- }
33134
- }
33120
+ business: (() => {
33121
+ const biz = Array.isArray(data.business) ? data.business[0] : data.business;
33122
+ return {
33123
+ type: biz.type,
33124
+ name: biz.name,
33125
+ address: biz.address,
33126
+ lat: biz.lat || biz.latitude,
33127
+ lng: biz.lng || biz.longitude,
33128
+ ...biz.cuisine && { cuisine: biz.cuisine },
33129
+ ...biz.priceRange && {
33130
+ priceRange: biz.priceRange
33131
+ },
33132
+ ...biz.telephone && {
33133
+ telephone: biz.telephone
33134
+ },
33135
+ ...biz.url && { url: biz.url },
33136
+ ...biz.openingHours && {
33137
+ openingHours: biz.openingHours
33138
+ }
33139
+ };
33140
+ })()
33135
33141
  }
33136
33142
  };
33137
33143
  return { post, error: null };
@@ -33495,6 +33501,10 @@ class SiteGenerator {
33495
33501
  const tags = {};
33496
33502
  posts.forEach((post) => {
33497
33503
  post.tagSlugs = {};
33504
+ const imageUrl = extractFirstImageUrl(post.html, this.options.config.baseUrl);
33505
+ if (imageUrl) {
33506
+ post.image = imageUrl;
33507
+ }
33498
33508
  post.tags.forEach((tagName) => {
33499
33509
  const tagSlug = import_slugify.default(tagName, { lower: true, strict: true });
33500
33510
  post.tagSlugs[tagName] = tagSlug;
package/dist/index.js CHANGED
@@ -30723,33 +30723,39 @@ async function parseMarkdownFile(filePath) {
30723
30723
  excerpt: data.excerpt || extractExcerpt(content),
30724
30724
  html: sanitizedHtml,
30725
30725
  ...data.location && {
30726
- location: {
30727
- name: data.location.name,
30728
- address: data.location.address,
30729
- lat: data.location.lat,
30730
- lng: data.location.lng
30731
- }
30726
+ location: (() => {
30727
+ const loc = Array.isArray(data.location) ? data.location[0] : data.location;
30728
+ return {
30729
+ name: loc.name,
30730
+ address: loc.address,
30731
+ lat: loc.lat || loc.latitude,
30732
+ lng: loc.lng || loc.longitude
30733
+ };
30734
+ })()
30732
30735
  },
30733
30736
  ...data.category && { category: data.category },
30734
30737
  ...data.business && {
30735
- business: {
30736
- type: data.business.type,
30737
- name: data.business.name,
30738
- address: data.business.address,
30739
- lat: data.business.lat,
30740
- lng: data.business.lng,
30741
- ...data.business.cuisine && { cuisine: data.business.cuisine },
30742
- ...data.business.priceRange && {
30743
- priceRange: data.business.priceRange
30744
- },
30745
- ...data.business.telephone && {
30746
- telephone: data.business.telephone
30747
- },
30748
- ...data.business.url && { url: data.business.url },
30749
- ...data.business.openingHours && {
30750
- openingHours: data.business.openingHours
30751
- }
30752
- }
30738
+ business: (() => {
30739
+ const biz = Array.isArray(data.business) ? data.business[0] : data.business;
30740
+ return {
30741
+ type: biz.type,
30742
+ name: biz.name,
30743
+ address: biz.address,
30744
+ lat: biz.lat || biz.latitude,
30745
+ lng: biz.lng || biz.longitude,
30746
+ ...biz.cuisine && { cuisine: biz.cuisine },
30747
+ ...biz.priceRange && {
30748
+ priceRange: biz.priceRange
30749
+ },
30750
+ ...biz.telephone && {
30751
+ telephone: biz.telephone
30752
+ },
30753
+ ...biz.url && { url: biz.url },
30754
+ ...biz.openingHours && {
30755
+ openingHours: biz.openingHours
30756
+ }
30757
+ };
30758
+ })()
30753
30759
  }
30754
30760
  };
30755
30761
  return { post, error: null };
@@ -31442,6 +31448,10 @@ class SiteGenerator {
31442
31448
  const tags = {};
31443
31449
  posts.forEach((post) => {
31444
31450
  post.tagSlugs = {};
31451
+ const imageUrl = extractFirstImageUrl(post.html, this.options.config.baseUrl);
31452
+ if (imageUrl) {
31453
+ post.image = imageUrl;
31454
+ }
31445
31455
  post.tags.forEach((tagName) => {
31446
31456
  const tagSlug = import_slugify.default(tagName, { lower: true, strict: true });
31447
31457
  post.tagSlugs[tagName] = tagSlug;
package/dist/types.d.ts CHANGED
@@ -62,6 +62,8 @@ export interface Post {
62
62
  category?: string;
63
63
  /** Optional business schema data for LocalBusiness structured data */
64
64
  business?: Business;
65
+ /** Optional image URL (first image from post content, used for thumbnails and social sharing) */
66
+ image?: string;
65
67
  }
66
68
  /**
67
69
  * Configuration for CSS processing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunki",
3
- "version": "0.13.2",
3
+ "version": "0.14.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",