@opinly/next 0.1.18 → 0.1.20
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/blog-post/index.cjs +11 -10
- package/dist/components/blog-post/index.cjs.map +1 -1
- package/dist/components/blog-post/index.js +11 -10
- package/dist/components/blog-post/index.js.map +1 -1
- package/dist/components/home-page/folders.cjs +14 -1
- package/dist/components/home-page/folders.cjs.map +1 -1
- package/dist/components/home-page/folders.js +14 -1
- package/dist/components/home-page/folders.js.map +1 -1
- package/dist/components/home-page/top-posts.cjs +1 -1
- package/dist/components/home-page/top-posts.cjs.map +1 -1
- package/dist/components/home-page/top-posts.js +1 -1
- package/dist/components/home-page/top-posts.js.map +1 -1
- package/dist/components/post-preview.cjs +3 -1
- package/dist/components/post-preview.cjs.map +1 -1
- package/dist/components/post-preview.d.cts +2 -1
- package/dist/components/post-preview.d.ts +2 -1
- package/dist/components/post-preview.js +3 -1
- package/dist/components/post-preview.js.map +1 -1
- package/package.json +4 -4
|
@@ -84,7 +84,7 @@ const BlogPost = ({
|
|
|
84
84
|
}
|
|
85
85
|
),
|
|
86
86
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "max-w-7xl mx-auto px-4 py-24 flex items-start space-x-8", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col gap-12 w-full", children: [
|
|
87
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
87
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
88
88
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
89
89
|
import_bread_crumbs.BreadCrumbs,
|
|
90
90
|
{
|
|
@@ -97,9 +97,8 @@ const BlogPost = ({
|
|
|
97
97
|
}
|
|
98
98
|
),
|
|
99
99
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "text-op-heading text-4xl font-bold mb-2 leading-tight", children: post.title }),
|
|
100
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "text-sm mb-4 text-op-muted", children: [
|
|
100
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "text-sm mb-4 text-op-muted space-x-1", children: [
|
|
101
101
|
post.author && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
102
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Author:" }),
|
|
103
102
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
104
103
|
import_link.default,
|
|
105
104
|
{
|
|
@@ -111,22 +110,24 @@ const BlogPost = ({
|
|
|
111
110
|
" ",
|
|
112
111
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-op-muted", children: "\xB7" })
|
|
113
112
|
] }),
|
|
114
|
-
(0,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
|
|
114
|
+
(0, import_reading_time.calculateReadingTime)(content),
|
|
115
|
+
" min read ",
|
|
116
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "\xB7" })
|
|
117
|
+
] }),
|
|
118
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: (0, import_dates.formatDate)(post.firstPublishedAt) || "Today" })
|
|
118
119
|
] })
|
|
119
120
|
] }),
|
|
120
121
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
121
122
|
"div",
|
|
122
123
|
{
|
|
123
124
|
className: (0, import_merge.cn)(
|
|
124
|
-
"flex flex-col
|
|
125
|
-
"md:flex-row",
|
|
125
|
+
"flex md:space-x-12 flex-col mx-auto w-full",
|
|
126
|
+
"md:flex-row-reverse",
|
|
126
127
|
classNames.container
|
|
127
128
|
),
|
|
128
129
|
children: [
|
|
129
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("article", { className: "w-full md:w-3/4 order-2
|
|
130
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("article", { className: "w-full md:w-3/4 order-2 md:order-1 flex items-start", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "prose w-full ", children: [
|
|
130
131
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_content.Content, { content, classNames }),
|
|
131
132
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_faq.FAQS, { faqs: post.faqs })
|
|
132
133
|
] }) }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/blog-post/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { JSONContent } from \"@tiptap/core\";\nimport Link from \"next/link\";\nimport { cn } from \"../../utils/merge\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\nimport { BlogPostRes } from \"./_types/blog-post\";\nimport {\n genBlogPostingJSONLD,\n genBreadcrumbJSONLD,\n genFaqJSONLD,\n} from \"./_helpers/json-ld\";\nimport { BlogComponentClassNames } from \"./_types/class-names\";\nimport { FAQS } from \"./_components/faq\";\nimport { calculateReadingTime } from \"./_helpers/reading-time\";\nimport { Content } from \"./_components/content\";\nimport { TableOfContents } from \"./_components/table-of-contents\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\nimport { formatDate } from \"../../utils/dates\";\nimport Script from \"next/script\";\n\nexport const BlogPost = ({\n post,\n classNames = {},\n}: {\n post: BlogPostRes;\n classNames?: BlogComponentClassNames;\n notFoundComponent?: React.ReactNode;\n}) => {\n const content = post.content as JSONContent;\n\n console.log(\"is app router\", !opinlyConfig.pagesRouter);\n\n return (\n <>\n {post.faqs && (\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genFaqJSONLD(post.faqs)).replace(\n /</g,\n \"\\\\u003c\"\n ),\n }}\n />\n )}\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genBlogPostingJSONLD(post)),\n }}\n />\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genBreadcrumbJSONLD(post)),\n }}\n />\n <div className=\"max-w-7xl mx-auto px-4 py-24 flex items-start space-x-8\">\n <div className=\"flex flex-col gap-12 w-full\">\n <div
|
|
1
|
+
{"version":3,"sources":["../../../src/components/blog-post/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { JSONContent } from \"@tiptap/core\";\nimport Link from \"next/link\";\nimport { cn } from \"../../utils/merge\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\nimport { BlogPostRes } from \"./_types/blog-post\";\nimport {\n genBlogPostingJSONLD,\n genBreadcrumbJSONLD,\n genFaqJSONLD,\n} from \"./_helpers/json-ld\";\nimport { BlogComponentClassNames } from \"./_types/class-names\";\nimport { FAQS } from \"./_components/faq\";\nimport { calculateReadingTime } from \"./_helpers/reading-time\";\nimport { Content } from \"./_components/content\";\nimport { TableOfContents } from \"./_components/table-of-contents\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\nimport { formatDate } from \"../../utils/dates\";\nimport Script from \"next/script\";\n\nexport const BlogPost = ({\n post,\n classNames = {},\n}: {\n post: BlogPostRes;\n classNames?: BlogComponentClassNames;\n notFoundComponent?: React.ReactNode;\n}) => {\n const content = post.content as JSONContent;\n\n console.log(\"is app router\", !opinlyConfig.pagesRouter);\n\n return (\n <>\n {post.faqs && (\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genFaqJSONLD(post.faqs)).replace(\n /</g,\n \"\\\\u003c\"\n ),\n }}\n />\n )}\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genBlogPostingJSONLD(post)),\n }}\n />\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genBreadcrumbJSONLD(post)),\n }}\n />\n <div className=\"max-w-7xl mx-auto px-4 py-24 flex items-start space-x-8\">\n <div className=\"flex flex-col gap-12 w-full\">\n <div>\n <BreadCrumbs\n breadcrumbs={[\n post.folder && {\n url: `${opinlyConfig.blogPrefix}/${post.folder.slug}`,\n name: post.folder.name,\n },\n ]}\n />\n\n <h1 className=\"text-op-heading text-4xl font-bold mb-2 leading-tight\">\n {post.title}\n </h1>\n <div className=\"text-sm mb-4 text-op-muted space-x-1\">\n {post.author && (\n <>\n <Link\n href={`${opinlyConfig.blogPrefix}/authors/${post.author?.slug}`}\n className=\"font-medium\"\n >\n {post.author?.name}\n </Link>{\" \"}\n <span className=\"text-op-muted\">·</span>\n </>\n )}\n <span>\n {calculateReadingTime(content)} min read <span>·</span>\n </span>\n <span>\n {formatDate(post.firstPublishedAt as string) || \"Today\"}\n </span>\n </div>\n </div>\n\n <div\n className={cn(\n \"flex md:space-x-12 flex-col mx-auto w-full\",\n \"md:flex-row-reverse\",\n classNames.container\n )}\n >\n <article className=\"w-full md:w-3/4 order-2 md:order-1 flex items-start\">\n <div className=\"prose w-full \">\n <Content content={content} classNames={classNames} />\n <FAQS faqs={post.faqs} />\n </div>\n </article>\n <div className=\"flex md:w-1/4 md:sticky md:top-20\">\n <TableOfContents\n content={content}\n author={post.author}\n post={post}\n />\n </div>\n </div>\n </div>\n </div>\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmCQ;AAjCR,kBAAiB;AACjB,mBAAmB;AACnB,wBAA6B;AAE7B,qBAIO;AAEP,iBAAqB;AACrB,0BAAqC;AACrC,qBAAwB;AACxB,+BAAgC;AAChC,0BAA4B;AAC5B,mBAA2B;AAC3B,oBAAmB;AAEZ,MAAM,WAAW,CAAC;AAAA,EACvB;AAAA,EACA,aAAa,CAAC;AAChB,MAIM;AACJ,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ACR,4CAAC,UAAK,WAAU,iBAAgB,kBAAC;AAAA,aACnC;AAAA,UAEF,6CAAC,UACE;AAAA,0DAAqB,OAAO;AAAA,YAAE;AAAA,YAAU,4CAAC,UAAK,kBAAC;AAAA,aAClD;AAAA,UACA,4CAAC,UACE,uCAAW,KAAK,gBAA0B,KAAK,SAClD;AAAA,WACF;AAAA,SACF;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,eAAW;AAAA,YACT;AAAA,YACA;AAAA,YACA,WAAW;AAAA,UACb;AAAA,UAEA;AAAA,wDAAC,aAAQ,WAAU,uDACjB,uDAAC,SAAI,WAAU,iBACb;AAAA,0DAAC,0BAAQ,SAAkB,YAAwB;AAAA,cACnD,4CAAC,mBAAK,MAAM,KAAK,MAAM;AAAA,eACzB,GACF;AAAA,YACA,4CAAC,SAAI,WAAU,qCACb;AAAA,cAAC;AAAA;AAAA,gBACC;AAAA,gBACA,QAAQ,KAAK;AAAA,gBACb;AAAA;AAAA,YACF,GACF;AAAA;AAAA;AAAA,MACF;AAAA,OACF,GACF;AAAA,KACF;AAEJ;","names":["Script","Link"]}
|
|
@@ -55,7 +55,7 @@ const BlogPost = ({
|
|
|
55
55
|
}
|
|
56
56
|
),
|
|
57
57
|
/* @__PURE__ */ jsx("div", { className: "max-w-7xl mx-auto px-4 py-24 flex items-start space-x-8", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-12 w-full", children: [
|
|
58
|
-
/* @__PURE__ */ jsxs("div", {
|
|
58
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
59
59
|
/* @__PURE__ */ jsx(
|
|
60
60
|
BreadCrumbs,
|
|
61
61
|
{
|
|
@@ -68,9 +68,8 @@ const BlogPost = ({
|
|
|
68
68
|
}
|
|
69
69
|
),
|
|
70
70
|
/* @__PURE__ */ jsx("h1", { className: "text-op-heading text-4xl font-bold mb-2 leading-tight", children: post.title }),
|
|
71
|
-
/* @__PURE__ */ jsxs("div", { className: "text-sm mb-4 text-op-muted", children: [
|
|
71
|
+
/* @__PURE__ */ jsxs("div", { className: "text-sm mb-4 text-op-muted space-x-1", children: [
|
|
72
72
|
post.author && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
73
|
-
/* @__PURE__ */ jsx("span", { children: "Author:" }),
|
|
74
73
|
/* @__PURE__ */ jsx(
|
|
75
74
|
Link,
|
|
76
75
|
{
|
|
@@ -82,22 +81,24 @@ const BlogPost = ({
|
|
|
82
81
|
" ",
|
|
83
82
|
/* @__PURE__ */ jsx("span", { className: "text-op-muted", children: "\xB7" })
|
|
84
83
|
] }),
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
85
|
+
calculateReadingTime(content),
|
|
86
|
+
" min read ",
|
|
87
|
+
/* @__PURE__ */ jsx("span", { children: "\xB7" })
|
|
88
|
+
] }),
|
|
89
|
+
/* @__PURE__ */ jsx("span", { children: formatDate(post.firstPublishedAt) || "Today" })
|
|
89
90
|
] })
|
|
90
91
|
] }),
|
|
91
92
|
/* @__PURE__ */ jsxs(
|
|
92
93
|
"div",
|
|
93
94
|
{
|
|
94
95
|
className: cn(
|
|
95
|
-
"flex flex-col
|
|
96
|
-
"md:flex-row",
|
|
96
|
+
"flex md:space-x-12 flex-col mx-auto w-full",
|
|
97
|
+
"md:flex-row-reverse",
|
|
97
98
|
classNames.container
|
|
98
99
|
),
|
|
99
100
|
children: [
|
|
100
|
-
/* @__PURE__ */ jsx("article", { className: "w-full md:w-3/4 order-2
|
|
101
|
+
/* @__PURE__ */ jsx("article", { className: "w-full md:w-3/4 order-2 md:order-1 flex items-start", children: /* @__PURE__ */ jsxs("div", { className: "prose w-full ", children: [
|
|
101
102
|
/* @__PURE__ */ jsx(Content, { content, classNames }),
|
|
102
103
|
/* @__PURE__ */ jsx(FAQS, { faqs: post.faqs })
|
|
103
104
|
] }) }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/blog-post/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { JSONContent } from \"@tiptap/core\";\nimport Link from \"next/link\";\nimport { cn } from \"../../utils/merge\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\nimport { BlogPostRes } from \"./_types/blog-post\";\nimport {\n genBlogPostingJSONLD,\n genBreadcrumbJSONLD,\n genFaqJSONLD,\n} from \"./_helpers/json-ld\";\nimport { BlogComponentClassNames } from \"./_types/class-names\";\nimport { FAQS } from \"./_components/faq\";\nimport { calculateReadingTime } from \"./_helpers/reading-time\";\nimport { Content } from \"./_components/content\";\nimport { TableOfContents } from \"./_components/table-of-contents\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\nimport { formatDate } from \"../../utils/dates\";\nimport Script from \"next/script\";\n\nexport const BlogPost = ({\n post,\n classNames = {},\n}: {\n post: BlogPostRes;\n classNames?: BlogComponentClassNames;\n notFoundComponent?: React.ReactNode;\n}) => {\n const content = post.content as JSONContent;\n\n console.log(\"is app router\", !opinlyConfig.pagesRouter);\n\n return (\n <>\n {post.faqs && (\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genFaqJSONLD(post.faqs)).replace(\n /</g,\n \"\\\\u003c\"\n ),\n }}\n />\n )}\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genBlogPostingJSONLD(post)),\n }}\n />\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genBreadcrumbJSONLD(post)),\n }}\n />\n <div className=\"max-w-7xl mx-auto px-4 py-24 flex items-start space-x-8\">\n <div className=\"flex flex-col gap-12 w-full\">\n <div
|
|
1
|
+
{"version":3,"sources":["../../../src/components/blog-post/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { JSONContent } from \"@tiptap/core\";\nimport Link from \"next/link\";\nimport { cn } from \"../../utils/merge\";\nimport { opinlyConfig } from \"../../utils/sdk-config\";\nimport { BlogPostRes } from \"./_types/blog-post\";\nimport {\n genBlogPostingJSONLD,\n genBreadcrumbJSONLD,\n genFaqJSONLD,\n} from \"./_helpers/json-ld\";\nimport { BlogComponentClassNames } from \"./_types/class-names\";\nimport { FAQS } from \"./_components/faq\";\nimport { calculateReadingTime } from \"./_helpers/reading-time\";\nimport { Content } from \"./_components/content\";\nimport { TableOfContents } from \"./_components/table-of-contents\";\nimport { BreadCrumbs } from \"../bread-crumbs\";\nimport { formatDate } from \"../../utils/dates\";\nimport Script from \"next/script\";\n\nexport const BlogPost = ({\n post,\n classNames = {},\n}: {\n post: BlogPostRes;\n classNames?: BlogComponentClassNames;\n notFoundComponent?: React.ReactNode;\n}) => {\n const content = post.content as JSONContent;\n\n console.log(\"is app router\", !opinlyConfig.pagesRouter);\n\n return (\n <>\n {post.faqs && (\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genFaqJSONLD(post.faqs)).replace(\n /</g,\n \"\\\\u003c\"\n ),\n }}\n />\n )}\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genBlogPostingJSONLD(post)),\n }}\n />\n <Script\n strategy=\"beforeInteractive\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify(genBreadcrumbJSONLD(post)),\n }}\n />\n <div className=\"max-w-7xl mx-auto px-4 py-24 flex items-start space-x-8\">\n <div className=\"flex flex-col gap-12 w-full\">\n <div>\n <BreadCrumbs\n breadcrumbs={[\n post.folder && {\n url: `${opinlyConfig.blogPrefix}/${post.folder.slug}`,\n name: post.folder.name,\n },\n ]}\n />\n\n <h1 className=\"text-op-heading text-4xl font-bold mb-2 leading-tight\">\n {post.title}\n </h1>\n <div className=\"text-sm mb-4 text-op-muted space-x-1\">\n {post.author && (\n <>\n <Link\n href={`${opinlyConfig.blogPrefix}/authors/${post.author?.slug}`}\n className=\"font-medium\"\n >\n {post.author?.name}\n </Link>{\" \"}\n <span className=\"text-op-muted\">·</span>\n </>\n )}\n <span>\n {calculateReadingTime(content)} min read <span>·</span>\n </span>\n <span>\n {formatDate(post.firstPublishedAt as string) || \"Today\"}\n </span>\n </div>\n </div>\n\n <div\n className={cn(\n \"flex md:space-x-12 flex-col mx-auto w-full\",\n \"md:flex-row-reverse\",\n classNames.container\n )}\n >\n <article className=\"w-full md:w-3/4 order-2 md:order-1 flex items-start\">\n <div className=\"prose w-full \">\n <Content content={content} classNames={classNames} />\n <FAQS faqs={post.faqs} />\n </div>\n </article>\n <div className=\"flex md:w-1/4 md:sticky md:top-20\">\n <TableOfContents\n content={content}\n author={post.author}\n post={post}\n />\n </div>\n </div>\n </div>\n </div>\n </>\n );\n};\n"],"mappings":"AAmCQ,SA0CQ,UA1CR,KA0CQ,YA1CR;AAjCR,OAAO,UAAU;AACjB,SAAS,UAAU;AACnB,SAAS,oBAAoB;AAE7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,YAAY;AACrB,SAAS,4BAA4B;AACrC,SAAS,eAAe;AACxB,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAC3B,OAAO,YAAY;AAEZ,MAAM,WAAW,CAAC;AAAA,EACvB;AAAA,EACA,aAAa,CAAC;AAChB,MAIM;AACJ,QAAM,UAAU,KAAK;AAErB,UAAQ,IAAI,iBAAiB,CAAC,aAAa,WAAW;AAEtD,SACE,iCACG;AAAA,SAAK,QACJ;AAAA,MAAC;AAAA;AAAA,QACC,UAAS;AAAA,QACT,MAAK;AAAA,QACL,yBAAyB;AAAA,UACvB,QAAQ,KAAK,UAAU,aAAa,KAAK,IAAI,CAAC,EAAE;AAAA,YAC9C;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA;AAAA,IACF;AAAA,IAEF;AAAA,MAAC;AAAA;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I,WAAU,iBACb;AAAA,kCAAC,WAAQ,SAAkB,YAAwB;AAAA,cACnD,oBAAC,QAAK,MAAM,KAAK,MAAM;AAAA,eACzB,GACF;AAAA,YACA,oBAAC,SAAI,WAAU,qCACb;AAAA,cAAC;AAAA;AAAA,gBACC;AAAA,gBACA,QAAQ,KAAK;AAAA,gBACb;AAAA;AAAA,YACF,GACF;AAAA;AAAA;AAAA,MACF;AAAA,OACF,GACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -69,7 +69,20 @@ const HomePageFolders = ({
|
|
|
69
69
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-op-muted", children: folder.description })
|
|
70
70
|
] }),
|
|
71
71
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10 mb-20", children: [
|
|
72
|
-
folder.posts.filter((post) => post !== null).map((post) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
72
|
+
folder.posts.filter((post) => post !== null).map((post) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
73
|
+
import_post_preview.PostPreview,
|
|
74
|
+
{
|
|
75
|
+
post: {
|
|
76
|
+
...post,
|
|
77
|
+
folder: {
|
|
78
|
+
name: folder.title,
|
|
79
|
+
slug: folder.slug,
|
|
80
|
+
description: folder.description || ""
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
post.slug
|
|
85
|
+
)),
|
|
73
86
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex justify-center w-full h-full items-center ", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
74
87
|
import_link.default,
|
|
75
88
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/home-page/folders.tsx"],"sourcesContent":["import Link from \"next/link\";\nimport { PostPreview } from \"../post-preview\";\nimport { ArrowRight } from \"lucide-react\";\nimport { Opinly } from \"@opinly/backend\";\n\nexport const HomePageFoldersSkeleton = () => {\n return (\n <>\n {Array(2) // render 2 folder sections\n .fill(null)\n .map((_, sectionIdx) => (\n <div key={sectionIdx} className=\"space-y-4 mb-5\">\n {/* Folder title + description */}\n <div className=\"animate-pulse space-y-2\">\n <div className=\"h-8 w-1/3 bg-gray-200 dark:bg-gray-700 rounded\" />\n <div className=\"h-4 w-1/2 bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n\n {/* Posts grid */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10\">\n {Array(3) // 3 post placeholders\n .fill(null)\n .map((__, postIdx) => (\n <div key={postIdx} className=\"animate-pulse space-y-3\">\n {/* Image */}\n <div className=\"w-full h-48 bg-gray-200 dark:bg-gray-700 rounded-lg\" />\n {/* Title bar */}\n <div className=\"h-5 w-3/4 bg-gray-200 dark:bg-gray-700 rounded\" />\n {/* Description line */}\n <div className=\"h-4 w-full bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n ))}\n\n {/* “View all” link */}\n <div className=\"flex justify-center items-center animate-pulse\">\n <div className=\"h-4 w-48 bg-gray-200 text-op-heading rounded\" />\n </div>\n </div>\n </div>\n ))}\n </>\n );\n};\n\nexport const HomePageFolders = ({\n folders,\n}: {\n folders: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"home\" }\n >[\"data\"][\"folders\"];\n}) => {\n return (\n <div className=\"flex flex-col gap-10 mt-20\">\n {folders.map((folder) => (\n <div className=\"space-y-4\">\n <div className=\"flex flex-col gap-2 mb-20\">\n <Link\n key={folder.slug}\n href={`/blog/${folder.slug}`}\n className=\"text-3xl\"\n >\n {folder.title}\n </Link>\n <p className=\"text-sm text-op-muted\">{folder.description}</p>\n </div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10 mb-20\">\n {folder.posts\n .filter((post) => post !== null)\n .map((post) => (\n <PostPreview
|
|
1
|
+
{"version":3,"sources":["../../../src/components/home-page/folders.tsx"],"sourcesContent":["import Link from \"next/link\";\nimport { PostPreview } from \"../post-preview\";\nimport { ArrowRight } from \"lucide-react\";\nimport { Opinly } from \"@opinly/backend\";\n\nexport const HomePageFoldersSkeleton = () => {\n return (\n <>\n {Array(2) // render 2 folder sections\n .fill(null)\n .map((_, sectionIdx) => (\n <div key={sectionIdx} className=\"space-y-4 mb-5\">\n {/* Folder title + description */}\n <div className=\"animate-pulse space-y-2\">\n <div className=\"h-8 w-1/3 bg-gray-200 dark:bg-gray-700 rounded\" />\n <div className=\"h-4 w-1/2 bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n\n {/* Posts grid */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10\">\n {Array(3) // 3 post placeholders\n .fill(null)\n .map((__, postIdx) => (\n <div key={postIdx} className=\"animate-pulse space-y-3\">\n {/* Image */}\n <div className=\"w-full h-48 bg-gray-200 dark:bg-gray-700 rounded-lg\" />\n {/* Title bar */}\n <div className=\"h-5 w-3/4 bg-gray-200 dark:bg-gray-700 rounded\" />\n {/* Description line */}\n <div className=\"h-4 w-full bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n ))}\n\n {/* “View all” link */}\n <div className=\"flex justify-center items-center animate-pulse\">\n <div className=\"h-4 w-48 bg-gray-200 text-op-heading rounded\" />\n </div>\n </div>\n </div>\n ))}\n </>\n );\n};\n\nexport const HomePageFolders = ({\n folders,\n}: {\n folders: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"home\" }\n >[\"data\"][\"folders\"];\n}) => {\n return (\n <div className=\"flex flex-col gap-10 mt-20\">\n {folders.map((folder) => (\n <div className=\"space-y-4\">\n <div className=\"flex flex-col gap-2 mb-20\">\n <Link\n key={folder.slug}\n href={`/blog/${folder.slug}`}\n className=\"text-3xl\"\n >\n {folder.title}\n </Link>\n <p className=\"text-sm text-op-muted\">{folder.description}</p>\n </div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10 mb-20\">\n {folder.posts\n .filter((post) => post !== null)\n .map((post) => (\n <PostPreview\n key={post.slug}\n post={{\n ...post,\n folder: {\n name: folder.title,\n slug: folder.slug,\n description: folder.description || \"\",\n },\n }}\n />\n ))}\n <div className=\"flex justify-center w-full h-full items-center \">\n <Link\n href={`/blog/${folder.slug}`}\n className=\"flex items-center gap-2\"\n >\n <span>View all posts in {folder.title}</span>\n <ArrowRight className=\"w-4 h-4\" />\n </Link>\n </div>\n </div>\n </div>\n ))}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOI;AAPJ,kBAAiB;AACjB,0BAA4B;AAC5B,0BAA2B;AAGpB,MAAM,0BAA0B,MAAM;AAC3C,SACE,2EACG,gBAAM,CAAC,EACL,KAAK,IAAI,EACT,IAAI,CAAC,GAAG,eACP,6CAAC,SAAqB,WAAU,kBAE9B;AAAA,iDAAC,SAAI,WAAU,2BACb;AAAA,kDAAC,SAAI,WAAU,kDAAiD;AAAA,MAChE,4CAAC,SAAI,WAAU,kDAAiD;AAAA,OAClE;AAAA,IAGA,6CAAC,SAAI,WAAU,yDACZ;AAAA,YAAM,CAAC,EACL,KAAK,IAAI,EACT,IAAI,CAAC,IAAI,YACR,6CAAC,SAAkB,WAAU,2BAE3B;AAAA,oDAAC,SAAI,WAAU,uDAAsD;AAAA,QAErE,4CAAC,SAAI,WAAU,kDAAiD;AAAA,QAEhE,4CAAC,SAAI,WAAU,mDAAkD;AAAA,WANzD,OAOV,CACD;AAAA,MAGH,4CAAC,SAAI,WAAU,kDACb,sDAAC,SAAI,WAAU,gDAA+C,GAChE;AAAA,OACF;AAAA,OA1BQ,UA2BV,CACD,GACL;AAEJ;AAEO,MAAM,kBAAkB,CAAC;AAAA,EAC9B;AACF,MAKM;AACJ,SACE,4CAAC,SAAI,WAAU,8BACZ,kBAAQ,IAAI,CAAC,WACZ,6CAAC,SAAI,WAAU,aACb;AAAA,iDAAC,SAAI,WAAU,6BACb;AAAA;AAAA,QAAC,YAAAA;AAAA,QAAA;AAAA,UAEC,MAAM,SAAS,OAAO,IAAI;AAAA,UAC1B,WAAU;AAAA,UAET,iBAAO;AAAA;AAAA,QAJH,OAAO;AAAA,MAKd;AAAA,MACA,4CAAC,OAAE,WAAU,yBAAyB,iBAAO,aAAY;AAAA,OAC3D;AAAA,IACA,6CAAC,SAAI,WAAU,+DACZ;AAAA,aAAO,MACL,OAAO,CAAC,SAAS,SAAS,IAAI,EAC9B,IAAI,CAAC,SACJ;AAAA,QAAC;AAAA;AAAA,UAEC,MAAM;AAAA,YACJ,GAAG;AAAA,YACH,QAAQ;AAAA,cACN,MAAM,OAAO;AAAA,cACb,MAAM,OAAO;AAAA,cACb,aAAa,OAAO,eAAe;AAAA,YACrC;AAAA,UACF;AAAA;AAAA,QARK,KAAK;AAAA,MASZ,CACD;AAAA,MACH,4CAAC,SAAI,WAAU,mDACb;AAAA,QAAC,YAAAA;AAAA,QAAA;AAAA,UACC,MAAM,SAAS,OAAO,IAAI;AAAA,UAC1B,WAAU;AAAA,UAEV;AAAA,yDAAC,UAAK;AAAA;AAAA,cAAmB,OAAO;AAAA,eAAM;AAAA,YACtC,4CAAC,kCAAW,WAAU,WAAU;AAAA;AAAA;AAAA,MAClC,GACF;AAAA,OACF;AAAA,KACF,CACD,GACH;AAEJ;","names":["Link"]}
|
|
@@ -35,7 +35,20 @@ const HomePageFolders = ({
|
|
|
35
35
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-op-muted", children: folder.description })
|
|
36
36
|
] }),
|
|
37
37
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10 mb-20", children: [
|
|
38
|
-
folder.posts.filter((post) => post !== null).map((post) => /* @__PURE__ */ jsx(
|
|
38
|
+
folder.posts.filter((post) => post !== null).map((post) => /* @__PURE__ */ jsx(
|
|
39
|
+
PostPreview,
|
|
40
|
+
{
|
|
41
|
+
post: {
|
|
42
|
+
...post,
|
|
43
|
+
folder: {
|
|
44
|
+
name: folder.title,
|
|
45
|
+
slug: folder.slug,
|
|
46
|
+
description: folder.description || ""
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
post.slug
|
|
51
|
+
)),
|
|
39
52
|
/* @__PURE__ */ jsx("div", { className: "flex justify-center w-full h-full items-center ", children: /* @__PURE__ */ jsxs(
|
|
40
53
|
Link,
|
|
41
54
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/home-page/folders.tsx"],"sourcesContent":["import Link from \"next/link\";\nimport { PostPreview } from \"../post-preview\";\nimport { ArrowRight } from \"lucide-react\";\nimport { Opinly } from \"@opinly/backend\";\n\nexport const HomePageFoldersSkeleton = () => {\n return (\n <>\n {Array(2) // render 2 folder sections\n .fill(null)\n .map((_, sectionIdx) => (\n <div key={sectionIdx} className=\"space-y-4 mb-5\">\n {/* Folder title + description */}\n <div className=\"animate-pulse space-y-2\">\n <div className=\"h-8 w-1/3 bg-gray-200 dark:bg-gray-700 rounded\" />\n <div className=\"h-4 w-1/2 bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n\n {/* Posts grid */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10\">\n {Array(3) // 3 post placeholders\n .fill(null)\n .map((__, postIdx) => (\n <div key={postIdx} className=\"animate-pulse space-y-3\">\n {/* Image */}\n <div className=\"w-full h-48 bg-gray-200 dark:bg-gray-700 rounded-lg\" />\n {/* Title bar */}\n <div className=\"h-5 w-3/4 bg-gray-200 dark:bg-gray-700 rounded\" />\n {/* Description line */}\n <div className=\"h-4 w-full bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n ))}\n\n {/* “View all” link */}\n <div className=\"flex justify-center items-center animate-pulse\">\n <div className=\"h-4 w-48 bg-gray-200 text-op-heading rounded\" />\n </div>\n </div>\n </div>\n ))}\n </>\n );\n};\n\nexport const HomePageFolders = ({\n folders,\n}: {\n folders: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"home\" }\n >[\"data\"][\"folders\"];\n}) => {\n return (\n <div className=\"flex flex-col gap-10 mt-20\">\n {folders.map((folder) => (\n <div className=\"space-y-4\">\n <div className=\"flex flex-col gap-2 mb-20\">\n <Link\n key={folder.slug}\n href={`/blog/${folder.slug}`}\n className=\"text-3xl\"\n >\n {folder.title}\n </Link>\n <p className=\"text-sm text-op-muted\">{folder.description}</p>\n </div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10 mb-20\">\n {folder.posts\n .filter((post) => post !== null)\n .map((post) => (\n <PostPreview
|
|
1
|
+
{"version":3,"sources":["../../../src/components/home-page/folders.tsx"],"sourcesContent":["import Link from \"next/link\";\nimport { PostPreview } from \"../post-preview\";\nimport { ArrowRight } from \"lucide-react\";\nimport { Opinly } from \"@opinly/backend\";\n\nexport const HomePageFoldersSkeleton = () => {\n return (\n <>\n {Array(2) // render 2 folder sections\n .fill(null)\n .map((_, sectionIdx) => (\n <div key={sectionIdx} className=\"space-y-4 mb-5\">\n {/* Folder title + description */}\n <div className=\"animate-pulse space-y-2\">\n <div className=\"h-8 w-1/3 bg-gray-200 dark:bg-gray-700 rounded\" />\n <div className=\"h-4 w-1/2 bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n\n {/* Posts grid */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10\">\n {Array(3) // 3 post placeholders\n .fill(null)\n .map((__, postIdx) => (\n <div key={postIdx} className=\"animate-pulse space-y-3\">\n {/* Image */}\n <div className=\"w-full h-48 bg-gray-200 dark:bg-gray-700 rounded-lg\" />\n {/* Title bar */}\n <div className=\"h-5 w-3/4 bg-gray-200 dark:bg-gray-700 rounded\" />\n {/* Description line */}\n <div className=\"h-4 w-full bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n ))}\n\n {/* “View all” link */}\n <div className=\"flex justify-center items-center animate-pulse\">\n <div className=\"h-4 w-48 bg-gray-200 text-op-heading rounded\" />\n </div>\n </div>\n </div>\n ))}\n </>\n );\n};\n\nexport const HomePageFolders = ({\n folders,\n}: {\n folders: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"home\" }\n >[\"data\"][\"folders\"];\n}) => {\n return (\n <div className=\"flex flex-col gap-10 mt-20\">\n {folders.map((folder) => (\n <div className=\"space-y-4\">\n <div className=\"flex flex-col gap-2 mb-20\">\n <Link\n key={folder.slug}\n href={`/blog/${folder.slug}`}\n className=\"text-3xl\"\n >\n {folder.title}\n </Link>\n <p className=\"text-sm text-op-muted\">{folder.description}</p>\n </div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10 mb-20\">\n {folder.posts\n .filter((post) => post !== null)\n .map((post) => (\n <PostPreview\n key={post.slug}\n post={{\n ...post,\n folder: {\n name: folder.title,\n slug: folder.slug,\n description: folder.description || \"\",\n },\n }}\n />\n ))}\n <div className=\"flex justify-center w-full h-full items-center \">\n <Link\n href={`/blog/${folder.slug}`}\n className=\"flex items-center gap-2\"\n >\n <span>View all posts in {folder.title}</span>\n <ArrowRight className=\"w-4 h-4\" />\n </Link>\n </div>\n </div>\n </div>\n ))}\n </div>\n );\n};\n"],"mappings":"AAOI,mBAOU,KADF,YANR;AAPJ,OAAO,UAAU;AACjB,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAGpB,MAAM,0BAA0B,MAAM;AAC3C,SACE,gCACG,gBAAM,CAAC,EACL,KAAK,IAAI,EACT,IAAI,CAAC,GAAG,eACP,qBAAC,SAAqB,WAAU,kBAE9B;AAAA,yBAAC,SAAI,WAAU,2BACb;AAAA,0BAAC,SAAI,WAAU,kDAAiD;AAAA,MAChE,oBAAC,SAAI,WAAU,kDAAiD;AAAA,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cAAmB,OAAO;AAAA,eAAM;AAAA,YACtC,oBAAC,cAAW,WAAU,WAAU;AAAA;AAAA;AAAA,MAClC,GACF;AAAA,OACF;AAAA,KACF,CACD,GACH;AAEJ;","names":[]}
|
|
@@ -26,7 +26,7 @@ var import_post_preview = require("../post-preview");
|
|
|
26
26
|
const TopPosts = ({
|
|
27
27
|
posts
|
|
28
28
|
}) => {
|
|
29
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10", children: posts.map((post) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_preview.PostPreview, { post }, "top-posts-" + post.slug)) });
|
|
29
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10", children: posts.map((post) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_preview.PostPreview, { post, priority: true }, "top-posts-" + post.slug)) });
|
|
30
30
|
};
|
|
31
31
|
// Annotate the CommonJS export names for ESM import in node:
|
|
32
32
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/home-page/top-posts.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport { PostPreview } from \"../post-preview\";\n\nexport const TopPosts = ({\n posts,\n}: {\n posts: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"home\" }\n >[\"data\"][\"posts\"];\n}) => {\n return (\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10\">\n {posts.map((post) => (\n <PostPreview key={\"top-posts-\" + post.slug} post={post} />\n ))}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAcQ;AAbR,0BAA4B;AAErB,MAAM,WAAW,CAAC;AAAA,EACvB;AACF,MAKM;AACJ,SACE,4CAAC,SAAI,WAAU,yDACZ,gBAAM,IAAI,CAAC,SACV,4CAAC,mCAA2C,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/home-page/top-posts.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport { PostPreview } from \"../post-preview\";\n\nexport const TopPosts = ({\n posts,\n}: {\n posts: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"home\" }\n >[\"data\"][\"posts\"];\n}) => {\n return (\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10\">\n {posts.map((post) => (\n <PostPreview key={\"top-posts-\" + post.slug} post={post} priority />\n ))}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAcQ;AAbR,0BAA4B;AAErB,MAAM,WAAW,CAAC;AAAA,EACvB;AACF,MAKM;AACJ,SACE,4CAAC,SAAI,WAAU,yDACZ,gBAAM,IAAI,CAAC,SACV,4CAAC,mCAA2C,MAAY,UAAQ,QAA9C,eAAe,KAAK,IAA2B,CAClE,GACH;AAEJ;","names":[]}
|
|
@@ -3,7 +3,7 @@ import { PostPreview } from "../post-preview";
|
|
|
3
3
|
const TopPosts = ({
|
|
4
4
|
posts
|
|
5
5
|
}) => {
|
|
6
|
-
return /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10", children: posts.map((post) => /* @__PURE__ */ jsx(PostPreview, { post }, "top-posts-" + post.slug)) });
|
|
6
|
+
return /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10", children: posts.map((post) => /* @__PURE__ */ jsx(PostPreview, { post, priority: true }, "top-posts-" + post.slug)) });
|
|
7
7
|
};
|
|
8
8
|
export {
|
|
9
9
|
TopPosts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/home-page/top-posts.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport { PostPreview } from \"../post-preview\";\n\nexport const TopPosts = ({\n posts,\n}: {\n posts: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"home\" }\n >[\"data\"][\"posts\"];\n}) => {\n return (\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10\">\n {posts.map((post) => (\n <PostPreview key={\"top-posts-\" + post.slug} post={post} />\n ))}\n </div>\n );\n};\n"],"mappings":"AAcQ;AAbR,SAAS,mBAAmB;AAErB,MAAM,WAAW,CAAC;AAAA,EACvB;AACF,MAKM;AACJ,SACE,oBAAC,SAAI,WAAU,yDACZ,gBAAM,IAAI,CAAC,SACV,oBAAC,eAA2C,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/home-page/top-posts.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport { PostPreview } from \"../post-preview\";\n\nexport const TopPosts = ({\n posts,\n}: {\n posts: Extract<\n Awaited<ReturnType<Opinly[\"content\"][\"blog\"]>>,\n { type: \"home\" }\n >[\"data\"][\"posts\"];\n}) => {\n return (\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10\">\n {posts.map((post) => (\n <PostPreview key={\"top-posts-\" + post.slug} post={post} priority />\n ))}\n </div>\n );\n};\n"],"mappings":"AAcQ;AAbR,SAAS,mBAAmB;AAErB,MAAM,WAAW,CAAC;AAAA,EACvB;AACF,MAKM;AACJ,SACE,oBAAC,SAAI,WAAU,yDACZ,gBAAM,IAAI,CAAC,SACV,oBAAC,eAA2C,MAAY,UAAQ,QAA9C,eAAe,KAAK,IAA2B,CAClE,GACH;AAEJ;","names":[]}
|
|
@@ -55,7 +55,8 @@ const PostPreviewSkeleton = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("
|
|
|
55
55
|
] })
|
|
56
56
|
] });
|
|
57
57
|
const PostPreview = ({
|
|
58
|
-
post
|
|
58
|
+
post,
|
|
59
|
+
priority
|
|
59
60
|
}) => {
|
|
60
61
|
const postSlug = `${import_sdk_config.opinlyConfig.blogPrefix}/${post.folder?.slug ? `${post.folder.slug}/` : ""}${post.slug}`;
|
|
61
62
|
console.log("Image is", import_image.default);
|
|
@@ -64,6 +65,7 @@ const PostPreview = ({
|
|
|
64
65
|
import_image.default,
|
|
65
66
|
{
|
|
66
67
|
unoptimized: import_sdk_config.opinlyConfig.unoptimizedImages,
|
|
68
|
+
priority,
|
|
67
69
|
src: `${import_sdk_config.opinlyConfig.imagesPrefix}/${post.image.fileKey}`,
|
|
68
70
|
alt: post.title,
|
|
69
71
|
fill: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/post-preview.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport Link from \"next/link\";\nimport Image from \"next/image\";\nimport { opinlyConfig } from \"../utils/sdk-config\";\nimport { formatDate } from \"../utils/dates\";\n\nexport const PostPreviewSkeleton: React.FC = () => (\n <div className=\"w-full h-full \">\n <div className=\"animate-pulse mb-5\">\n <div className=\"w-full h-48 bg-gray-200 dark:bg-gray-700 rounded-lg\" />\n </div>\n <div className=\"flex items-center space-x-2 text-sm text-muted-foreground mb-3\">\n <div className=\"animate-pulse h-4 w-20 bg-gray-200 dark:bg-gray-700 rounded\" />\n <div className=\"animate-pulse h-4 w-1 bg-gray-200 dark:bg-gray-700 rounded-full\" />\n <div className=\"animate-pulse h-4 w-16 bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n <div className=\"animate-pulse h-5 w-3/4 bg-gray-200 dark:bg-gray-700 rounded mb-2\" />\n <div className=\"space-y-1 mt-1 pr-4\">\n <div className=\"animate-pulse h-4 w-full bg-gray-200 dark:bg-gray-700 rounded\" />\n <div className=\"animate-pulse h-4 w-10/12 bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n <div className=\"flex items-center space-x-2 text-xs mt-2\">\n <div className=\"animate-pulse h-3 w-24 bg-gray-200 dark:bg-gray-700 rounded\" />\n <div className=\"animate-pulse h-3 w-12 bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n </div>\n);\n\nexport const PostPreview = ({\n post,\n}: {\n post: NonNullable<\n NonNullable<\n Awaited<\n ReturnType<Opinly[\"client\"][\"content\"][\"authorPage\"][\"query\"]>\n >[\"data\"]\n >[\"posts\"][number]\n >;\n}) => {\n const postSlug = `${opinlyConfig.blogPrefix}/${\n post.folder?.slug ? `${post.folder.slug}/` : \"\"\n }${post.slug}`;\n\n console.log(\"Image is\", Image);\n\n return (\n <div className=\"w-full h-full\">\n {post.image?.fileKey && (\n <Link href={postSlug} className=\"group\">\n <div className=\"relative w-full h-48 mb-4\">\n <Image\n unoptimized={opinlyConfig.unoptimizedImages}\n src={`${opinlyConfig.imagesPrefix}/${post.image.fileKey}`}\n alt={post.title}\n fill\n className=\"object-cover rounded-lg\"\n />\n </div>\n </Link>\n )}\n <div className=\"text-sm text-op-muted mb-1\">\n {post.folder?.name && (\n <>\n <Link\n href={`${opinlyConfig.blogPrefix}/${post.folder.slug}`}\n className=\"hover:underline\"\n >\n {post.folder.name}\n </Link>\n <span className=\"mx-1\">·</span>\n </>\n )}{\" \"}\n {formatDate(post.firstPublishedAt as string)}\n </div>\n <Link href={postSlug} className=\"group\">\n <h2 className=\"text-lg font-semibold leading-snug group-hover:underline text-op-heading\">\n {post.title}\n </h2>\n </Link>\n\n {post.description && (\n <p className=\"text-sm text-op-body mt-1 line-clamp-2\">\n {post.description}\n </p>\n )}\n <div className=\"text-xs text-op-muted mt-2\">\n {post.author && (\n <>\n <Link\n href={`${opinlyConfig.blogPrefix}/authors/${post.author.slug}`}\n className=\"font-medium hover:underline\"\n >\n {post.author?.name}\n </Link>{\" \"}\n <span className=\"mx-1\">·</span>\n </>\n )}{\" \"}\n {formatDate(post.firstPublishedAt as string)}\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASM;AARN,kBAAiB;AACjB,mBAAkB;AAClB,wBAA6B;AAC7B,mBAA2B;AAEpB,MAAM,sBAAgC,MAC3C,6CAAC,SAAI,WAAU,kBACb;AAAA,8CAAC,SAAI,WAAU,sBACb,sDAAC,SAAI,WAAU,uDAAsD,GACvE;AAAA,EACA,6CAAC,SAAI,WAAU,kEACb;AAAA,gDAAC,SAAI,WAAU,+DAA8D;AAAA,IAC7E,4CAAC,SAAI,WAAU,mEAAkE;AAAA,IACjF,4CAAC,SAAI,WAAU,+DAA8D;AAAA,KAC/E;AAAA,EACA,4CAAC,SAAI,WAAU,qEAAoE;AAAA,EACnF,6CAAC,SAAI,WAAU,uBACb;AAAA,gDAAC,SAAI,WAAU,iEAAgE;AAAA,IAC/E,4CAAC,SAAI,WAAU,kEAAiE;AAAA,KAClF;AAAA,EACA,6CAAC,SAAI,WAAU,4CACb;AAAA,gDAAC,SAAI,WAAU,+DAA8D;AAAA,IAC7E,4CAAC,SAAI,WAAU,+DAA8D;AAAA,KAC/E;AAAA,GACF;AAGK,MAAM,cAAc,CAAC;AAAA,EAC1B;AACF,
|
|
1
|
+
{"version":3,"sources":["../../src/components/post-preview.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport Link from \"next/link\";\nimport Image from \"next/image\";\nimport { opinlyConfig } from \"../utils/sdk-config\";\nimport { formatDate } from \"../utils/dates\";\n\nexport const PostPreviewSkeleton: React.FC = () => (\n <div className=\"w-full h-full \">\n <div className=\"animate-pulse mb-5\">\n <div className=\"w-full h-48 bg-gray-200 dark:bg-gray-700 rounded-lg\" />\n </div>\n <div className=\"flex items-center space-x-2 text-sm text-muted-foreground mb-3\">\n <div className=\"animate-pulse h-4 w-20 bg-gray-200 dark:bg-gray-700 rounded\" />\n <div className=\"animate-pulse h-4 w-1 bg-gray-200 dark:bg-gray-700 rounded-full\" />\n <div className=\"animate-pulse h-4 w-16 bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n <div className=\"animate-pulse h-5 w-3/4 bg-gray-200 dark:bg-gray-700 rounded mb-2\" />\n <div className=\"space-y-1 mt-1 pr-4\">\n <div className=\"animate-pulse h-4 w-full bg-gray-200 dark:bg-gray-700 rounded\" />\n <div className=\"animate-pulse h-4 w-10/12 bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n <div className=\"flex items-center space-x-2 text-xs mt-2\">\n <div className=\"animate-pulse h-3 w-24 bg-gray-200 dark:bg-gray-700 rounded\" />\n <div className=\"animate-pulse h-3 w-12 bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n </div>\n);\n\nexport const PostPreview = ({\n post,\n priority,\n}: {\n post: NonNullable<\n NonNullable<\n Awaited<\n ReturnType<Opinly[\"client\"][\"content\"][\"authorPage\"][\"query\"]>\n >[\"data\"]\n >[\"posts\"][number]\n >;\n priority?: boolean;\n}) => {\n const postSlug = `${opinlyConfig.blogPrefix}/${\n post.folder?.slug ? `${post.folder.slug}/` : \"\"\n }${post.slug}`;\n\n console.log(\"Image is\", Image);\n\n return (\n <div className=\"w-full h-full\">\n {post.image?.fileKey && (\n <Link href={postSlug} className=\"group\">\n <div className=\"relative w-full h-48 mb-4\">\n <Image\n unoptimized={opinlyConfig.unoptimizedImages}\n priority={priority}\n src={`${opinlyConfig.imagesPrefix}/${post.image.fileKey}`}\n alt={post.title}\n fill\n className=\"object-cover rounded-lg\"\n />\n </div>\n </Link>\n )}\n <div className=\"text-sm text-op-muted mb-1\">\n {post.folder?.name && (\n <>\n <Link\n href={`${opinlyConfig.blogPrefix}/${post.folder.slug}`}\n className=\"hover:underline\"\n >\n {post.folder.name}\n </Link>\n <span className=\"mx-1\">·</span>\n </>\n )}{\" \"}\n {formatDate(post.firstPublishedAt as string)}\n </div>\n <Link href={postSlug} className=\"group\">\n <h2 className=\"text-lg font-semibold leading-snug group-hover:underline text-op-heading\">\n {post.title}\n </h2>\n </Link>\n\n {post.description && (\n <p className=\"text-sm text-op-body mt-1 line-clamp-2\">\n {post.description}\n </p>\n )}\n <div className=\"text-xs text-op-muted mt-2\">\n {post.author && (\n <>\n <Link\n href={`${opinlyConfig.blogPrefix}/authors/${post.author.slug}`}\n className=\"font-medium hover:underline\"\n >\n {post.author?.name}\n </Link>{\" \"}\n <span className=\"mx-1\">·</span>\n </>\n )}{\" \"}\n {formatDate(post.firstPublishedAt as string)}\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASM;AARN,kBAAiB;AACjB,mBAAkB;AAClB,wBAA6B;AAC7B,mBAA2B;AAEpB,MAAM,sBAAgC,MAC3C,6CAAC,SAAI,WAAU,kBACb;AAAA,8CAAC,SAAI,WAAU,sBACb,sDAAC,SAAI,WAAU,uDAAsD,GACvE;AAAA,EACA,6CAAC,SAAI,WAAU,kEACb;AAAA,gDAAC,SAAI,WAAU,+DAA8D;AAAA,IAC7E,4CAAC,SAAI,WAAU,mEAAkE;AAAA,IACjF,4CAAC,SAAI,WAAU,+DAA8D;AAAA,KAC/E;AAAA,EACA,4CAAC,SAAI,WAAU,qEAAoE;AAAA,EACnF,6CAAC,SAAI,WAAU,uBACb;AAAA,gDAAC,SAAI,WAAU,iEAAgE;AAAA,IAC/E,4CAAC,SAAI,WAAU,kEAAiE;AAAA,KAClF;AAAA,EACA,6CAAC,SAAI,WAAU,4CACb;AAAA,gDAAC,SAAI,WAAU,+DAA8D;AAAA,IAC7E,4CAAC,SAAI,WAAU,+DAA8D;AAAA,KAC/E;AAAA,GACF;AAGK,MAAM,cAAc,CAAC;AAAA,EAC1B;AAAA,EACA;AACF,MASM;AACJ,QAAM,WAAW,GAAG,+BAAa,UAAU,IACzC,KAAK,QAAQ,OAAO,GAAG,KAAK,OAAO,IAAI,MAAM,EAC/C,GAAG,KAAK,IAAI;AAEZ,UAAQ,IAAI,YAAY,aAAAA,OAAK;AAE7B,SACE,6CAAC,SAAI,WAAU,iBACZ;AAAA,SAAK,OAAO,WACX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|
|
|
2
2
|
import { Opinly } from '@opinly/backend';
|
|
3
3
|
|
|
4
4
|
declare const PostPreviewSkeleton: React.FC;
|
|
5
|
-
declare const PostPreview: ({ post, }: {
|
|
5
|
+
declare const PostPreview: ({ post, priority, }: {
|
|
6
6
|
post: NonNullable<NonNullable<Awaited<ReturnType<Opinly["client"]["content"]["authorPage"]["query"]>>["data"]>["posts"][number]>;
|
|
7
|
+
priority?: boolean;
|
|
7
8
|
}) => react_jsx_runtime.JSX.Element;
|
|
8
9
|
|
|
9
10
|
export { PostPreview, PostPreviewSkeleton };
|
|
@@ -2,8 +2,9 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { Opinly } from '@opinly/backend';
|
|
3
3
|
|
|
4
4
|
declare const PostPreviewSkeleton: React.FC;
|
|
5
|
-
declare const PostPreview: ({ post, }: {
|
|
5
|
+
declare const PostPreview: ({ post, priority, }: {
|
|
6
6
|
post: NonNullable<NonNullable<Awaited<ReturnType<Opinly["client"]["content"]["authorPage"]["query"]>>["data"]>["posts"][number]>;
|
|
7
|
+
priority?: boolean;
|
|
7
8
|
}) => react_jsx_runtime.JSX.Element;
|
|
8
9
|
|
|
9
10
|
export { PostPreview, PostPreviewSkeleton };
|
|
@@ -21,7 +21,8 @@ const PostPreviewSkeleton = () => /* @__PURE__ */ jsxs("div", { className: "w-fu
|
|
|
21
21
|
] })
|
|
22
22
|
] });
|
|
23
23
|
const PostPreview = ({
|
|
24
|
-
post
|
|
24
|
+
post,
|
|
25
|
+
priority
|
|
25
26
|
}) => {
|
|
26
27
|
const postSlug = `${opinlyConfig.blogPrefix}/${post.folder?.slug ? `${post.folder.slug}/` : ""}${post.slug}`;
|
|
27
28
|
console.log("Image is", Image);
|
|
@@ -30,6 +31,7 @@ const PostPreview = ({
|
|
|
30
31
|
Image,
|
|
31
32
|
{
|
|
32
33
|
unoptimized: opinlyConfig.unoptimizedImages,
|
|
34
|
+
priority,
|
|
33
35
|
src: `${opinlyConfig.imagesPrefix}/${post.image.fileKey}`,
|
|
34
36
|
alt: post.title,
|
|
35
37
|
fill: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/post-preview.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport Link from \"next/link\";\nimport Image from \"next/image\";\nimport { opinlyConfig } from \"../utils/sdk-config\";\nimport { formatDate } from \"../utils/dates\";\n\nexport const PostPreviewSkeleton: React.FC = () => (\n <div className=\"w-full h-full \">\n <div className=\"animate-pulse mb-5\">\n <div className=\"w-full h-48 bg-gray-200 dark:bg-gray-700 rounded-lg\" />\n </div>\n <div className=\"flex items-center space-x-2 text-sm text-muted-foreground mb-3\">\n <div className=\"animate-pulse h-4 w-20 bg-gray-200 dark:bg-gray-700 rounded\" />\n <div className=\"animate-pulse h-4 w-1 bg-gray-200 dark:bg-gray-700 rounded-full\" />\n <div className=\"animate-pulse h-4 w-16 bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n <div className=\"animate-pulse h-5 w-3/4 bg-gray-200 dark:bg-gray-700 rounded mb-2\" />\n <div className=\"space-y-1 mt-1 pr-4\">\n <div className=\"animate-pulse h-4 w-full bg-gray-200 dark:bg-gray-700 rounded\" />\n <div className=\"animate-pulse h-4 w-10/12 bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n <div className=\"flex items-center space-x-2 text-xs mt-2\">\n <div className=\"animate-pulse h-3 w-24 bg-gray-200 dark:bg-gray-700 rounded\" />\n <div className=\"animate-pulse h-3 w-12 bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n </div>\n);\n\nexport const PostPreview = ({\n post,\n}: {\n post: NonNullable<\n NonNullable<\n Awaited<\n ReturnType<Opinly[\"client\"][\"content\"][\"authorPage\"][\"query\"]>\n >[\"data\"]\n >[\"posts\"][number]\n >;\n}) => {\n const postSlug = `${opinlyConfig.blogPrefix}/${\n post.folder?.slug ? `${post.folder.slug}/` : \"\"\n }${post.slug}`;\n\n console.log(\"Image is\", Image);\n\n return (\n <div className=\"w-full h-full\">\n {post.image?.fileKey && (\n <Link href={postSlug} className=\"group\">\n <div className=\"relative w-full h-48 mb-4\">\n <Image\n unoptimized={opinlyConfig.unoptimizedImages}\n src={`${opinlyConfig.imagesPrefix}/${post.image.fileKey}`}\n alt={post.title}\n fill\n className=\"object-cover rounded-lg\"\n />\n </div>\n </Link>\n )}\n <div className=\"text-sm text-op-muted mb-1\">\n {post.folder?.name && (\n <>\n <Link\n href={`${opinlyConfig.blogPrefix}/${post.folder.slug}`}\n className=\"hover:underline\"\n >\n {post.folder.name}\n </Link>\n <span className=\"mx-1\">·</span>\n </>\n )}{\" \"}\n {formatDate(post.firstPublishedAt as string)}\n </div>\n <Link href={postSlug} className=\"group\">\n <h2 className=\"text-lg font-semibold leading-snug group-hover:underline text-op-heading\">\n {post.title}\n </h2>\n </Link>\n\n {post.description && (\n <p className=\"text-sm text-op-body mt-1 line-clamp-2\">\n {post.description}\n </p>\n )}\n <div className=\"text-xs text-op-muted mt-2\">\n {post.author && (\n <>\n <Link\n href={`${opinlyConfig.blogPrefix}/authors/${post.author.slug}`}\n className=\"font-medium hover:underline\"\n >\n {post.author?.name}\n </Link>{\" \"}\n <span className=\"mx-1\">·</span>\n </>\n )}{\" \"}\n {formatDate(post.firstPublishedAt as string)}\n </div>\n </div>\n );\n};\n"],"mappings":"AASM,
|
|
1
|
+
{"version":3,"sources":["../../src/components/post-preview.tsx"],"sourcesContent":["import { Opinly } from \"@opinly/backend\";\nimport Link from \"next/link\";\nimport Image from \"next/image\";\nimport { opinlyConfig } from \"../utils/sdk-config\";\nimport { formatDate } from \"../utils/dates\";\n\nexport const PostPreviewSkeleton: React.FC = () => (\n <div className=\"w-full h-full \">\n <div className=\"animate-pulse mb-5\">\n <div className=\"w-full h-48 bg-gray-200 dark:bg-gray-700 rounded-lg\" />\n </div>\n <div className=\"flex items-center space-x-2 text-sm text-muted-foreground mb-3\">\n <div className=\"animate-pulse h-4 w-20 bg-gray-200 dark:bg-gray-700 rounded\" />\n <div className=\"animate-pulse h-4 w-1 bg-gray-200 dark:bg-gray-700 rounded-full\" />\n <div className=\"animate-pulse h-4 w-16 bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n <div className=\"animate-pulse h-5 w-3/4 bg-gray-200 dark:bg-gray-700 rounded mb-2\" />\n <div className=\"space-y-1 mt-1 pr-4\">\n <div className=\"animate-pulse h-4 w-full bg-gray-200 dark:bg-gray-700 rounded\" />\n <div className=\"animate-pulse h-4 w-10/12 bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n <div className=\"flex items-center space-x-2 text-xs mt-2\">\n <div className=\"animate-pulse h-3 w-24 bg-gray-200 dark:bg-gray-700 rounded\" />\n <div className=\"animate-pulse h-3 w-12 bg-gray-200 dark:bg-gray-700 rounded\" />\n </div>\n </div>\n);\n\nexport const PostPreview = ({\n post,\n priority,\n}: {\n post: NonNullable<\n NonNullable<\n Awaited<\n ReturnType<Opinly[\"client\"][\"content\"][\"authorPage\"][\"query\"]>\n >[\"data\"]\n >[\"posts\"][number]\n >;\n priority?: boolean;\n}) => {\n const postSlug = `${opinlyConfig.blogPrefix}/${\n post.folder?.slug ? `${post.folder.slug}/` : \"\"\n }${post.slug}`;\n\n console.log(\"Image is\", Image);\n\n return (\n <div className=\"w-full h-full\">\n {post.image?.fileKey && (\n <Link href={postSlug} className=\"group\">\n <div className=\"relative w-full h-48 mb-4\">\n <Image\n unoptimized={opinlyConfig.unoptimizedImages}\n priority={priority}\n src={`${opinlyConfig.imagesPrefix}/${post.image.fileKey}`}\n alt={post.title}\n fill\n className=\"object-cover rounded-lg\"\n />\n </div>\n </Link>\n )}\n <div className=\"text-sm text-op-muted mb-1\">\n {post.folder?.name && (\n <>\n <Link\n href={`${opinlyConfig.blogPrefix}/${post.folder.slug}`}\n className=\"hover:underline\"\n >\n {post.folder.name}\n </Link>\n <span className=\"mx-1\">·</span>\n </>\n )}{\" \"}\n {formatDate(post.firstPublishedAt as string)}\n </div>\n <Link href={postSlug} className=\"group\">\n <h2 className=\"text-lg font-semibold leading-snug group-hover:underline text-op-heading\">\n {post.title}\n </h2>\n </Link>\n\n {post.description && (\n <p className=\"text-sm text-op-body mt-1 line-clamp-2\">\n {post.description}\n </p>\n )}\n <div className=\"text-xs text-op-muted mt-2\">\n {post.author && (\n <>\n <Link\n href={`${opinlyConfig.blogPrefix}/authors/${post.author.slug}`}\n className=\"font-medium hover:underline\"\n >\n {post.author?.name}\n </Link>{\" \"}\n <span className=\"mx-1\">·</span>\n </>\n )}{\" \"}\n {formatDate(post.firstPublishedAt as string)}\n </div>\n </div>\n );\n};\n"],"mappings":"AASM,SAwDI,UAxDJ,KAEF,YAFE;AARN,OAAO,UAAU;AACjB,OAAO,WAAW;AAClB,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAEpB,MAAM,sBAAgC,MAC3C,qBAAC,SAAI,WAAU,kBACb;AAAA,sBAAC,SAAI,WAAU,sBACb,8BAAC,SAAI,WAAU,uDAAsD,GACvE;AAAA,EACA,qBAAC,SAAI,WAAU,kEACb;AAAA,wBAAC,SAAI,WAAU,+DAA8D;AAAA,IAC7E,oBAAC,SAAI,WAAU,mEAAkE;AAAA,IACjF,oBAAC,SAAI,WAAU,+DAA8D;AAAA,KAC/E;AAAA,EACA,oBAAC,SAAI,WAAU,qEAAoE;AAAA,EACnF,qBAAC,SAAI,WAAU,uBACb;AAAA,wBAAC,SAAI,WAAU,iEAAgE;AAAA,IAC/E,oBAAC,SAAI,WAAU,kEAAiE;AAAA,KAClF;AAAA,EACA,qBAAC,SAAI,WAAU,4CACb;AAAA,wBAAC,SAAI,WAAU,+DAA8D;AAAA,IAC7E,oBAAC,SAAI,WAAU,+DAA8D;AAAA,KAC/E;AAAA,GACF;AAGK,MAAM,cAAc,CAAC;AAAA,EAC1B;AAAA,EACA;AACF,MASM;AACJ,QAAM,WAAW,GAAG,aAAa,UAAU,IACzC,KAAK,QAAQ,OAAO,GAAG,KAAK,OAAO,IAAI,M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GED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opinly/next",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
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.19"
|
|
35
35
|
},
|
|
36
36
|
"engines": {
|
|
37
37
|
"node": ">=16"
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
},
|
|
75
75
|
"scripts": {
|
|
76
76
|
"build": "tsup",
|
|
77
|
-
"dev": "tsup --config tsup.config.ts --watch",
|
|
78
|
-
"
|
|
77
|
+
"packages-dev": "tsup --config tsup.config.ts --watch",
|
|
78
|
+
"check-types": "tsc --noEmit",
|
|
79
79
|
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
|
|
80
80
|
}
|
|
81
81
|
}
|