vending-mocha 0.1.8 → 0.2.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vending-mocha",
3
3
  "description": "A personal blogging framework for developers.",
4
- "version": "0.1.8",
4
+ "version": "0.2.1",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "bin": {
@@ -27,7 +27,8 @@ function generatePostsData() {
27
27
  title: data.title || 'Untitled',
28
28
  date: data.date || 'Unknown Date',
29
29
  summary: data.summary || '',
30
- weight: data.weight || 0
30
+ weight: data.weight || 0,
31
+ image: data.image || null
31
32
  };
32
33
  });
33
34
 
@@ -54,10 +54,17 @@ export default function BlogPost() {
54
54
  }
55
55
  };
56
56
 
57
+ const ogImageUrl = postMeta.image
58
+ ? (postMeta.image.startsWith('http') ? postMeta.image : `${siteConfig.url.replace(/\/$/, '')}${postMeta.image.startsWith('/') ? '' : '/'}${postMeta.image}`)
59
+ : undefined;
60
+
57
61
  return (
58
62
  <div className="blog-container">
59
63
  <SiteHeader />
60
64
  <Helmet>
65
+ <title>{`${postMeta.title} - ${siteConfig.title}`}</title>
66
+ <meta name="description" content={postMeta.summary || siteConfig.description} />
67
+ {ogImageUrl && <meta property="og:image" content={ogImageUrl} />}
61
68
  <script type='application/ld+json'>
62
69
  {JSON.stringify(jsonLd)}
63
70
  </script>
@@ -68,6 +75,11 @@ export default function BlogPost() {
68
75
  <span>{formatDate(postMeta.date)}</span>
69
76
  </div>
70
77
  </header>
78
+ {postMeta.image && (
79
+ <div className="post-image" style={{ marginBottom: '2rem' }}>
80
+ <img src={postMeta.image} alt={postMeta.title} style={{ maxWidth: '100%', borderRadius: '8px' }} />
81
+ </div>
82
+ )}
71
83
  <div className="markdown-content">
72
84
  <Markdown
73
85
  remarkPlugins={[remarkGfm]}
package/src/posts.json CHANGED
@@ -4,27 +4,31 @@
4
4
  "title": "Introducing the Life in Weeks Feature ⏳",
5
5
  "date": "2026-02-22",
6
6
  "summary": "A new feature to visualize your life in weeks",
7
- "weight": 0
7
+ "weight": 0,
8
+ "image": null
8
9
  },
9
10
  {
10
11
  "slug": "hello-world",
11
12
  "title": "Welcome to Vending Mocha ☕",
12
13
  "date": "2026-02-17 04:00:00",
13
14
  "summary": "Welcome to your new blogging framework! This is a sample post to get you started.",
14
- "weight": 0
15
+ "weight": 0,
16
+ "image": null
15
17
  },
16
18
  {
17
19
  "slug": "markdown-features",
18
20
  "title": "Markdown Features Demo 📝",
19
21
  "date": "2026-02-17 02:00:00",
20
22
  "summary": "A demonstration of the Markdown features supported by Vending Mocha, including code blocks, lists, and formatting.",
21
- "weight": 0
23
+ "weight": 0,
24
+ "image": null
22
25
  },
23
26
  {
24
27
  "slug": "deploy-to-github-pages",
25
28
  "title": "Deploying to GitHub Pages 🚀",
26
29
  "date": "2026-02-17 01:00:00",
27
30
  "summary": "A step-by-step guide to deploying your Vending Mocha blog to GitHub Pages using GitHub Actions.",
28
- "weight": 0
31
+ "weight": 0,
32
+ "image": null
29
33
  }
30
34
  ]