@san-siva/blogkit-md 0.3.20 → 0.3.22
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/index.d.mts +2 -1
- package/dist/index.js +8 -4
- package/package.json +3 -3
- package/src/components/BlogPost.tsx +9 -4
package/dist/index.d.mts
CHANGED
|
@@ -5,8 +5,9 @@ import React from 'react';
|
|
|
5
5
|
type BlogPostProperties = {
|
|
6
6
|
filePath: string;
|
|
7
7
|
jsonLd?: WithContext<Thing>;
|
|
8
|
+
increasedWidthMode?: boolean;
|
|
8
9
|
};
|
|
9
|
-
declare const BlogPost: ({ filePath, jsonLd }: BlogPostProperties) => Promise<react_jsx_runtime.JSX.Element>;
|
|
10
|
+
declare const BlogPost: ({ filePath, jsonLd, increasedWidthMode, }: BlogPostProperties) => Promise<react_jsx_runtime.JSX.Element>;
|
|
10
11
|
|
|
11
12
|
type RenderedMarkdown = {
|
|
12
13
|
sections: React.ReactNode[];
|
package/dist/index.js
CHANGED
|
@@ -373,20 +373,24 @@ var MarkdownSections = ({
|
|
|
373
373
|
|
|
374
374
|
// src/components/BlogPost.tsx
|
|
375
375
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
376
|
-
var BlogPost = async ({
|
|
376
|
+
var BlogPost = async ({
|
|
377
|
+
filePath,
|
|
378
|
+
jsonLd,
|
|
379
|
+
increasedWidthMode
|
|
380
|
+
}) => {
|
|
377
381
|
const absolutePath = path.isAbsolute(filePath) ? filePath : path.join(process.cwd(), filePath);
|
|
378
382
|
let content;
|
|
379
383
|
try {
|
|
380
384
|
content = await readFile(absolutePath, "utf8");
|
|
381
385
|
} catch (e) {
|
|
382
|
-
return /* @__PURE__ */ jsx3(Blog, { children: /* @__PURE__ */ jsx3(Callout2, { type: "warning", children: /* @__PURE__ */ jsxs2("p", { children: [
|
|
386
|
+
return /* @__PURE__ */ jsx3(Blog, { increasedWidthMode, children: /* @__PURE__ */ jsx3(Callout2, { type: "warning", children: /* @__PURE__ */ jsxs2("p", { children: [
|
|
383
387
|
'Could not read file: "',
|
|
384
388
|
filePath,
|
|
385
389
|
'". Make sure the path is correct and the file exists.'
|
|
386
390
|
] }) }) });
|
|
387
391
|
}
|
|
388
392
|
if (!content.trim()) {
|
|
389
|
-
return /* @__PURE__ */ jsx3(Blog, { children: /* @__PURE__ */ jsxs2(Callout2, { type: "warning", children: [
|
|
393
|
+
return /* @__PURE__ */ jsx3(Blog, { increasedWidthMode, children: /* @__PURE__ */ jsxs2(Callout2, { type: "warning", children: [
|
|
390
394
|
'File "',
|
|
391
395
|
filePath,
|
|
392
396
|
'" is empty.'
|
|
@@ -394,7 +398,7 @@ var BlogPost = async ({ filePath, jsonLd }) => {
|
|
|
394
398
|
}
|
|
395
399
|
const { ast, title, description: desc } = parseMarkdown(content);
|
|
396
400
|
const rendered = renderMarkdownAst(ast);
|
|
397
|
-
return /* @__PURE__ */ jsxs2(Blog, { jsonLd, children: [
|
|
401
|
+
return /* @__PURE__ */ jsxs2(Blog, { jsonLd, increasedWidthMode, children: [
|
|
398
402
|
title && /* @__PURE__ */ jsx3(BlogHeader, { title: [title], desc: desc ? [desc] : [] }),
|
|
399
403
|
/* @__PURE__ */ jsx3(MarkdownSections, { rendered })
|
|
400
404
|
] });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@san-siva/blogkit-md",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.22",
|
|
4
4
|
"description": "Converts markdown files into JSX blog posts for Blogkit",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"fix": "eslint . --config eslint.config.ts --fix"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@san-siva/blogkit": "^1.1.
|
|
25
|
-
"@san-siva/stylekit": "^1.0.
|
|
24
|
+
"@san-siva/blogkit": "^1.1.43",
|
|
25
|
+
"@san-siva/stylekit": "^1.0.14",
|
|
26
26
|
"next": "^16.0.10",
|
|
27
27
|
"react": "^19.0.0",
|
|
28
28
|
"react-dom": "^19.0.0",
|
|
@@ -9,9 +9,14 @@ import { MarkdownSections, renderMarkdownAst } from '../utils/renderMarkdown';
|
|
|
9
9
|
type BlogPostProperties = {
|
|
10
10
|
filePath: string;
|
|
11
11
|
jsonLd?: WithContext<Thing>;
|
|
12
|
+
increasedWidthMode?: boolean;
|
|
12
13
|
};
|
|
13
14
|
|
|
14
|
-
const BlogPost = async ({
|
|
15
|
+
const BlogPost = async ({
|
|
16
|
+
filePath,
|
|
17
|
+
jsonLd,
|
|
18
|
+
increasedWidthMode,
|
|
19
|
+
}: BlogPostProperties) => {
|
|
15
20
|
const absolutePath = path.isAbsolute(filePath)
|
|
16
21
|
? filePath
|
|
17
22
|
: path.join(process.cwd(), filePath);
|
|
@@ -21,7 +26,7 @@ const BlogPost = async ({ filePath, jsonLd }: BlogPostProperties) => {
|
|
|
21
26
|
content = await readFile(absolutePath, 'utf8');
|
|
22
27
|
} catch {
|
|
23
28
|
return (
|
|
24
|
-
<Blog>
|
|
29
|
+
<Blog increasedWidthMode={increasedWidthMode}>
|
|
25
30
|
<Callout type="warning">
|
|
26
31
|
<p>
|
|
27
32
|
Could not read file: "{filePath}". Make sure the path is
|
|
@@ -34,7 +39,7 @@ const BlogPost = async ({ filePath, jsonLd }: BlogPostProperties) => {
|
|
|
34
39
|
|
|
35
40
|
if (!content.trim()) {
|
|
36
41
|
return (
|
|
37
|
-
<Blog>
|
|
42
|
+
<Blog increasedWidthMode={increasedWidthMode}>
|
|
38
43
|
<Callout type="warning">File "{filePath}" is empty.</Callout>
|
|
39
44
|
</Blog>
|
|
40
45
|
);
|
|
@@ -45,7 +50,7 @@ const BlogPost = async ({ filePath, jsonLd }: BlogPostProperties) => {
|
|
|
45
50
|
const rendered = renderMarkdownAst(ast);
|
|
46
51
|
|
|
47
52
|
return (
|
|
48
|
-
<Blog jsonLd={jsonLd}>
|
|
53
|
+
<Blog jsonLd={jsonLd} increasedWidthMode={increasedWidthMode}>
|
|
49
54
|
{title && <BlogHeader title={[title]} desc={desc ? [desc] : []} />}
|
|
50
55
|
<MarkdownSections rendered={rendered} />
|
|
51
56
|
</Blog>
|