@opinly/next 0.1.22 → 0.1.24
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/_components/table-of-contents.cjs +4 -2
- package/dist/components/blog-post/_components/table-of-contents.cjs.map +1 -1
- package/dist/components/blog-post/_components/table-of-contents.d.cts +2 -1
- package/dist/components/blog-post/_components/table-of-contents.d.ts +2 -1
- package/dist/components/blog-post/_components/table-of-contents.js +4 -2
- package/dist/components/blog-post/_components/table-of-contents.js.map +1 -1
- package/dist/components/blog-post/index.cjs +19 -36
- package/dist/components/blog-post/index.cjs.map +1 -1
- package/dist/components/blog-post/index.d.cts +6 -4
- package/dist/components/blog-post/index.d.ts +6 -4
- package/dist/components/blog-post/index.js +20 -41
- 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 +14 -5
- package/dist/components/home-page/index.cjs.map +1 -1
- package/dist/components/home-page/index.d.cts +7 -3
- package/dist/components/home-page/index.d.ts +7 -3
- package/dist/components/home-page/index.js +15 -6
- 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/components/opinly-blog.cjs +5 -3
- package/dist/components/opinly-blog.cjs.map +1 -1
- package/dist/components/opinly-blog.d.cts +8 -1
- package/dist/components/opinly-blog.d.ts +8 -1
- package/dist/components/opinly-blog.js +5 -3
- package/dist/components/opinly-blog.js.map +1 -1
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -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/dist/utils/sdk-config.cjs +1 -1
- package/dist/utils/sdk-config.cjs.map +1 -1
- package/dist/utils/sdk-config.js +1 -1
- package/dist/utils/sdk-config.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { opinlyConfig } from "../../../utils/sdk-config";
|
|
2
|
+
const folderCollectionJSONLD = (folder) => {
|
|
3
|
+
const jsonLD = {
|
|
4
|
+
"@context": "https://schema.org",
|
|
5
|
+
"@type": "CollectionPage",
|
|
6
|
+
name: folder.name,
|
|
7
|
+
description: folder.description || `Explore articles in ${folder.name}.`,
|
|
8
|
+
url: `${opinlyConfig.blogUrl}/${folder.slug}`,
|
|
9
|
+
publisher: {
|
|
10
|
+
"@type": "Organization",
|
|
11
|
+
name: opinlyConfig.siteName
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
return JSON.stringify(jsonLD);
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
folderCollectionJSONLD
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=json-ld.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/folder-page/_helpers/json-ld.ts"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport { CollectionPage, WithContext } from \"schema-dts\";\nimport { opinlyConfig } from \"../../../utils/sdk-config\";\n\ntype FolderRes = Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"folder\" }\n>[\"data\"];\n\nexport const folderCollectionJSONLD = (folder: FolderRes) => {\n const jsonLD: WithContext<CollectionPage> = {\n \"@context\": \"https://schema.org\",\n \"@type\": \"CollectionPage\",\n name: folder.name,\n description: folder.description || `Explore articles in ${folder.name}.`,\n url: `${opinlyConfig.blogUrl}/${folder.slug}`,\n publisher: {\n \"@type\": \"Organization\",\n name: opinlyConfig.siteName,\n },\n };\n\n return JSON.stringify(jsonLD);\n};\n"],"mappings":"AAEA,SAAS,oBAAoB;AAOtB,MAAM,yBAAyB,CAAC,WAAsB;AAC3D,QAAM,SAAsC;AAAA,IAC1C,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,MAAM,OAAO;AAAA,IACb,aAAa,OAAO,eAAe,uBAAuB,OAAO,IAAI;AAAA,IACrE,KAAK,GAAG,aAAa,OAAO,IAAI,OAAO,IAAI;AAAA,IAC3C,WAAW;AAAA,MACT,SAAS;AAAA,MACT,MAAM,aAAa;AAAA,IACrB;AAAA,EACF;AAEA,SAAO,KAAK,UAAU,MAAM;AAC9B;","names":[]}
|
|
@@ -24,31 +24,19 @@ module.exports = __toCommonJS(folder_page_exports);
|
|
|
24
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
25
|
var import_post_preview = require("../post-preview");
|
|
26
26
|
var import_bread_crumbs = require("../bread-crumbs");
|
|
27
|
-
var import_next_seo = require("next-seo");
|
|
28
27
|
var import_sdk_config = require("../../utils/sdk-config");
|
|
28
|
+
var import_json_ld = require("../json-ld");
|
|
29
29
|
const FolderPage = ({
|
|
30
30
|
folder
|
|
31
31
|
}) => {
|
|
32
32
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
33
33
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
34
|
-
|
|
34
|
+
import_json_ld.OpinlyBreadCrumbJsonLd,
|
|
35
35
|
{
|
|
36
|
-
|
|
37
|
-
itemListElements: [
|
|
36
|
+
items: [
|
|
38
37
|
{
|
|
39
|
-
|
|
40
|
-
name:
|
|
41
|
-
item: `${import_sdk_config.opinlyConfig.siteUrl}`
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
position: 2,
|
|
45
|
-
name: "Blog",
|
|
46
|
-
item: import_sdk_config.opinlyConfig.blogUrl
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
position: 3,
|
|
50
|
-
name: folder.name,
|
|
51
|
-
item: `${import_sdk_config.opinlyConfig.blogUrl}/${folder.slug}`
|
|
38
|
+
slugNoPrefixSlash: folder.slug,
|
|
39
|
+
name: folder.name
|
|
52
40
|
}
|
|
53
41
|
]
|
|
54
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/folder-page/index.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport { PostPreview } from \"../post-preview\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\nimport { BreadcrumbJsonLd } from \"next-seo\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\n\nexport const FolderPage = ({\n folder,\n}: {\n folder: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"folder\" }\n >[\"data\"];\n}) => {\n return (\n <>\n <
|
|
1
|
+
{"version":3,"sources":["../../../src/components/folder-page/index.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport { PostPreview } from \"../post-preview\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\nimport { BreadcrumbJsonLd } from \"next-seo\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\nimport { OpinlyBreadCrumbJsonLd } from \"../json-ld\";\n\nexport const FolderPage = ({\n folder,\n}: {\n folder: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"folder\" }\n >[\"data\"];\n}) => {\n return (\n <>\n <OpinlyBreadCrumbJsonLd\n items={[\n {\n slugNoPrefixSlash: folder.slug,\n name: folder.name,\n },\n ]}\n />\n\n <div className=\"max-w-6xl mx-auto px-4 py-10\">\n <BreadCrumbs\n breadcrumbs={[\n {\n name: folder.name,\n url: `${opinlyConfig.blogUrl}/${folder.slug}`,\n },\n ]}\n />\n\n <h1 className=\"text-4xl font-bold mb-2\">{folder.name}</h1>\n <p className=\"text-muted-foreground max-w-2xl mb-8\">\n {folder.description || `Explore articles about ${folder.name}.`}\n </p>\n\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8\">\n {folder.posts.length === 0 && (\n <div className=\"text-muted-foreground\">No posts added yet</div>\n )}\n {folder.posts.map((post) => {\n return <PostPreview key={post.slug} post={post} />;\n })}\n </div>\n </div>\n </>\n );\n};\n\nfunction formatDate(dateStr: string) {\n return new Date(dateStr).toLocaleDateString(\"en-GB\", {\n day: \"2-digit\",\n month: \"short\",\n year: \"numeric\",\n });\n}\n\nfunction formatMinutes(description: string | null) {\n // Fake estimate based on length of description\n if (!description) return \"5 min read\";\n const words = description.split(\" \").length;\n const mins = Math.ceil(words / 200);\n return `${mins} min read`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBI;AAfJ,0BAA4B;AAC5B,0BAA4B;AAE5B,wBAA6B;AAC7B,qBAAuC;AAEhC,MAAM,aAAa,CAAC;AAAA,EACzB;AACF,MAKM;AACJ,SACE,4EACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,UACL;AAAA,YACE,mBAAmB,OAAO;AAAA,YAC1B,MAAM,OAAO;AAAA,UACf;AAAA,QACF;AAAA;AAAA,IACF;AAAA,IAEA,6CAAC,SAAI,WAAU,gCACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,aAAa;AAAA,YACX;AAAA,cACE,MAAM,OAAO;AAAA,cACb,KAAK,GAAG,+BAAa,OAAO,IAAI,OAAO,IAAI;AAAA,YAC7C;AAAA,UACF;AAAA;AAAA,MACF;AAAA,MAEA,4CAAC,QAAG,WAAU,2BAA2B,iBAAO,MAAK;AAAA,MACrD,4CAAC,OAAE,WAAU,wCACV,iBAAO,eAAe,0BAA0B,OAAO,IAAI,KAC9D;AAAA,MAEA,6CAAC,SAAI,WAAU,wDACZ;AAAA,eAAO,MAAM,WAAW,KACvB,4CAAC,SAAI,WAAU,yBAAwB,gCAAkB;AAAA,QAE1D,OAAO,MAAM,IAAI,CAAC,SAAS;AAC1B,iBAAO,4CAAC,mCAA4B,QAAX,KAAK,IAAkB;AAAA,QAClD,CAAC;AAAA,SACH;AAAA,OACF;AAAA,KACF;AAEJ;AAEA,SAAS,WAAW,SAAiB;AACnC,SAAO,IAAI,KAAK,OAAO,EAAE,mBAAmB,SAAS;AAAA,IACnD,KAAK;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,EACR,CAAC;AACH;AAEA,SAAS,cAAc,aAA4B;AAEjD,MAAI,CAAC,YAAa,QAAO;AACzB,QAAM,QAAQ,YAAY,MAAM,GAAG,EAAE;AACrC,QAAM,OAAO,KAAK,KAAK,QAAQ,GAAG;AAClC,SAAO,GAAG,IAAI;AAChB;","names":[]}
|
|
@@ -1,31 +1,19 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { PostPreview } from "../post-preview";
|
|
3
3
|
import { BreadCrumbs } from "../bread-crumbs";
|
|
4
|
-
import { BreadcrumbJsonLd } from "next-seo";
|
|
5
4
|
import { opinlyConfig } from "../../utils/sdk-config";
|
|
5
|
+
import { OpinlyBreadCrumbJsonLd } from "../json-ld";
|
|
6
6
|
const FolderPage = ({
|
|
7
7
|
folder
|
|
8
8
|
}) => {
|
|
9
9
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10
10
|
/* @__PURE__ */ jsx(
|
|
11
|
-
|
|
11
|
+
OpinlyBreadCrumbJsonLd,
|
|
12
12
|
{
|
|
13
|
-
|
|
14
|
-
itemListElements: [
|
|
13
|
+
items: [
|
|
15
14
|
{
|
|
16
|
-
|
|
17
|
-
name:
|
|
18
|
-
item: `${opinlyConfig.siteUrl}`
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
position: 2,
|
|
22
|
-
name: "Blog",
|
|
23
|
-
item: opinlyConfig.blogUrl
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
position: 3,
|
|
27
|
-
name: folder.name,
|
|
28
|
-
item: `${opinlyConfig.blogUrl}/${folder.slug}`
|
|
15
|
+
slugNoPrefixSlash: folder.slug,
|
|
16
|
+
name: folder.name
|
|
29
17
|
}
|
|
30
18
|
]
|
|
31
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/folder-page/index.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport { PostPreview } from \"../post-preview\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\nimport { BreadcrumbJsonLd } from \"next-seo\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\n\nexport const FolderPage = ({\n folder,\n}: {\n folder: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"folder\" }\n >[\"data\"];\n}) => {\n return (\n <>\n <
|
|
1
|
+
{"version":3,"sources":["../../../src/components/folder-page/index.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport { PostPreview } from \"../post-preview\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\nimport { BreadcrumbJsonLd } from \"next-seo\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\nimport { OpinlyBreadCrumbJsonLd } from \"../json-ld\";\n\nexport const FolderPage = ({\n folder,\n}: {\n folder: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"folder\" }\n >[\"data\"];\n}) => {\n return (\n <>\n <OpinlyBreadCrumbJsonLd\n items={[\n {\n slugNoPrefixSlash: folder.slug,\n name: folder.name,\n },\n ]}\n />\n\n <div className=\"max-w-6xl mx-auto px-4 py-10\">\n <BreadCrumbs\n breadcrumbs={[\n {\n name: folder.name,\n url: `${opinlyConfig.blogUrl}/${folder.slug}`,\n },\n ]}\n />\n\n <h1 className=\"text-4xl font-bold mb-2\">{folder.name}</h1>\n <p className=\"text-muted-foreground max-w-2xl mb-8\">\n {folder.description || `Explore articles about ${folder.name}.`}\n </p>\n\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8\">\n {folder.posts.length === 0 && (\n <div className=\"text-muted-foreground\">No posts added yet</div>\n )}\n {folder.posts.map((post) => {\n return <PostPreview key={post.slug} post={post} />;\n })}\n </div>\n </div>\n </>\n );\n};\n\nfunction formatDate(dateStr: string) {\n return new Date(dateStr).toLocaleDateString(\"en-GB\", {\n day: \"2-digit\",\n month: \"short\",\n year: \"numeric\",\n });\n}\n\nfunction formatMinutes(description: string | null) {\n // Fake estimate based on length of description\n if (!description) return \"5 min read\";\n const words = description.split(\" \").length;\n const mins = Math.ceil(words / 200);\n return `${mins} min read`;\n}\n"],"mappings":"AAgBI,mBACE,KAwBE,YAzBJ;AAfJ,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAE5B,SAAS,oBAAoB;AAC7B,SAAS,8BAA8B;AAEhC,MAAM,aAAa,CAAC;AAAA,EACzB;AACF,MAKM;AACJ,SACE,iCACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,UACL;AAAA,YACE,mBAAmB,OAAO;AAAA,YAC1B,MAAM,OAAO;AAAA,UACf;AAAA,QACF;AAAA;AAAA,IACF;AAAA,IAEA,qBAAC,SAAI,WAAU,gCACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,aAAa;AAAA,YACX;AAAA,cACE,MAAM,OAAO;AAAA,cACb,KAAK,GAAG,aAAa,OAAO,IAAI,OAAO,IAAI;AAAA,YAC7C;AAAA,UACF;AAAA;AAAA,MACF;AAAA,MAEA,oBAAC,QAAG,WAAU,2BAA2B,iBAAO,MAAK;AAAA,MACrD,oBAAC,OAAE,WAAU,wCACV,iBAAO,eAAe,0BAA0B,OAAO,IAAI,KAC9D;AAAA,MAEA,qBAAC,SAAI,WAAU,wDACZ;AAAA,eAAO,MAAM,WAAW,KACvB,oBAAC,SAAI,WAAU,yBAAwB,gCAAkB;AAAA,QAE1D,OAAO,MAAM,IAAI,CAAC,SAAS;AAC1B,iBAAO,oBAAC,eAA4B,QAAX,KAAK,IAAkB;AAAA,QAClD,CAAC;AAAA,SACH;AAAA,OACF;AAAA,KACF;AAEJ;AAEA,SAAS,WAAW,SAAiB;AACnC,SAAO,IAAI,KAAK,OAAO,EAAE,mBAAmB,SAAS;AAAA,IACnD,KAAK;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,EACR,CAAC;AACH;AAEA,SAAS,cAAc,aAA4B;AAEjD,MAAI,CAAC,YAAa,QAAO;AACzB,QAAM,QAAQ,YAAY,MAAM,GAAG,EAAE;AACrC,QAAM,OAAO,KAAK,KAAK,QAAQ,GAAG;AAClC,SAAO,GAAG,IAAI;AAChB;","names":[]}
|
|
@@ -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,22 @@ 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
|
-
data
|
|
31
|
+
data,
|
|
32
|
+
header,
|
|
33
|
+
cta
|
|
30
34
|
}) => {
|
|
31
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
32
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
33
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
34
|
-
|
|
35
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
36
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_json_ld2.OpinlyJSONLD, { content: (0, import_json_ld.blogJSONLD)() }),
|
|
37
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-7xl mx-auto px-4 py-10", children: [
|
|
38
|
+
header,
|
|
39
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_top_posts.TopPosts, { posts: data.posts }),
|
|
40
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_pagination.HomePagePagination, { count: data.count, page: data.page }),
|
|
41
|
+
cta,
|
|
42
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_folders.HomePageFolders, { folders: data.folders })
|
|
43
|
+
] })
|
|
35
44
|
] });
|
|
36
45
|
};
|
|
37
46
|
// 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 type HomePageProps = {\n header?: React.ReactNode;\n cta?: React.ReactNode;\n};\n\nexport const HomePage = ({\n data,\n header,\n cta,\n}: {\n data: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"home\" }\n >[\"data\"];\n} & HomePageProps) => {\n return (\n <>\n <OpinlyJSONLD content={blogJSONLD()} />\n\n <div className=\"max-w-7xl mx-auto px-4 py-10\">\n {header}\n\n <TopPosts posts={data.posts} />\n <HomePagePagination count={data.count} page={data.page} />\n {cta}\n <HomePageFolders folders={data.folders} />\n </div>\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBI;AAtBJ,uBAAyB;AACzB,qBAAgC;AAChC,wBAAmC;AACnC,qBAA2B;AAC3B,IAAAA,kBAAqD;AAO9C,MAAM,WAAW,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AACF,MAKsB;AACpB,SACE,4EACE;AAAA,gDAAC,gCAAa,aAAS,2BAAW,GAAG;AAAA,IAErC,6CAAC,SAAI,WAAU,gCACZ;AAAA;AAAA,MAED,4CAAC,6BAAS,OAAO,KAAK,OAAO;AAAA,MAC7B,4CAAC,wCAAmB,OAAO,KAAK,OAAO,MAAM,KAAK,MAAM;AAAA,MACvD;AAAA,MACD,4CAAC,kCAAgB,SAAS,KAAK,SAAS;AAAA,OAC1C;AAAA,KACF;AAEJ;","names":["import_json_ld"]}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { Opinly } from '@opinly/backend';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
type HomePageProps = {
|
|
5
|
+
header?: React.ReactNode;
|
|
6
|
+
cta?: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
declare const HomePage: ({ data, header, cta, }: {
|
|
5
9
|
data: Extract<Awaited<ReturnType<Opinly["content"]["blog"]>>, {
|
|
6
10
|
type: "home";
|
|
7
11
|
}>["data"];
|
|
8
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
12
|
+
} & HomePageProps) => react_jsx_runtime.JSX.Element;
|
|
9
13
|
|
|
10
|
-
export { HomePage };
|
|
14
|
+
export { HomePage, type HomePageProps };
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { Opinly } from '@opinly/backend';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
type HomePageProps = {
|
|
5
|
+
header?: React.ReactNode;
|
|
6
|
+
cta?: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
declare const HomePage: ({ data, header, cta, }: {
|
|
5
9
|
data: Extract<Awaited<ReturnType<Opinly["content"]["blog"]>>, {
|
|
6
10
|
type: "home";
|
|
7
11
|
}>["data"];
|
|
8
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
12
|
+
} & HomePageProps) => react_jsx_runtime.JSX.Element;
|
|
9
13
|
|
|
10
|
-
export { HomePage };
|
|
14
|
+
export { HomePage, type HomePageProps };
|
|
@@ -1,14 +1,23 @@
|
|
|
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
|
-
data
|
|
8
|
+
data,
|
|
9
|
+
header,
|
|
10
|
+
cta
|
|
7
11
|
}) => {
|
|
8
|
-
return /* @__PURE__ */ jsxs(
|
|
9
|
-
/* @__PURE__ */ jsx(
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
|
|
12
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
13
|
+
/* @__PURE__ */ jsx(OpinlyJSONLD, { content: blogJSONLD() }),
|
|
14
|
+
/* @__PURE__ */ jsxs("div", { className: "max-w-7xl mx-auto px-4 py-10", children: [
|
|
15
|
+
header,
|
|
16
|
+
/* @__PURE__ */ jsx(TopPosts, { posts: data.posts }),
|
|
17
|
+
/* @__PURE__ */ jsx(HomePagePagination, { count: data.count, page: data.page }),
|
|
18
|
+
cta,
|
|
19
|
+
/* @__PURE__ */ jsx(HomePageFolders, { folders: data.folders })
|
|
20
|
+
] })
|
|
12
21
|
] });
|
|
13
22
|
};
|
|
14
23
|
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 type HomePageProps = {\n header?: React.ReactNode;\n cta?: React.ReactNode;\n};\n\nexport const HomePage = ({\n data,\n header,\n cta,\n}: {\n data: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"home\" }\n >[\"data\"];\n} & HomePageProps) => {\n return (\n <>\n <OpinlyJSONLD content={blogJSONLD()} />\n\n <div className=\"max-w-7xl mx-auto px-4 py-10\">\n {header}\n\n <TopPosts posts={data.posts} />\n <HomePagePagination count={data.count} page={data.page} />\n {cta}\n <HomePageFolders folders={data.folders} />\n </div>\n </>\n );\n};\n"],"mappings":"AAuBI,mBACE,KAEA,YAHF;AAtBJ,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,kBAAkB;AAC3B,SAAiC,oBAAoB;AAO9C,MAAM,WAAW,CAAC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AACF,MAKsB;AACpB,SACE,iCACE;AAAA,wBAAC,gBAAa,SAAS,WAAW,GAAG;AAAA,IAErC,qBAAC,SAAI,WAAU,gCACZ;AAAA;AAAA,MAED,oBAAC,YAAS,OAAO,KAAK,OAAO;AAAA,MAC7B,oBAAC,sBAAmB,OAAO,KAAK,OAAO,MAAM,KAAK,MAAM;AAAA,MACvD;AAAA,MACD,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":[]}
|
|
@@ -30,17 +30,19 @@ var import_authors_page = require("./authors-page");
|
|
|
30
30
|
var import_navigation = require("next/navigation");
|
|
31
31
|
const OpinlyBlog = async ({
|
|
32
32
|
pageData,
|
|
33
|
-
client
|
|
33
|
+
client,
|
|
34
|
+
homePageProps = {},
|
|
35
|
+
blogPostProps = {}
|
|
34
36
|
}) => {
|
|
35
37
|
const blog = await client.content.blog(pageData);
|
|
36
38
|
if (blog.type === "not-found") {
|
|
37
39
|
return (0, import_navigation.notFound)();
|
|
38
40
|
}
|
|
39
41
|
if (blog.type === "home") {
|
|
40
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_home_page.HomePage, { data: blog.data });
|
|
42
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_home_page.HomePage, { data: blog.data, ...homePageProps });
|
|
41
43
|
}
|
|
42
44
|
if (blog.type === "post") {
|
|
43
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blog_post.BlogPost, { post: blog.data });
|
|
45
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blog_post.BlogPost, { post: blog.data, ...blogPostProps });
|
|
44
46
|
}
|
|
45
47
|
if (blog.type === "author") {
|
|
46
48
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_author_page.AuthorPage, { author: blog.data });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/opinly-blog.tsx"],"sourcesContent":["import { BlogPost } from \"./blog-post\";\nimport { FolderPage } from \"./folder-page\";\nimport { Opinly, OpinlyPagePropsPromisified } from \"@opinly/backend\";\nimport { HomePage } from \"./home-page\";\nimport { AuthorPage } from \"./author-page\";\nimport { AuthorsPage } from \"./authors-page\";\nimport { notFound } from \"next/navigation\";\n\nexport const OpinlyBlog = async ({\n pageData,\n client
|
|
1
|
+
{"version":3,"sources":["../../src/components/opinly-blog.tsx"],"sourcesContent":["import { BlogPost, BlogPostProps } from \"./blog-post\";\nimport { FolderPage } from \"./folder-page\";\nimport { Opinly, OpinlyPagePropsPromisified } from \"@opinly/backend\";\nimport { HomePage, HomePageProps } from \"./home-page\";\nimport { AuthorPage } from \"./author-page\";\nimport { AuthorsPage } from \"./authors-page\";\nimport { notFound } from \"next/navigation\";\n\nexport const OpinlyBlog = async ({\n pageData,\n client,\n homePageProps = {},\n blogPostProps = {},\n}: {\n pageData: OpinlyPagePropsPromisified;\n client: Opinly;\n homePageProps?: HomePageProps;\n blogPostProps?: BlogPostProps;\n}) => {\n const blog = await client.content.blog(pageData);\n\n if (blog.type === \"not-found\") {\n return notFound();\n }\n\n if (blog.type === \"home\") {\n return <HomePage data={blog.data} {...homePageProps} />;\n }\n\n if (blog.type === \"post\") {\n return <BlogPost post={blog.data} {...blogPostProps} />;\n }\n\n if (blog.type === \"author\") {\n return <AuthorPage author={blog.data} />;\n }\n\n if (blog.type === \"authors\") {\n return <AuthorsPage authors={blog.data} />;\n }\n\n return <FolderPage folder={blog.data} />;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BW;AA1BX,uBAAwC;AACxC,yBAA2B;AAE3B,uBAAwC;AACxC,yBAA2B;AAC3B,0BAA4B;AAC5B,wBAAyB;AAElB,MAAM,aAAa,OAAO;AAAA,EAC/B;AAAA,EACA;AAAA,EACA,gBAAgB,CAAC;AAAA,EACjB,gBAAgB,CAAC;AACnB,MAKM;AACJ,QAAM,OAAO,MAAM,OAAO,QAAQ,KAAK,QAAQ;AAE/C,MAAI,KAAK,SAAS,aAAa;AAC7B,eAAO,4BAAS;AAAA,EAClB;AAEA,MAAI,KAAK,SAAS,QAAQ;AACxB,WAAO,4CAAC,6BAAS,MAAM,KAAK,MAAO,GAAG,eAAe;AAAA,EACvD;AAEA,MAAI,KAAK,SAAS,QAAQ;AACxB,WAAO,4CAAC,6BAAS,MAAM,KAAK,MAAO,GAAG,eAAe;AAAA,EACvD;AAEA,MAAI,KAAK,SAAS,UAAU;AAC1B,WAAO,4CAAC,iCAAW,QAAQ,KAAK,MAAM;AAAA,EACxC;AAEA,MAAI,KAAK,SAAS,WAAW;AAC3B,WAAO,4CAAC,mCAAY,SAAS,KAAK,MAAM;AAAA,EAC1C;AAEA,SAAO,4CAAC,iCAAW,QAAQ,KAAK,MAAM;AACxC;","names":[]}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { BlogPostProps } from './blog-post/index.cjs';
|
|
2
3
|
import { OpinlyPagePropsPromisified, Opinly } from '@opinly/backend';
|
|
4
|
+
import { HomePageProps } from './home-page/index.cjs';
|
|
5
|
+
import 'react';
|
|
6
|
+
import './blog-post/_types/blog-post.cjs';
|
|
7
|
+
import './blog-post/_types/class-names.cjs';
|
|
3
8
|
|
|
4
|
-
declare const OpinlyBlog: ({ pageData, client }: {
|
|
9
|
+
declare const OpinlyBlog: ({ pageData, client, homePageProps, blogPostProps, }: {
|
|
5
10
|
pageData: OpinlyPagePropsPromisified;
|
|
6
11
|
client: Opinly;
|
|
12
|
+
homePageProps?: HomePageProps;
|
|
13
|
+
blogPostProps?: BlogPostProps;
|
|
7
14
|
}) => Promise<react_jsx_runtime.JSX.Element>;
|
|
8
15
|
|
|
9
16
|
export { OpinlyBlog };
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { BlogPostProps } from './blog-post/index.js';
|
|
2
3
|
import { OpinlyPagePropsPromisified, Opinly } from '@opinly/backend';
|
|
4
|
+
import { HomePageProps } from './home-page/index.js';
|
|
5
|
+
import 'react';
|
|
6
|
+
import './blog-post/_types/blog-post.js';
|
|
7
|
+
import './blog-post/_types/class-names.js';
|
|
3
8
|
|
|
4
|
-
declare const OpinlyBlog: ({ pageData, client }: {
|
|
9
|
+
declare const OpinlyBlog: ({ pageData, client, homePageProps, blogPostProps, }: {
|
|
5
10
|
pageData: OpinlyPagePropsPromisified;
|
|
6
11
|
client: Opinly;
|
|
12
|
+
homePageProps?: HomePageProps;
|
|
13
|
+
blogPostProps?: BlogPostProps;
|
|
7
14
|
}) => Promise<react_jsx_runtime.JSX.Element>;
|
|
8
15
|
|
|
9
16
|
export { OpinlyBlog };
|