@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
|
@@ -1,2 +1,44 @@
|
|
|
1
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
|
+
genPersonPostingJSONLD: () => genPersonPostingJSONLD
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(json_ld_exports);
|
|
24
|
+
var import_sdk_config = require("../../../utils/sdk-config");
|
|
25
|
+
const genPersonPostingJSONLD = (author) => {
|
|
26
|
+
const jsonLD = {
|
|
27
|
+
"@context": "https://schema.org",
|
|
28
|
+
"@type": "Person",
|
|
29
|
+
name: author.name,
|
|
30
|
+
description: author.bio || void 0,
|
|
31
|
+
url: `${import_sdk_config.opinlyConfig.blogUrl}/authors/${author.slug}`,
|
|
32
|
+
image: author.image.fileKey ? {
|
|
33
|
+
"@type": "ImageObject",
|
|
34
|
+
url: `${import_sdk_config.opinlyConfig.imagesUrl}/${author.image.fileKey}`,
|
|
35
|
+
caption: `Profile picture of ${author.name}`
|
|
36
|
+
} : void 0
|
|
37
|
+
};
|
|
38
|
+
return JSON.stringify(jsonLD);
|
|
39
|
+
};
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
42
|
+
genPersonPostingJSONLD
|
|
43
|
+
});
|
|
2
44
|
//# sourceMappingURL=json-ld.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/author-page/_helpers/json-ld.ts"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport { Person, WithContext } from \"schema-dts\";\nimport { opinlyConfig } from \"../../../utils/sdk-config\";\n\ntype AuthorRes = Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"author\" }\n>[\"data\"];\n\nexport const genPersonPostingJSONLD = (author: AuthorRes): string => {\n const jsonLD: WithContext<Exclude<Person, string>> = {\n \"@context\": \"https://schema.org\",\n \"@type\": \"Person\",\n name: author.name,\n description: author.bio || undefined,\n url: `${opinlyConfig.blogUrl}/authors/${author.slug}`,\n image: author.image.fileKey\n ? {\n \"@type\": \"ImageObject\",\n url: `${opinlyConfig.imagesUrl}/${author.image.fileKey}`,\n caption: `Profile picture of ${author.name}`,\n }\n : undefined,\n };\n\n return JSON.stringify(jsonLD);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,wBAA6B;AAOtB,MAAM,yBAAyB,CAAC,WAA8B;AACnE,QAAM,SAA+C;AAAA,IACnD,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,MAAM,OAAO;AAAA,IACb,aAAa,OAAO,OAAO;AAAA,IAC3B,KAAK,GAAG,+BAAa,OAAO,YAAY,OAAO,IAAI;AAAA,IACnD,OAAO,OAAO,MAAM,UAChB;AAAA,MACE,SAAS;AAAA,MACT,KAAK,GAAG,+BAAa,SAAS,IAAI,OAAO,MAAM,OAAO;AAAA,MACtD,SAAS,sBAAsB,OAAO,IAAI;AAAA,IAC5C,IACA;AAAA,EACN;AAEA,SAAO,KAAK,UAAU,MAAM;AAC9B;","names":[]}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
import { Opinly } from '@opinly/backend';
|
|
1
2
|
|
|
2
|
-
|
|
3
|
+
type AuthorRes = Extract<Awaited<ReturnType<Opinly["content"]["blog"]>>, {
|
|
4
|
+
type: "author";
|
|
5
|
+
}>["data"];
|
|
6
|
+
declare const genPersonPostingJSONLD: (author: AuthorRes) => string;
|
|
7
|
+
|
|
8
|
+
export { genPersonPostingJSONLD };
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
import { Opinly } from '@opinly/backend';
|
|
1
2
|
|
|
2
|
-
|
|
3
|
+
type AuthorRes = Extract<Awaited<ReturnType<Opinly["content"]["blog"]>>, {
|
|
4
|
+
type: "author";
|
|
5
|
+
}>["data"];
|
|
6
|
+
declare const genPersonPostingJSONLD: (author: AuthorRes) => string;
|
|
7
|
+
|
|
8
|
+
export { genPersonPostingJSONLD };
|
|
@@ -1 +1,20 @@
|
|
|
1
|
+
import { opinlyConfig } from "../../../utils/sdk-config";
|
|
2
|
+
const genPersonPostingJSONLD = (author) => {
|
|
3
|
+
const jsonLD = {
|
|
4
|
+
"@context": "https://schema.org",
|
|
5
|
+
"@type": "Person",
|
|
6
|
+
name: author.name,
|
|
7
|
+
description: author.bio || void 0,
|
|
8
|
+
url: `${opinlyConfig.blogUrl}/authors/${author.slug}`,
|
|
9
|
+
image: author.image.fileKey ? {
|
|
10
|
+
"@type": "ImageObject",
|
|
11
|
+
url: `${opinlyConfig.imagesUrl}/${author.image.fileKey}`,
|
|
12
|
+
caption: `Profile picture of ${author.name}`
|
|
13
|
+
} : void 0
|
|
14
|
+
};
|
|
15
|
+
return JSON.stringify(jsonLD);
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
genPersonPostingJSONLD
|
|
19
|
+
};
|
|
1
20
|
//# sourceMappingURL=json-ld.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/author-page/_helpers/json-ld.ts"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport { Person, WithContext } from \"schema-dts\";\nimport { opinlyConfig } from \"../../../utils/sdk-config\";\n\ntype AuthorRes = Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"author\" }\n>[\"data\"];\n\nexport const genPersonPostingJSONLD = (author: AuthorRes): string => {\n const jsonLD: WithContext<Exclude<Person, string>> = {\n \"@context\": \"https://schema.org\",\n \"@type\": \"Person\",\n name: author.name,\n description: author.bio || undefined,\n url: `${opinlyConfig.blogUrl}/authors/${author.slug}`,\n image: author.image.fileKey\n ? {\n \"@type\": \"ImageObject\",\n url: `${opinlyConfig.imagesUrl}/${author.image.fileKey}`,\n caption: `Profile picture of ${author.name}`,\n }\n : undefined,\n };\n\n return JSON.stringify(jsonLD);\n};\n"],"mappings":"AAEA,SAAS,oBAAoB;AAOtB,MAAM,yBAAyB,CAAC,WAA8B;AACnE,QAAM,SAA+C;AAAA,IACnD,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,MAAM,OAAO;AAAA,IACb,aAAa,OAAO,OAAO;AAAA,IAC3B,KAAK,GAAG,aAAa,OAAO,YAAY,OAAO,IAAI;AAAA,IACnD,OAAO,OAAO,MAAM,UAChB;AAAA,MACE,SAAS;AAAA,MACT,KAAK,GAAG,aAAa,SAAS,IAAI,OAAO,MAAM,OAAO;AAAA,MACtD,SAAS,sBAAsB,OAAO,IAAI;AAAA,IAC5C,IACA;AAAA,EACN;AAEA,SAAO,KAAK,UAAU,MAAM;AAC9B;","names":[]}
|
|
@@ -36,34 +36,28 @@ var import_image = __toESM(require("next/image"), 1);
|
|
|
36
36
|
var import_sdk_config = require("../../utils/sdk-config");
|
|
37
37
|
var import_post_preview = require("../post-preview");
|
|
38
38
|
var import_bread_crumbs = require("../bread-crumbs");
|
|
39
|
-
var
|
|
39
|
+
var import_json_ld = require("../json-ld");
|
|
40
|
+
var import_json_ld2 = require("./_helpers/json-ld");
|
|
40
41
|
const AuthorPage = ({
|
|
41
42
|
author
|
|
42
43
|
}) => {
|
|
43
44
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
44
45
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
45
|
-
|
|
46
|
+
import_json_ld.OpinlyBreadCrumbJsonLd,
|
|
46
47
|
{
|
|
47
|
-
|
|
48
|
-
itemListElements: [
|
|
48
|
+
items: [
|
|
49
49
|
{
|
|
50
|
-
|
|
51
|
-
name:
|
|
52
|
-
item: import_sdk_config.opinlyConfig.siteUrl
|
|
50
|
+
slugNoPrefixSlash: "authors",
|
|
51
|
+
name: "Authors"
|
|
53
52
|
},
|
|
54
53
|
{
|
|
55
|
-
|
|
56
|
-
name:
|
|
57
|
-
item: import_sdk_config.opinlyConfig.blogUrl
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
position: 3,
|
|
61
|
-
name: "Authors",
|
|
62
|
-
item: `${import_sdk_config.opinlyConfig.blogPrefix}/authors`
|
|
54
|
+
slugNoPrefixSlash: `authors/${author.slug}`,
|
|
55
|
+
name: author.name
|
|
63
56
|
}
|
|
64
57
|
]
|
|
65
58
|
}
|
|
66
59
|
),
|
|
60
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_json_ld.OpinlyJSONLD, { content: (0, import_json_ld2.genPersonPostingJSONLD)(author) }),
|
|
67
61
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-5xl mx-auto px-4 py-10", children: [
|
|
68
62
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
69
63
|
import_bread_crumbs.BreadCrumbs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/author-page/index.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport Image from \"next/image\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\nimport { PostPreview } from \"../post-preview\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/components/author-page/index.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport Image from \"next/image\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\nimport { PostPreview } from \"../post-preview\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\nimport { OpinlyBreadCrumbJsonLd, OpinlyJSONLD } from \"../json-ld\";\nimport { genPersonPostingJSONLD } from \"./_helpers/json-ld\";\n\nexport const AuthorPage = ({\n author,\n}: {\n author: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"author\" }\n >[\"data\"];\n}) => {\n return (\n <>\n <OpinlyBreadCrumbJsonLd\n items={[\n {\n slugNoPrefixSlash: \"authors\",\n name: \"Authors\",\n },\n {\n slugNoPrefixSlash: `authors/${author.slug}`,\n name: author.name,\n },\n ]}\n />\n <OpinlyJSONLD content={genPersonPostingJSONLD(author)} />\n\n <div className=\"max-w-5xl mx-auto px-4 py-10\">\n <BreadCrumbs\n breadcrumbs={[\n {\n name: \"Authors\",\n url: `${opinlyConfig.blogPrefix}/authors`,\n },\n ]}\n />\n {/* Author Header */}\n <div className=\"flex items-center gap-6 mb-10\">\n {author.image.fileKey && (\n <Image\n unoptimized={opinlyConfig.unoptimizedImages}\n src={`${opinlyConfig.imagesPrefix}/${author.image.fileKey}`}\n alt={author.image.alt || author.name}\n width={150}\n height={150}\n className=\"rounded-full border\"\n />\n )}\n <div>\n <h1 className=\"text-3xl font-bold mb-1\">{author.name}</h1>\n {author.bio && (\n <p className=\"text-muted-foreground text-base max-w-2xl\">\n {author.bio}\n </p>\n )}\n </div>\n </div>\n\n {/* Posts Grid */}\n <h2 className=\"text-xl font-semibold mb-6\">Posts by {author.name}</h2>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8\">\n {author.posts && author.posts.length > 0 ? (\n author.posts.map(\n (post) => post && <PostPreview key={post.slug} post={post} />\n )\n ) : (\n <div className=\"text-muted-foreground col-span-full\">\n No posts yet.\n </div>\n )}\n </div>\n </div>\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBI;AAhBJ,mBAAkB;AAClB,wBAA6B;AAC7B,0BAA4B;AAC5B,0BAA4B;AAC5B,qBAAqD;AACrD,IAAAA,kBAAuC;AAEhC,MAAM,aAAa,CAAC;AAAA,EACzB;AACF,MAKM;AACJ,SACE,4EACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,UACL;AAAA,YACE,mBAAmB;AAAA,YACnB,MAAM;AAAA,UACR;AAAA,UACA;AAAA,YACE,mBAAmB,WAAW,OAAO,IAAI;AAAA,YACzC,MAAM,OAAO;AAAA,UACf;AAAA,QACF;AAAA;AAAA,IACF;AAAA,IACA,4CAAC,+BAAa,aAAS,wCAAuB,MAAM,GAAG;AAAA,IAEvD,6CAAC,SAAI,WAAU,gCACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,aAAa;AAAA,YACX;AAAA,cACE,MAAM;AAAA,cACN,KAAK,GAAG,+BAAa,UAAU;AAAA,YACjC;AAAA,UACF;AAAA;AAAA,MACF;AAAA,MAEA,6CAAC,SAAI,WAAU,iCACZ;AAAA,eAAO,MAAM,WACZ;AAAA,UAAC,aAAAC;AAAA,UAAA;AAAA,YACC,aAAa,+BAAa;AAAA,YAC1B,KAAK,GAAG,+BAAa,YAAY,IAAI,OAAO,MAAM,OAAO;AAAA,YACzD,KAAK,OAAO,MAAM,OAAO,OAAO;AAAA,YAChC,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,WAAU;AAAA;AAAA,QACZ;AAAA,QAEF,6CAAC,SACC;AAAA,sDAAC,QAAG,WAAU,2BAA2B,iBAAO,MAAK;AAAA,UACpD,OAAO,OACN,4CAAC,OAAE,WAAU,6CACV,iBAAO,KACV;AAAA,WAEJ;AAAA,SACF;AAAA,MAGA,6CAAC,QAAG,WAAU,8BAA6B;AAAA;AAAA,QAAU,OAAO;AAAA,SAAK;AAAA,MACjE,4CAAC,SAAI,WAAU,wDACZ,iBAAO,SAAS,OAAO,MAAM,SAAS,IACrC,OAAO,MAAM;AAAA,QACX,CAAC,SAAS,QAAQ,4CAAC,mCAA4B,QAAX,KAAK,IAAkB;AAAA,MAC7D,IAEA,4CAAC,SAAI,WAAU,uCAAsC,2BAErD,GAEJ;AAAA,OACF;AAAA,KACF;AAEJ;","names":["import_json_ld","Image"]}
|
|
@@ -3,34 +3,28 @@ import Image from "next/image";
|
|
|
3
3
|
import { opinlyConfig } from "../../utils/sdk-config";
|
|
4
4
|
import { PostPreview } from "../post-preview";
|
|
5
5
|
import { BreadCrumbs } from "../bread-crumbs";
|
|
6
|
-
import {
|
|
6
|
+
import { OpinlyBreadCrumbJsonLd, OpinlyJSONLD } from "../json-ld";
|
|
7
|
+
import { genPersonPostingJSONLD } from "./_helpers/json-ld";
|
|
7
8
|
const AuthorPage = ({
|
|
8
9
|
author
|
|
9
10
|
}) => {
|
|
10
11
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11
12
|
/* @__PURE__ */ jsx(
|
|
12
|
-
|
|
13
|
+
OpinlyBreadCrumbJsonLd,
|
|
13
14
|
{
|
|
14
|
-
|
|
15
|
-
itemListElements: [
|
|
15
|
+
items: [
|
|
16
16
|
{
|
|
17
|
-
|
|
18
|
-
name:
|
|
19
|
-
item: opinlyConfig.siteUrl
|
|
17
|
+
slugNoPrefixSlash: "authors",
|
|
18
|
+
name: "Authors"
|
|
20
19
|
},
|
|
21
20
|
{
|
|
22
|
-
|
|
23
|
-
name:
|
|
24
|
-
item: opinlyConfig.blogUrl
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
position: 3,
|
|
28
|
-
name: "Authors",
|
|
29
|
-
item: `${opinlyConfig.blogPrefix}/authors`
|
|
21
|
+
slugNoPrefixSlash: `authors/${author.slug}`,
|
|
22
|
+
name: author.name
|
|
30
23
|
}
|
|
31
24
|
]
|
|
32
25
|
}
|
|
33
26
|
),
|
|
27
|
+
/* @__PURE__ */ jsx(OpinlyJSONLD, { content: genPersonPostingJSONLD(author) }),
|
|
34
28
|
/* @__PURE__ */ jsxs("div", { className: "max-w-5xl mx-auto px-4 py-10", children: [
|
|
35
29
|
/* @__PURE__ */ jsx(
|
|
36
30
|
BreadCrumbs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/author-page/index.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport Image from \"next/image\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\nimport { PostPreview } from \"../post-preview\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/components/author-page/index.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport Image from \"next/image\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\nimport { PostPreview } from \"../post-preview\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\nimport { OpinlyBreadCrumbJsonLd, OpinlyJSONLD } from \"../json-ld\";\nimport { genPersonPostingJSONLD } from \"./_helpers/json-ld\";\n\nexport const AuthorPage = ({\n author,\n}: {\n author: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"author\" }\n >[\"data\"];\n}) => {\n return (\n <>\n <OpinlyBreadCrumbJsonLd\n items={[\n {\n slugNoPrefixSlash: \"authors\",\n name: \"Authors\",\n },\n {\n slugNoPrefixSlash: `authors/${author.slug}`,\n name: author.name,\n },\n ]}\n />\n <OpinlyJSONLD content={genPersonPostingJSONLD(author)} />\n\n <div className=\"max-w-5xl mx-auto px-4 py-10\">\n <BreadCrumbs\n breadcrumbs={[\n {\n name: \"Authors\",\n url: `${opinlyConfig.blogPrefix}/authors`,\n },\n ]}\n />\n {/* Author Header */}\n <div className=\"flex items-center gap-6 mb-10\">\n {author.image.fileKey && (\n <Image\n unoptimized={opinlyConfig.unoptimizedImages}\n src={`${opinlyConfig.imagesPrefix}/${author.image.fileKey}`}\n alt={author.image.alt || author.name}\n width={150}\n height={150}\n className=\"rounded-full border\"\n />\n )}\n <div>\n <h1 className=\"text-3xl font-bold mb-1\">{author.name}</h1>\n {author.bio && (\n <p className=\"text-muted-foreground text-base max-w-2xl\">\n {author.bio}\n </p>\n )}\n </div>\n </div>\n\n {/* Posts Grid */}\n <h2 className=\"text-xl font-semibold mb-6\">Posts by {author.name}</h2>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-8\">\n {author.posts && author.posts.length > 0 ? (\n author.posts.map(\n (post) => post && <PostPreview key={post.slug} post={post} />\n )\n ) : (\n <div className=\"text-muted-foreground col-span-full\">\n No posts yet.\n </div>\n )}\n </div>\n </div>\n </>\n );\n};\n"],"mappings":"AAiBI,mBACE,KAmCI,YApCN;AAhBJ,OAAO,WAAW;AAClB,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,wBAAwB,oBAAoB;AACrD,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;AAAA,YACnB,MAAM;AAAA,UACR;AAAA,UACA;AAAA,YACE,mBAAmB,WAAW,OAAO,IAAI;AAAA,YACzC,MAAM,OAAO;AAAA,UACf;AAAA,QACF;AAAA;AAAA,IACF;AAAA,IACA,oBAAC,gBAAa,SAAS,uBAAuB,MAAM,GAAG;AAAA,IAEvD,qBAAC,SAAI,WAAU,gCACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,aAAa;AAAA,YACX;AAAA,cACE,MAAM;AAAA,cACN,KAAK,GAAG,aAAa,UAAU;AAAA,YACjC;AAAA,UACF;AAAA;AAAA,MACF;AAAA,MAEA,qBAAC,SAAI,WAAU,iCACZ;AAAA,eAAO,MAAM,WACZ;AAAA,UAAC;AAAA;AAAA,YACC,aAAa,aAAa;AAAA,YAC1B,KAAK,GAAG,aAAa,YAAY,IAAI,OAAO,MAAM,OAAO;AAAA,YACzD,KAAK,OAAO,MAAM,OAAO,OAAO;AAAA,YAChC,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,WAAU;AAAA;AAAA,QACZ;AAAA,QAEF,qBAAC,SACC;AAAA,8BAAC,QAAG,WAAU,2BAA2B,iBAAO,MAAK;AAAA,UACpD,OAAO,OACN,oBAAC,OAAE,WAAU,6CACV,iBAAO,KACV;AAAA,WAEJ;AAAA,SACF;AAAA,MAGA,qBAAC,QAAG,WAAU,8BAA6B;AAAA;AAAA,QAAU,OAAO;AAAA,SAAK;AAAA,MACjE,oBAAC,SAAI,WAAU,wDACZ,iBAAO,SAAS,OAAO,MAAM,SAAS,IACrC,OAAO,MAAM;AAAA,QACX,CAAC,SAAS,QAAQ,oBAAC,eAA4B,QAAX,KAAK,IAAkB;AAAA,MAC7D,IAEA,oBAAC,SAAI,WAAU,uCAAsC,2BAErD,GAEJ;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
authorCollectionJSONLD: () => authorCollectionJSONLD
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(json_ld_exports);
|
|
24
|
+
var import_sdk_config = require("../../../utils/sdk-config");
|
|
25
|
+
const authorCollectionJSONLD = (authors) => {
|
|
26
|
+
const jsonLD = {
|
|
27
|
+
"@context": "https://schema.org",
|
|
28
|
+
"@type": "CollectionPage",
|
|
29
|
+
name: "Authors",
|
|
30
|
+
description: `Meet the authors of the ${import_sdk_config.opinlyConfig.siteName} blog`,
|
|
31
|
+
url: `${import_sdk_config.opinlyConfig.blogUrl}/authors`,
|
|
32
|
+
publisher: {
|
|
33
|
+
"@type": "Organization",
|
|
34
|
+
name: import_sdk_config.opinlyConfig.siteName
|
|
35
|
+
},
|
|
36
|
+
mainEntity: authors.map((author) => ({
|
|
37
|
+
"@type": "Person",
|
|
38
|
+
name: author.name,
|
|
39
|
+
url: `${import_sdk_config.opinlyConfig.blogUrl}/authors/${author.slug}`,
|
|
40
|
+
image: author.image?.fileKey ? {
|
|
41
|
+
"@type": "ImageObject",
|
|
42
|
+
url: `${import_sdk_config.opinlyConfig.imagesUrl}/${author.image.fileKey}`
|
|
43
|
+
} : void 0,
|
|
44
|
+
description: author.bio || void 0
|
|
45
|
+
}))
|
|
46
|
+
};
|
|
47
|
+
return JSON.stringify(jsonLD);
|
|
48
|
+
};
|
|
49
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
+
0 && (module.exports = {
|
|
51
|
+
authorCollectionJSONLD
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=json-ld.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/authors-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 AuthorRes = Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"authors\" }\n>[\"data\"];\n\nexport const authorCollectionJSONLD = (authors: AuthorRes) => {\n const jsonLD: WithContext<CollectionPage> = {\n \"@context\": \"https://schema.org\",\n \"@type\": \"CollectionPage\",\n name: \"Authors\",\n description: `Meet the authors of the ${opinlyConfig.siteName} blog`,\n url: `${opinlyConfig.blogUrl}/authors`,\n publisher: {\n \"@type\": \"Organization\",\n name: opinlyConfig.siteName,\n },\n mainEntity: authors.map((author) => ({\n \"@type\": \"Person\",\n name: author.name,\n url: `${opinlyConfig.blogUrl}/authors/${author.slug}`,\n image: author.image?.fileKey\n ? {\n \"@type\": \"ImageObject\",\n url: `${opinlyConfig.imagesUrl}/${author.image.fileKey}`,\n }\n : undefined,\n description: author.bio || undefined,\n })),\n };\n\n return JSON.stringify(jsonLD);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,wBAA6B;AAOtB,MAAM,yBAAyB,CAAC,YAAuB;AAC5D,QAAM,SAAsC;AAAA,IAC1C,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,MAAM;AAAA,IACN,aAAa,2BAA2B,+BAAa,QAAQ;AAAA,IAC7D,KAAK,GAAG,+BAAa,OAAO;AAAA,IAC5B,WAAW;AAAA,MACT,SAAS;AAAA,MACT,MAAM,+BAAa;AAAA,IACrB;AAAA,IACA,YAAY,QAAQ,IAAI,CAAC,YAAY;AAAA,MACnC,SAAS;AAAA,MACT,MAAM,OAAO;AAAA,MACb,KAAK,GAAG,+BAAa,OAAO,YAAY,OAAO,IAAI;AAAA,MACnD,OAAO,OAAO,OAAO,UACjB;AAAA,QACE,SAAS;AAAA,QACT,KAAK,GAAG,+BAAa,SAAS,IAAI,OAAO,MAAM,OAAO;AAAA,MACxD,IACA;AAAA,MACJ,aAAa,OAAO,OAAO;AAAA,IAC7B,EAAE;AAAA,EACJ;AAEA,SAAO,KAAK,UAAU,MAAM;AAC9B;","names":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { opinlyConfig } from "../../../utils/sdk-config";
|
|
2
|
+
const authorCollectionJSONLD = (authors) => {
|
|
3
|
+
const jsonLD = {
|
|
4
|
+
"@context": "https://schema.org",
|
|
5
|
+
"@type": "CollectionPage",
|
|
6
|
+
name: "Authors",
|
|
7
|
+
description: `Meet the authors of the ${opinlyConfig.siteName} blog`,
|
|
8
|
+
url: `${opinlyConfig.blogUrl}/authors`,
|
|
9
|
+
publisher: {
|
|
10
|
+
"@type": "Organization",
|
|
11
|
+
name: opinlyConfig.siteName
|
|
12
|
+
},
|
|
13
|
+
mainEntity: authors.map((author) => ({
|
|
14
|
+
"@type": "Person",
|
|
15
|
+
name: author.name,
|
|
16
|
+
url: `${opinlyConfig.blogUrl}/authors/${author.slug}`,
|
|
17
|
+
image: author.image?.fileKey ? {
|
|
18
|
+
"@type": "ImageObject",
|
|
19
|
+
url: `${opinlyConfig.imagesUrl}/${author.image.fileKey}`
|
|
20
|
+
} : void 0,
|
|
21
|
+
description: author.bio || void 0
|
|
22
|
+
}))
|
|
23
|
+
};
|
|
24
|
+
return JSON.stringify(jsonLD);
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
authorCollectionJSONLD
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=json-ld.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/authors-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 AuthorRes = Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"authors\" }\n>[\"data\"];\n\nexport const authorCollectionJSONLD = (authors: AuthorRes) => {\n const jsonLD: WithContext<CollectionPage> = {\n \"@context\": \"https://schema.org\",\n \"@type\": \"CollectionPage\",\n name: \"Authors\",\n description: `Meet the authors of the ${opinlyConfig.siteName} blog`,\n url: `${opinlyConfig.blogUrl}/authors`,\n publisher: {\n \"@type\": \"Organization\",\n name: opinlyConfig.siteName,\n },\n mainEntity: authors.map((author) => ({\n \"@type\": \"Person\",\n name: author.name,\n url: `${opinlyConfig.blogUrl}/authors/${author.slug}`,\n image: author.image?.fileKey\n ? {\n \"@type\": \"ImageObject\",\n url: `${opinlyConfig.imagesUrl}/${author.image.fileKey}`,\n }\n : undefined,\n description: author.bio || undefined,\n })),\n };\n\n return JSON.stringify(jsonLD);\n};\n"],"mappings":"AAEA,SAAS,oBAAoB;AAOtB,MAAM,yBAAyB,CAAC,YAAuB;AAC5D,QAAM,SAAsC;AAAA,IAC1C,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,MAAM;AAAA,IACN,aAAa,2BAA2B,aAAa,QAAQ;AAAA,IAC7D,KAAK,GAAG,aAAa,OAAO;AAAA,IAC5B,WAAW;AAAA,MACT,SAAS;AAAA,MACT,MAAM,aAAa;AAAA,IACrB;AAAA,IACA,YAAY,QAAQ,IAAI,CAAC,YAAY;AAAA,MACnC,SAAS;AAAA,MACT,MAAM,OAAO;AAAA,MACb,KAAK,GAAG,aAAa,OAAO,YAAY,OAAO,IAAI;AAAA,MACnD,OAAO,OAAO,OAAO,UACjB;AAAA,QACE,SAAS;AAAA,QACT,KAAK,GAAG,aAAa,SAAS,IAAI,OAAO,MAAM,OAAO;AAAA,MACxD,IACA;AAAA,MACJ,aAAa,OAAO,OAAO;AAAA,IAC7B,EAAE;AAAA,EACJ;AAEA,SAAO,KAAK,UAAU,MAAM;AAC9B;","names":[]}
|
|
@@ -37,65 +37,81 @@ var import_sdk_config = require("../../utils/sdk-config");
|
|
|
37
37
|
var import_post_preview = require("../post-preview");
|
|
38
38
|
var import_bread_crumbs = require("../bread-crumbs");
|
|
39
39
|
var import_link = __toESM(require("next/link"), 1);
|
|
40
|
+
var import_json_ld = require("../json-ld");
|
|
41
|
+
var import_json_ld2 = require("./_helpers/json-ld");
|
|
40
42
|
const AuthorsPage = ({
|
|
41
43
|
authors
|
|
42
44
|
}) => {
|
|
43
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
45
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
46
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_json_ld.OpinlyJSONLD, { content: (0, import_json_ld2.authorCollectionJSONLD)(authors) }),
|
|
44
47
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
45
|
-
|
|
48
|
+
import_json_ld.OpinlyBreadCrumbJsonLd,
|
|
46
49
|
{
|
|
47
|
-
|
|
50
|
+
items: [
|
|
48
51
|
{
|
|
52
|
+
slugNoPrefixSlash: "authors",
|
|
49
53
|
name: "Authors"
|
|
50
54
|
}
|
|
51
55
|
]
|
|
52
56
|
}
|
|
53
57
|
),
|
|
54
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
58
|
-
"div",
|
|
58
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "max-w-5xl mx-auto px-4 py-10", children: [
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
60
|
+
import_bread_crumbs.BreadCrumbs,
|
|
59
61
|
{
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
62
|
+
breadcrumbs: [
|
|
63
|
+
{
|
|
64
|
+
name: "Authors"
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "text-3xl font-bold mb-10", children: "Authors" }),
|
|
70
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "space-y-16", children: authors.map((author, idx) => {
|
|
71
|
+
const authorSlug = `${import_sdk_config.opinlyConfig.blogPrefix}/authors/${author.slug}`;
|
|
72
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
className: "rounded-lg p-6 flex flex-col gap-6",
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-6 mb-4", children: [
|
|
78
|
+
author.image?.fileKey && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: authorSlug, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
79
|
+
import_image.default,
|
|
80
|
+
{
|
|
81
|
+
src: `${import_sdk_config.opinlyConfig.imagesPrefix}/${author.image.fileKey}`,
|
|
82
|
+
alt: author.image.alt || author.name,
|
|
83
|
+
width: 100,
|
|
84
|
+
height: 100,
|
|
85
|
+
className: "rounded-full border"
|
|
86
|
+
}
|
|
87
|
+
) }),
|
|
88
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
89
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: authorSlug, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-2xl font-semibold mb-1", children: author.name }) }),
|
|
90
|
+
author.bio && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-muted-foreground text-base max-w-2xl", children: author.bio })
|
|
91
|
+
] })
|
|
92
|
+
] }),
|
|
73
93
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
74
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
75
|
-
|
|
94
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 mb-4", children: author.posts && author.posts.length > 0 ? author.posts.map(
|
|
95
|
+
(post) => post && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_preview.PostPreview, { post }, post.slug)
|
|
96
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-muted-foreground col-span-full", children: "No posts yet." }) }),
|
|
97
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
98
|
+
import_link.default,
|
|
99
|
+
{
|
|
100
|
+
href: `${import_sdk_config.opinlyConfig.blogPrefix}/authors/${author.slug}`,
|
|
101
|
+
className: "text-bold",
|
|
102
|
+
children: [
|
|
103
|
+
"View more posts from ",
|
|
104
|
+
author.name
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
) })
|
|
76
108
|
] })
|
|
77
|
-
]
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
import_link.default,
|
|
84
|
-
{
|
|
85
|
-
href: `${import_sdk_config.opinlyConfig.blogPrefix}/authors/${author.slug}`,
|
|
86
|
-
className: "text-bold",
|
|
87
|
-
children: [
|
|
88
|
-
"View more posts from ",
|
|
89
|
-
author.name
|
|
90
|
-
]
|
|
91
|
-
}
|
|
92
|
-
) })
|
|
93
|
-
] })
|
|
94
|
-
]
|
|
95
|
-
},
|
|
96
|
-
author.name + idx
|
|
97
|
-
);
|
|
98
|
-
}) })
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
author.name + idx
|
|
112
|
+
);
|
|
113
|
+
}) })
|
|
114
|
+
] })
|
|
99
115
|
] });
|
|
100
116
|
};
|
|
101
117
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/authors-page/index.tsx"],"sourcesContent":["import type { Opinly } from \"@opinly/backend\";\nimport Image from \"next/image\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\n\nimport { PostPreview } from \"../post-preview\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\nimport Link from \"next/link\";\n\nexport const AuthorsPage = ({\n authors,\n}: {\n authors: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"authors\" }\n >[\"data\"];\n}) => {\n return (\n <div className=\"max-w-5xl mx-auto px-4 py-10\">\n
|
|
1
|
+
{"version":3,"sources":["../../../src/components/authors-page/index.tsx"],"sourcesContent":["import type { Opinly } from \"@opinly/backend\";\nimport Image from \"next/image\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\n\nimport { PostPreview } from \"../post-preview\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\nimport Link from \"next/link\";\nimport { OpinlyBreadCrumbJsonLd, OpinlyJSONLD } from \"../json-ld\";\nimport { authorCollectionJSONLD } from \"./_helpers/json-ld\";\n\nexport const AuthorsPage = ({\n authors,\n}: {\n authors: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"authors\" }\n >[\"data\"];\n}) => {\n return (\n <>\n <OpinlyJSONLD content={authorCollectionJSONLD(authors)} />\n <OpinlyBreadCrumbJsonLd\n items={[\n {\n slugNoPrefixSlash: \"authors\",\n name: \"Authors\",\n },\n ]}\n />\n <div className=\"max-w-5xl mx-auto px-4 py-10\">\n <BreadCrumbs\n breadcrumbs={[\n {\n name: \"Authors\",\n },\n ]}\n />\n <h1 className=\"text-3xl font-bold mb-10\">Authors</h1>\n <div className=\"space-y-16\">\n {authors.map((author, idx) => {\n const authorSlug = `${opinlyConfig.blogPrefix}/authors/${author.slug}`;\n\n return (\n <div\n key={author.name + idx}\n className=\"rounded-lg p-6 flex flex-col gap-6\"\n >\n <div className=\"flex items-center gap-6 mb-4\">\n {author.image?.fileKey && (\n <Link href={authorSlug}>\n <Image\n src={`${opinlyConfig.imagesPrefix}/${author.image.fileKey}`}\n alt={author.image.alt || author.name}\n width={100}\n height={100}\n className=\"rounded-full border\"\n />\n </Link>\n )}\n <div>\n <Link href={authorSlug}>\n <h2 className=\"text-2xl font-semibold mb-1\">\n {author.name}\n </h2>\n </Link>\n\n {author.bio && (\n <p className=\"text-muted-foreground text-base max-w-2xl\">\n {author.bio}\n </p>\n )}\n </div>\n </div>\n <div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 mb-4\">\n {author.posts && author.posts.length > 0 ? (\n author.posts.map(\n (post) =>\n post && <PostPreview key={post.slug} post={post} />\n )\n ) : (\n <div className=\"text-muted-foreground col-span-full\">\n No posts yet.\n </div>\n )}\n </div>\n <div className=\"flex justify-end\">\n <Link\n href={`${opinlyConfig.blogPrefix}/authors/${author.slug}`}\n className=\"text-bold\"\n >\n View more posts from {author.name}\n </Link>\n </div>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBI;AAlBJ,mBAAkB;AAClB,wBAA6B;AAE7B,0BAA4B;AAC5B,0BAA4B;AAC5B,kBAAiB;AACjB,qBAAqD;AACrD,IAAAA,kBAAuC;AAEhC,MAAM,cAAc,CAAC;AAAA,EAC1B;AACF,MAKM;AACJ,SACE,4EACE;AAAA,gDAAC,+BAAa,aAAS,wCAAuB,OAAO,GAAG;AAAA,IACxD;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,UACL;AAAA,YACE,mBAAmB;AAAA,YACnB,MAAM;AAAA,UACR;AAAA,QACF;AAAA;AAAA,IACF;AAAA,IACA,6CAAC,SAAI,WAAU,gCACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,aAAa;AAAA,YACX;AAAA,cACE,MAAM;AAAA,YACR;AAAA,UACF;AAAA;AAAA,MACF;AAAA,MACA,4CAAC,QAAG,WAAU,4BAA2B,qBAAO;AAAA,MAChD,4CAAC,SAAI,WAAU,cACZ,kBAAQ,IAAI,CAAC,QAAQ,QAAQ;AAC5B,cAAM,aAAa,GAAG,+BAAa,UAAU,YAAY,OAAO,IAAI;AAEpE,eACE;AAAA,UAAC;AAAA;AAAA,YAEC,WAAU;AAAA,YAEV;AAAA,2DAAC,SAAI,WAAU,gCACZ;AAAA,uBAAO,OAAO,WACb,4CAAC,YAAAC,SAAA,EAAK,MAAM,YACV;AAAA,kBAAC,aAAAC;AAAA,kBAAA;AAAA,oBACC,KAAK,GAAG,+BAAa,YAAY,IAAI,OAAO,MAAM,OAAO;AAAA,oBACzD,KAAK,OAAO,MAAM,OAAO,OAAO;AAAA,oBAChC,OAAO;AAAA,oBACP,QAAQ;AAAA,oBACR,WAAU;AAAA;AAAA,gBACZ,GACF;AAAA,gBAEF,6CAAC,SACC;AAAA,8DAAC,YAAAD,SAAA,EAAK,MAAM,YACV,sDAAC,QAAG,WAAU,+BACX,iBAAO,MACV,GACF;AAAA,kBAEC,OAAO,OACN,4CAAC,OAAE,WAAU,6CACV,iBAAO,KACV;AAAA,mBAEJ;AAAA,iBACF;AAAA,cACA,6CAAC,SACC;AAAA,4DAAC,SAAI,WAAU,6DACZ,iBAAO,SAAS,OAAO,MAAM,SAAS,IACrC,OAAO,MAAM;AAAA,kBACX,CAAC,SACC,QAAQ,4CAAC,mCAA4B,QAAX,KAAK,IAAkB;AAAA,gBACrD,IAEA,4CAAC,SAAI,WAAU,uCAAsC,2BAErD,GAEJ;AAAA,gBACA,4CAAC,SAAI,WAAU,oBACb;AAAA,kBAAC,YAAAA;AAAA,kBAAA;AAAA,oBACC,MAAM,GAAG,+BAAa,UAAU,YAAY,OAAO,IAAI;AAAA,oBACvD,WAAU;AAAA,oBACX;AAAA;AAAA,sBACuB,OAAO;AAAA;AAAA;AAAA,gBAC/B,GACF;AAAA,iBACF;AAAA;AAAA;AAAA,UAlDK,OAAO,OAAO;AAAA,QAmDrB;AAAA,MAEJ,CAAC,GACH;AAAA,OACF;AAAA,KACF;AAEJ;","names":["import_json_ld","Link","Image"]}
|