vending-mocha 0.2.0 → 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 +2 -2
- package/scripts/generate-posts-data.js +2 -1
- package/src/pages/BlogPost.tsx +10 -0
- package/src/posts.json +8 -4
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.2.
|
|
4
|
+
"version": "0.2.1",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
@@ -58,4 +58,4 @@
|
|
|
58
58
|
"typescript-eslint": "^8.48.0",
|
|
59
59
|
"vite": "^7.3.1"
|
|
60
60
|
}
|
|
61
|
-
}
|
|
61
|
+
}
|
package/src/pages/BlogPost.tsx
CHANGED
|
@@ -54,12 +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>
|
|
61
65
|
<title>{`${postMeta.title} - ${siteConfig.title}`}</title>
|
|
62
66
|
<meta name="description" content={postMeta.summary || siteConfig.description} />
|
|
67
|
+
{ogImageUrl && <meta property="og:image" content={ogImageUrl} />}
|
|
63
68
|
<script type='application/ld+json'>
|
|
64
69
|
{JSON.stringify(jsonLd)}
|
|
65
70
|
</script>
|
|
@@ -70,6 +75,11 @@ export default function BlogPost() {
|
|
|
70
75
|
<span>{formatDate(postMeta.date)}</span>
|
|
71
76
|
</div>
|
|
72
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
|
+
)}
|
|
73
83
|
<div className="markdown-content">
|
|
74
84
|
<Markdown
|
|
75
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
|
]
|