@haroonwaves/blog-kit-core 0.0.6 → 0.0.7
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.cjs +5 -5
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +5 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -43,8 +43,8 @@ var import_path = __toESM(require("path"), 1);
|
|
|
43
43
|
var import_gray_matter = __toESM(require("gray-matter"), 1);
|
|
44
44
|
var import_reading_time = __toESM(require("reading-time"), 1);
|
|
45
45
|
function extractBlogMeta(content, slug) {
|
|
46
|
-
const { data, content:
|
|
47
|
-
const readingTimeText = (0, import_reading_time.default)(
|
|
46
|
+
const { data, content: BlogContent } = (0, import_gray_matter.default)(content);
|
|
47
|
+
const readingTimeText = (0, import_reading_time.default)(BlogContent).text;
|
|
48
48
|
return {
|
|
49
49
|
slug,
|
|
50
50
|
...data,
|
|
@@ -52,15 +52,15 @@ function extractBlogMeta(content, slug) {
|
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
function extractBlog(content, slug) {
|
|
55
|
-
const { data, content:
|
|
56
|
-
const readingTimeText = (0, import_reading_time.default)(
|
|
55
|
+
const { data, content: BlogContent } = (0, import_gray_matter.default)(content);
|
|
56
|
+
const readingTimeText = (0, import_reading_time.default)(BlogContent).text;
|
|
57
57
|
return {
|
|
58
58
|
metadata: {
|
|
59
59
|
...data,
|
|
60
60
|
slug,
|
|
61
61
|
readingTime: readingTimeText
|
|
62
62
|
},
|
|
63
|
-
content:
|
|
63
|
+
content: BlogContent
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
function getAllBlogsMeta(config) {
|
package/dist/index.d.cts
CHANGED
|
@@ -16,21 +16,21 @@ interface BlogConfig {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* Client-side compatible: Extract blog metadata from raw
|
|
19
|
+
* Client-side compatible: Extract blog metadata from raw blog content.
|
|
20
20
|
* This function works in browser environments (pure React) where you have
|
|
21
|
-
* the
|
|
21
|
+
* the blog content as a string (e.g., fetched from an API or imported).
|
|
22
22
|
*
|
|
23
|
-
* @param content - Raw
|
|
23
|
+
* @param content - Raw blog content string
|
|
24
24
|
* @param slug - Blog post slug/identifier
|
|
25
25
|
* @returns Parsed blog metadata
|
|
26
26
|
*/
|
|
27
27
|
declare function extractBlogMeta(content: string, slug: string): BlogMeta;
|
|
28
28
|
/**
|
|
29
|
-
* Client-side compatible: Extract blog data from raw
|
|
29
|
+
* Client-side compatible: Extract blog data from raw blog content.
|
|
30
30
|
* This function works in browser environments (pure React) where you have
|
|
31
|
-
* the
|
|
31
|
+
* the blog content as a string (e.g., fetched from an API or imported).
|
|
32
32
|
*
|
|
33
|
-
* @param content - Raw
|
|
33
|
+
* @param content - Raw Blog content string
|
|
34
34
|
* @param slug - Blog post slug/identifier
|
|
35
35
|
* @returns Parsed blog data with metadata and content
|
|
36
36
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -16,21 +16,21 @@ interface BlogConfig {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* Client-side compatible: Extract blog metadata from raw
|
|
19
|
+
* Client-side compatible: Extract blog metadata from raw blog content.
|
|
20
20
|
* This function works in browser environments (pure React) where you have
|
|
21
|
-
* the
|
|
21
|
+
* the blog content as a string (e.g., fetched from an API or imported).
|
|
22
22
|
*
|
|
23
|
-
* @param content - Raw
|
|
23
|
+
* @param content - Raw blog content string
|
|
24
24
|
* @param slug - Blog post slug/identifier
|
|
25
25
|
* @returns Parsed blog metadata
|
|
26
26
|
*/
|
|
27
27
|
declare function extractBlogMeta(content: string, slug: string): BlogMeta;
|
|
28
28
|
/**
|
|
29
|
-
* Client-side compatible: Extract blog data from raw
|
|
29
|
+
* Client-side compatible: Extract blog data from raw blog content.
|
|
30
30
|
* This function works in browser environments (pure React) where you have
|
|
31
|
-
* the
|
|
31
|
+
* the blog content as a string (e.g., fetched from an API or imported).
|
|
32
32
|
*
|
|
33
|
-
* @param content - Raw
|
|
33
|
+
* @param content - Raw Blog content string
|
|
34
34
|
* @param slug - Blog post slug/identifier
|
|
35
35
|
* @returns Parsed blog data with metadata and content
|
|
36
36
|
*/
|
package/dist/index.js
CHANGED
|
@@ -4,8 +4,8 @@ import path from "path";
|
|
|
4
4
|
import matter from "gray-matter";
|
|
5
5
|
import readingTime from "reading-time";
|
|
6
6
|
function extractBlogMeta(content, slug) {
|
|
7
|
-
const { data, content:
|
|
8
|
-
const readingTimeText = readingTime(
|
|
7
|
+
const { data, content: BlogContent } = matter(content);
|
|
8
|
+
const readingTimeText = readingTime(BlogContent).text;
|
|
9
9
|
return {
|
|
10
10
|
slug,
|
|
11
11
|
...data,
|
|
@@ -13,15 +13,15 @@ function extractBlogMeta(content, slug) {
|
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
function extractBlog(content, slug) {
|
|
16
|
-
const { data, content:
|
|
17
|
-
const readingTimeText = readingTime(
|
|
16
|
+
const { data, content: BlogContent } = matter(content);
|
|
17
|
+
const readingTimeText = readingTime(BlogContent).text;
|
|
18
18
|
return {
|
|
19
19
|
metadata: {
|
|
20
20
|
...data,
|
|
21
21
|
slug,
|
|
22
22
|
readingTime: readingTimeText
|
|
23
23
|
},
|
|
24
|
-
content:
|
|
24
|
+
content: BlogContent
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
function getAllBlogsMeta(config) {
|