@opinly/next 0.1.21 → 0.1.23
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/components/author-page/_helpers/json-ld.cjs +42 -0
- package/dist/components/author-page/_helpers/json-ld.cjs.map +1 -1
- package/dist/components/author-page/_helpers/json-ld.d.cts +7 -1
- package/dist/components/author-page/_helpers/json-ld.d.ts +7 -1
- package/dist/components/author-page/_helpers/json-ld.js +19 -0
- package/dist/components/author-page/_helpers/json-ld.js.map +1 -1
- package/dist/components/author-page/index.cjs +9 -15
- package/dist/components/author-page/index.cjs.map +1 -1
- package/dist/components/author-page/index.js +9 -15
- package/dist/components/author-page/index.js.map +1 -1
- package/dist/components/authors-page/_helpers/json-ld.cjs +53 -0
- package/dist/components/authors-page/_helpers/json-ld.cjs.map +1 -0
- package/dist/components/authors-page/_helpers/json-ld.d.cts +8 -0
- package/dist/components/authors-page/_helpers/json-ld.d.ts +8 -0
- package/dist/components/authors-page/_helpers/json-ld.js +29 -0
- package/dist/components/authors-page/_helpers/json-ld.js.map +1 -0
- package/dist/components/authors-page/index.cjs +61 -45
- package/dist/components/authors-page/index.cjs.map +1 -1
- package/dist/components/authors-page/index.js +62 -46
- package/dist/components/authors-page/index.js.map +1 -1
- package/dist/components/blog-post/index.cjs +15 -34
- package/dist/components/blog-post/index.cjs.map +1 -1
- package/dist/components/blog-post/index.js +16 -39
- package/dist/components/blog-post/index.js.map +1 -1
- package/dist/components/folder-page/_helpers/json-ld.cjs +43 -0
- package/dist/components/folder-page/_helpers/json-ld.cjs.map +1 -0
- package/dist/components/folder-page/_helpers/json-ld.d.cts +8 -0
- package/dist/components/folder-page/_helpers/json-ld.d.ts +8 -0
- package/dist/components/folder-page/_helpers/json-ld.js +19 -0
- package/dist/components/folder-page/_helpers/json-ld.js.map +1 -0
- package/dist/components/folder-page/index.cjs +5 -17
- package/dist/components/folder-page/index.cjs.map +1 -1
- package/dist/components/folder-page/index.js +5 -17
- package/dist/components/folder-page/index.js.map +1 -1
- package/dist/components/home-page/_helpers/json-ld.cjs +43 -0
- package/dist/components/home-page/_helpers/json-ld.cjs.map +1 -0
- package/dist/components/home-page/_helpers/json-ld.d.cts +3 -0
- package/dist/components/home-page/_helpers/json-ld.d.ts +3 -0
- package/dist/components/home-page/_helpers/json-ld.js +19 -0
- package/dist/components/home-page/_helpers/json-ld.js.map +1 -0
- package/dist/components/home-page/index.cjs +9 -4
- package/dist/components/home-page/index.cjs.map +1 -1
- package/dist/components/home-page/index.js +10 -5
- package/dist/components/home-page/index.js.map +1 -1
- package/dist/components/json-ld.cjs +92 -0
- package/dist/components/json-ld.cjs.map +1 -0
- package/dist/components/json-ld.d.cts +13 -0
- package/dist/components/json-ld.d.ts +13 -0
- package/dist/components/json-ld.js +57 -0
- package/dist/components/json-ld.js.map +1 -0
- package/dist/utils/json-ld.cjs +2 -0
- package/dist/utils/json-ld.cjs.map +1 -0
- package/dist/utils/json-ld.d.cts +2 -0
- package/dist/utils/json-ld.d.ts +2 -0
- package/dist/utils/json-ld.js +1 -0
- package/dist/utils/json-ld.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var json_ld_exports = {};
|
|
20
|
+
__export(json_ld_exports, {
|
|
21
|
+
blogJSONLD: () => blogJSONLD
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(json_ld_exports);
|
|
24
|
+
var import_sdk_config = require("../../../utils/sdk-config");
|
|
25
|
+
const blogJSONLD = () => {
|
|
26
|
+
const jsonLD = {
|
|
27
|
+
"@context": "https://schema.org",
|
|
28
|
+
"@type": "Blog",
|
|
29
|
+
name: import_sdk_config.opinlyConfig.siteName,
|
|
30
|
+
description: `Latest news and insights from ${import_sdk_config.opinlyConfig.siteName}`,
|
|
31
|
+
url: import_sdk_config.opinlyConfig.blogUrl,
|
|
32
|
+
publisher: {
|
|
33
|
+
"@type": "Organization",
|
|
34
|
+
name: import_sdk_config.opinlyConfig.siteName
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
return JSON.stringify(jsonLD);
|
|
38
|
+
};
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
blogJSONLD
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=json-ld.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/home-page/_helpers/json-ld.ts"],"sourcesContent":["import { Blog, WithContext } from \"schema-dts\";\nimport { opinlyConfig } from \"../../../utils/sdk-config\";\n\nexport const blogJSONLD = () => {\n const jsonLD: WithContext<Blog> = {\n \"@context\": \"https://schema.org\",\n \"@type\": \"Blog\",\n name: opinlyConfig.siteName,\n description: `Latest news and insights from ${opinlyConfig.siteName}`,\n url: opinlyConfig.blogUrl,\n publisher: {\n \"@type\": \"Organization\",\n name: opinlyConfig.siteName,\n },\n };\n\n return JSON.stringify(jsonLD);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAA6B;AAEtB,MAAM,aAAa,MAAM;AAC9B,QAAM,SAA4B;AAAA,IAChC,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,MAAM,+BAAa;AAAA,IACnB,aAAa,iCAAiC,+BAAa,QAAQ;AAAA,IACnE,KAAK,+BAAa;AAAA,IAClB,WAAW;AAAA,MACT,SAAS;AAAA,MACT,MAAM,+BAAa;AAAA,IACrB;AAAA,EACF;AAEA,SAAO,KAAK,UAAU,MAAM;AAC9B;","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { opinlyConfig } from "../../../utils/sdk-config";
|
|
2
|
+
const blogJSONLD = () => {
|
|
3
|
+
const jsonLD = {
|
|
4
|
+
"@context": "https://schema.org",
|
|
5
|
+
"@type": "Blog",
|
|
6
|
+
name: opinlyConfig.siteName,
|
|
7
|
+
description: `Latest news and insights from ${opinlyConfig.siteName}`,
|
|
8
|
+
url: opinlyConfig.blogUrl,
|
|
9
|
+
publisher: {
|
|
10
|
+
"@type": "Organization",
|
|
11
|
+
name: opinlyConfig.siteName
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
return JSON.stringify(jsonLD);
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
blogJSONLD
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=json-ld.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/home-page/_helpers/json-ld.ts"],"sourcesContent":["import { Blog, WithContext } from \"schema-dts\";\nimport { opinlyConfig } from \"../../../utils/sdk-config\";\n\nexport const blogJSONLD = () => {\n const jsonLD: WithContext<Blog> = {\n \"@context\": \"https://schema.org\",\n \"@type\": \"Blog\",\n name: opinlyConfig.siteName,\n description: `Latest news and insights from ${opinlyConfig.siteName}`,\n url: opinlyConfig.blogUrl,\n publisher: {\n \"@type\": \"Organization\",\n name: opinlyConfig.siteName,\n },\n };\n\n return JSON.stringify(jsonLD);\n};\n"],"mappings":"AACA,SAAS,oBAAoB;AAEtB,MAAM,aAAa,MAAM;AAC9B,QAAM,SAA4B;AAAA,IAChC,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,MAAM,aAAa;AAAA,IACnB,aAAa,iCAAiC,aAAa,QAAQ;AAAA,IACnE,KAAK,aAAa;AAAA,IAClB,WAAW;AAAA,MACT,SAAS;AAAA,MACT,MAAM,aAAa;AAAA,IACrB;AAAA,EACF;AAEA,SAAO,KAAK,UAAU,MAAM;AAC9B;","names":[]}
|
|
@@ -25,13 +25,18 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
25
25
|
var import_top_posts = require("./top-posts");
|
|
26
26
|
var import_folders = require("./folders");
|
|
27
27
|
var import_pagination = require("./pagination");
|
|
28
|
+
var import_json_ld = require("./_helpers/json-ld");
|
|
29
|
+
var import_json_ld2 = require("../json-ld");
|
|
28
30
|
const HomePage = ({
|
|
29
31
|
data
|
|
30
32
|
}) => {
|
|
31
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
32
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
33
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
34
|
-
|
|
33
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
34
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_json_ld2.OpinlyJSONLD, { content: (0, import_json_ld.blogJSONLD)() }),
|
|
35
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-7xl mx-auto px-4 py-10", children: [
|
|
36
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_top_posts.TopPosts, { posts: data.posts }),
|
|
37
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_pagination.HomePagePagination, { count: data.count, page: data.page }),
|
|
38
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_folders.HomePageFolders, { folders: data.folders })
|
|
39
|
+
] })
|
|
35
40
|
] });
|
|
36
41
|
};
|
|
37
42
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/home-page/index.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport { TopPosts } from \"./top-posts\";\nimport { HomePageFolders } from \"./folders\";\nimport { HomePagePagination } from \"./pagination\";\n\nexport const HomePage = ({\n data,\n}: {\n data: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"home\" }\n >[\"data\"];\n}) => {\n return (\n <div className=\"max-w-7xl mx-auto px-4 py-10\">\n
|
|
1
|
+
{"version":3,"sources":["../../../src/components/home-page/index.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport { TopPosts } from \"./top-posts\";\nimport { HomePageFolders } from \"./folders\";\nimport { HomePagePagination } from \"./pagination\";\nimport { blogJSONLD } from \"./_helpers/json-ld\";\nimport { OpinlyBreadCrumbJsonLd, OpinlyJSONLD } from \"../json-ld\";\n\nexport const HomePage = ({\n data,\n}: {\n data: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"home\" }\n >[\"data\"];\n}) => {\n return (\n <>\n <OpinlyJSONLD content={blogJSONLD()} />\n\n <div className=\"max-w-7xl mx-auto px-4 py-10\">\n <TopPosts posts={data.posts} />\n <HomePagePagination count={data.count} page={data.page} />\n <HomePageFolders folders={data.folders} />\n </div>\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBI;AAfJ,uBAAyB;AACzB,qBAAgC;AAChC,wBAAmC;AACnC,qBAA2B;AAC3B,IAAAA,kBAAqD;AAE9C,MAAM,WAAW,CAAC;AAAA,EACvB;AACF,MAKM;AACJ,SACE,4EACE;AAAA,gDAAC,gCAAa,aAAS,2BAAW,GAAG;AAAA,IAErC,6CAAC,SAAI,WAAU,gCACb;AAAA,kDAAC,6BAAS,OAAO,KAAK,OAAO;AAAA,MAC7B,4CAAC,wCAAmB,OAAO,KAAK,OAAO,MAAM,KAAK,MAAM;AAAA,MACxD,4CAAC,kCAAgB,SAAS,KAAK,SAAS;AAAA,OAC1C;AAAA,KACF;AAEJ;","names":["import_json_ld"]}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { TopPosts } from "./top-posts";
|
|
3
3
|
import { HomePageFolders } from "./folders";
|
|
4
4
|
import { HomePagePagination } from "./pagination";
|
|
5
|
+
import { blogJSONLD } from "./_helpers/json-ld";
|
|
6
|
+
import { OpinlyJSONLD } from "../json-ld";
|
|
5
7
|
const HomePage = ({
|
|
6
8
|
data
|
|
7
9
|
}) => {
|
|
8
|
-
return /* @__PURE__ */ jsxs(
|
|
9
|
-
/* @__PURE__ */ jsx(
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
|
|
10
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11
|
+
/* @__PURE__ */ jsx(OpinlyJSONLD, { content: blogJSONLD() }),
|
|
12
|
+
/* @__PURE__ */ jsxs("div", { className: "max-w-7xl mx-auto px-4 py-10", children: [
|
|
13
|
+
/* @__PURE__ */ jsx(TopPosts, { posts: data.posts }),
|
|
14
|
+
/* @__PURE__ */ jsx(HomePagePagination, { count: data.count, page: data.page }),
|
|
15
|
+
/* @__PURE__ */ jsx(HomePageFolders, { folders: data.folders })
|
|
16
|
+
] })
|
|
12
17
|
] });
|
|
13
18
|
};
|
|
14
19
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/home-page/index.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport { TopPosts } from \"./top-posts\";\nimport { HomePageFolders } from \"./folders\";\nimport { HomePagePagination } from \"./pagination\";\n\nexport const HomePage = ({\n data,\n}: {\n data: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"home\" }\n >[\"data\"];\n}) => {\n return (\n <div className=\"max-w-7xl mx-auto px-4 py-10\">\n
|
|
1
|
+
{"version":3,"sources":["../../../src/components/home-page/index.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport { TopPosts } from \"./top-posts\";\nimport { HomePageFolders } from \"./folders\";\nimport { HomePagePagination } from \"./pagination\";\nimport { blogJSONLD } from \"./_helpers/json-ld\";\nimport { OpinlyBreadCrumbJsonLd, OpinlyJSONLD } from \"../json-ld\";\n\nexport const HomePage = ({\n data,\n}: {\n data: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"home\" }\n >[\"data\"];\n}) => {\n return (\n <>\n <OpinlyJSONLD content={blogJSONLD()} />\n\n <div className=\"max-w-7xl mx-auto px-4 py-10\">\n <TopPosts posts={data.posts} />\n <HomePagePagination count={data.count} page={data.page} />\n <HomePageFolders folders={data.folders} />\n </div>\n </>\n );\n};\n"],"mappings":"AAgBI,mBACE,KAEA,YAHF;AAfJ,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,kBAAkB;AAC3B,SAAiC,oBAAoB;AAE9C,MAAM,WAAW,CAAC;AAAA,EACvB;AACF,MAKM;AACJ,SACE,iCACE;AAAA,wBAAC,gBAAa,SAAS,WAAW,GAAG;AAAA,IAErC,qBAAC,SAAI,WAAU,gCACb;AAAA,0BAAC,YAAS,OAAO,KAAK,OAAO;AAAA,MAC7B,oBAAC,sBAAmB,OAAO,KAAK,OAAO,MAAM,KAAK,MAAM;AAAA,MACxD,oBAAC,mBAAgB,SAAS,KAAK,SAAS;AAAA,OAC1C;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var json_ld_exports = {};
|
|
30
|
+
__export(json_ld_exports, {
|
|
31
|
+
OpinlyBreadCrumbJsonLd: () => OpinlyBreadCrumbJsonLd,
|
|
32
|
+
OpinlyJSONLD: () => OpinlyJSONLD
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(json_ld_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_script = __toESM(require("next/script"), 1);
|
|
37
|
+
var import_sdk_config = require("../utils/sdk-config");
|
|
38
|
+
const OpinlyJSONLD = ({ content }) => {
|
|
39
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
40
|
+
import_script.default,
|
|
41
|
+
{
|
|
42
|
+
strategy: "beforeInteractive",
|
|
43
|
+
type: "application/ld+json",
|
|
44
|
+
dangerouslySetInnerHTML: {
|
|
45
|
+
__html: content
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
const OpinlyBreadCrumbJsonLd = ({
|
|
51
|
+
items
|
|
52
|
+
}) => {
|
|
53
|
+
const itemListElement = [
|
|
54
|
+
{
|
|
55
|
+
"@type": "ListItem",
|
|
56
|
+
position: 1,
|
|
57
|
+
item: {
|
|
58
|
+
"@id": import_sdk_config.opinlyConfig.siteUrl,
|
|
59
|
+
name: import_sdk_config.opinlyConfig.siteName
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"@type": "ListItem",
|
|
64
|
+
position: 2,
|
|
65
|
+
item: {
|
|
66
|
+
"@id": import_sdk_config.opinlyConfig.blogUrl,
|
|
67
|
+
name: "Blog"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
...items.map((item, index) => ({
|
|
71
|
+
"@type": "ListItem",
|
|
72
|
+
position: index + 3,
|
|
73
|
+
item: {
|
|
74
|
+
"@id": `${import_sdk_config.opinlyConfig.blogUrl}/${item.slugNoPrefixSlash}`,
|
|
75
|
+
name: item.name
|
|
76
|
+
}
|
|
77
|
+
}))
|
|
78
|
+
];
|
|
79
|
+
const jsonLD = {
|
|
80
|
+
"@context": "https://schema.org",
|
|
81
|
+
"@type": "BreadcrumbList",
|
|
82
|
+
// @ts-expect-error - itemListElement is not typed correctly
|
|
83
|
+
itemListElement
|
|
84
|
+
};
|
|
85
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(OpinlyJSONLD, { content: JSON.stringify(jsonLD) });
|
|
86
|
+
};
|
|
87
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
88
|
+
0 && (module.exports = {
|
|
89
|
+
OpinlyBreadCrumbJsonLd,
|
|
90
|
+
OpinlyJSONLD
|
|
91
|
+
});
|
|
92
|
+
//# sourceMappingURL=json-ld.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/json-ld.tsx"],"sourcesContent":["import Script from \"next/script\";\nimport { opinlyConfig } from \"../utils/sdk-config\";\nimport { BreadcrumbList, WithContext } from \"schema-dts\";\n\nexport const OpinlyJSONLD = ({ content }: { content: string }) => {\n return (\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: content,\n }}\n />\n );\n};\n\nexport const OpinlyBreadCrumbJsonLd = ({\n items,\n}: {\n items: {\n slugNoPrefixSlash: string;\n name: string;\n }[];\n}) => {\n const itemListElement = [\n {\n \"@type\": \"ListItem\",\n position: 1,\n item: {\n \"@id\": opinlyConfig.siteUrl,\n name: opinlyConfig.siteName,\n },\n },\n {\n \"@type\": \"ListItem\",\n position: 2,\n item: {\n \"@id\": opinlyConfig.blogUrl,\n name: \"Blog\",\n },\n },\n ...items.map((item, index) => ({\n \"@type\": \"ListItem\",\n position: index + 3,\n item: {\n \"@id\": `${opinlyConfig.blogUrl}/${item.slugNoPrefixSlash}`,\n name: item.name,\n },\n })),\n ];\n\n const jsonLD: WithContext<BreadcrumbList> = {\n \"@context\": \"https://schema.org\",\n \"@type\": \"BreadcrumbList\",\n // @ts-expect-error - itemListElement is not typed correctly\n itemListElement,\n };\n\n return <OpinlyJSONLD content={JSON.stringify(jsonLD)} />;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMI;AANJ,oBAAmB;AACnB,wBAA6B;AAGtB,MAAM,eAAe,CAAC,EAAE,QAAQ,MAA2B;AAChE,SACE;AAAA,IAAC,cAAAA;AAAA,IAAA;AAAA,MACC,UAAS;AAAA,MACT,MAAK;AAAA,MACL,yBAAyB;AAAA,QACvB,QAAQ;AAAA,MACV;AAAA;AAAA,EACF;AAEJ;AAEO,MAAM,yBAAyB,CAAC;AAAA,EACrC;AACF,MAKM;AACJ,QAAM,kBAAkB;AAAA,IACtB;AAAA,MACE,SAAS;AAAA,MACT,UAAU;AAAA,MACV,MAAM;AAAA,QACJ,OAAO,+BAAa;AAAA,QACpB,MAAM,+BAAa;AAAA,MACrB;AAAA,IACF;AAAA,IACA;AAAA,MACE,SAAS;AAAA,MACT,UAAU;AAAA,MACV,MAAM;AAAA,QACJ,OAAO,+BAAa;AAAA,QACpB,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,GAAG,MAAM,IAAI,CAAC,MAAM,WAAW;AAAA,MAC7B,SAAS;AAAA,MACT,UAAU,QAAQ;AAAA,MAClB,MAAM;AAAA,QACJ,OAAO,GAAG,+BAAa,OAAO,IAAI,KAAK,iBAAiB;AAAA,QACxD,MAAM,KAAK;AAAA,MACb;AAAA,IACF,EAAE;AAAA,EACJ;AAEA,QAAM,SAAsC;AAAA,IAC1C,YAAY;AAAA,IACZ,SAAS;AAAA;AAAA,IAET;AAAA,EACF;AAEA,SAAO,4CAAC,gBAAa,SAAS,KAAK,UAAU,MAAM,GAAG;AACxD;","names":["Script"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
declare const OpinlyJSONLD: ({ content }: {
|
|
4
|
+
content: string;
|
|
5
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
6
|
+
declare const OpinlyBreadCrumbJsonLd: ({ items, }: {
|
|
7
|
+
items: {
|
|
8
|
+
slugNoPrefixSlash: string;
|
|
9
|
+
name: string;
|
|
10
|
+
}[];
|
|
11
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
export { OpinlyBreadCrumbJsonLd, OpinlyJSONLD };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
declare const OpinlyJSONLD: ({ content }: {
|
|
4
|
+
content: string;
|
|
5
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
6
|
+
declare const OpinlyBreadCrumbJsonLd: ({ items, }: {
|
|
7
|
+
items: {
|
|
8
|
+
slugNoPrefixSlash: string;
|
|
9
|
+
name: string;
|
|
10
|
+
}[];
|
|
11
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
export { OpinlyBreadCrumbJsonLd, OpinlyJSONLD };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import Script from "next/script";
|
|
3
|
+
import { opinlyConfig } from "../utils/sdk-config";
|
|
4
|
+
const OpinlyJSONLD = ({ content }) => {
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
Script,
|
|
7
|
+
{
|
|
8
|
+
strategy: "beforeInteractive",
|
|
9
|
+
type: "application/ld+json",
|
|
10
|
+
dangerouslySetInnerHTML: {
|
|
11
|
+
__html: content
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
};
|
|
16
|
+
const OpinlyBreadCrumbJsonLd = ({
|
|
17
|
+
items
|
|
18
|
+
}) => {
|
|
19
|
+
const itemListElement = [
|
|
20
|
+
{
|
|
21
|
+
"@type": "ListItem",
|
|
22
|
+
position: 1,
|
|
23
|
+
item: {
|
|
24
|
+
"@id": opinlyConfig.siteUrl,
|
|
25
|
+
name: opinlyConfig.siteName
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"@type": "ListItem",
|
|
30
|
+
position: 2,
|
|
31
|
+
item: {
|
|
32
|
+
"@id": opinlyConfig.blogUrl,
|
|
33
|
+
name: "Blog"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
...items.map((item, index) => ({
|
|
37
|
+
"@type": "ListItem",
|
|
38
|
+
position: index + 3,
|
|
39
|
+
item: {
|
|
40
|
+
"@id": `${opinlyConfig.blogUrl}/${item.slugNoPrefixSlash}`,
|
|
41
|
+
name: item.name
|
|
42
|
+
}
|
|
43
|
+
}))
|
|
44
|
+
];
|
|
45
|
+
const jsonLD = {
|
|
46
|
+
"@context": "https://schema.org",
|
|
47
|
+
"@type": "BreadcrumbList",
|
|
48
|
+
// @ts-expect-error - itemListElement is not typed correctly
|
|
49
|
+
itemListElement
|
|
50
|
+
};
|
|
51
|
+
return /* @__PURE__ */ jsx(OpinlyJSONLD, { content: JSON.stringify(jsonLD) });
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
OpinlyBreadCrumbJsonLd,
|
|
55
|
+
OpinlyJSONLD
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=json-ld.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/json-ld.tsx"],"sourcesContent":["import Script from \"next/script\";\nimport { opinlyConfig } from \"../utils/sdk-config\";\nimport { BreadcrumbList, WithContext } from \"schema-dts\";\n\nexport const OpinlyJSONLD = ({ content }: { content: string }) => {\n return (\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: content,\n }}\n />\n );\n};\n\nexport const OpinlyBreadCrumbJsonLd = ({\n items,\n}: {\n items: {\n slugNoPrefixSlash: string;\n name: string;\n }[];\n}) => {\n const itemListElement = [\n {\n \"@type\": \"ListItem\",\n position: 1,\n item: {\n \"@id\": opinlyConfig.siteUrl,\n name: opinlyConfig.siteName,\n },\n },\n {\n \"@type\": \"ListItem\",\n position: 2,\n item: {\n \"@id\": opinlyConfig.blogUrl,\n name: \"Blog\",\n },\n },\n ...items.map((item, index) => ({\n \"@type\": \"ListItem\",\n position: index + 3,\n item: {\n \"@id\": `${opinlyConfig.blogUrl}/${item.slugNoPrefixSlash}`,\n name: item.name,\n },\n })),\n ];\n\n const jsonLD: WithContext<BreadcrumbList> = {\n \"@context\": \"https://schema.org\",\n \"@type\": \"BreadcrumbList\",\n // @ts-expect-error - itemListElement is not typed correctly\n itemListElement,\n };\n\n return <OpinlyJSONLD content={JSON.stringify(jsonLD)} />;\n};\n"],"mappings":"AAMI;AANJ,OAAO,YAAY;AACnB,SAAS,oBAAoB;AAGtB,MAAM,eAAe,CAAC,EAAE,QAAQ,MAA2B;AAChE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAS;AAAA,MACT,MAAK;AAAA,MACL,yBAAyB;AAAA,QACvB,QAAQ;AAAA,MACV;AAAA;AAAA,EACF;AAEJ;AAEO,MAAM,yBAAyB,CAAC;AAAA,EACrC;AACF,MAKM;AACJ,QAAM,kBAAkB;AAAA,IACtB;AAAA,MACE,SAAS;AAAA,MACT,UAAU;AAAA,MACV,MAAM;AAAA,QACJ,OAAO,aAAa;AAAA,QACpB,MAAM,aAAa;AAAA,MACrB;AAAA,IACF;AAAA,IACA;AAAA,MACE,SAAS;AAAA,MACT,UAAU;AAAA,MACV,MAAM;AAAA,QACJ,OAAO,aAAa;AAAA,QACpB,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,GAAG,MAAM,IAAI,CAAC,MAAM,WAAW;AAAA,MAC7B,SAAS;AAAA,MACT,UAAU,QAAQ;AAAA,MAClB,MAAM;AAAA,QACJ,OAAO,GAAG,aAAa,OAAO,IAAI,KAAK,iBAAiB;AAAA,QACxD,MAAM,KAAK;AAAA,MACb;AAAA,IACF,EAAE;AAAA,EACJ;AAEA,QAAM,SAAsC;AAAA,IAC1C,YAAY;AAAA,IACZ,SAAS;AAAA;AAAA,IAET;AAAA,EACF;AAEA,SAAO,oBAAC,gBAAa,SAAS,KAAK,UAAU,MAAM,GAAG;AACxD;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=json-ld.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opinly/next",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"schema-dts": "^1.1.5",
|
|
32
32
|
"tailwind-merge": "^1.14.0",
|
|
33
33
|
"zod": "^3.25.67",
|
|
34
|
-
"@opinly/backend": "0.1.
|
|
34
|
+
"@opinly/backend": "0.1.23"
|
|
35
35
|
},
|
|
36
36
|
"engines": {
|
|
37
37
|
"node": ">=16"
|