@vilio/minimal-template 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +18 -0
- package/dist/layout.js +10 -0
- package/dist/overrides/MinimalBlogDetail.js +15 -0
- package/dist/overrides/MinimalBlogList.js +8 -0
- package/package.json +8 -13
- package/dist/index.cjs +0 -25
- package/dist/index.mjs +0 -18
- package/dist/layout.cjs +0 -50
- package/dist/layout.mjs +0 -40
- package/dist/overrides/MinimalBlogDetail.cjs +0 -85
- package/dist/overrides/MinimalBlogDetail.mjs +0 -45
- package/dist/overrides/MinimalBlogList.cjs +0 -38
- package/dist/overrides/MinimalBlogList.mjs +0 -15
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import manifest from "../manifest.json" with { type: "json" };
|
|
2
|
+
import MinimalLayout from "./layout";
|
|
3
|
+
import MinimalBlogDetail from "./overrides/MinimalBlogDetail";
|
|
4
|
+
import MinimalBlogList from "./overrides/MinimalBlogList";
|
|
5
|
+
const minimalTemplate = {
|
|
6
|
+
id: manifest.id,
|
|
7
|
+
name: manifest.name,
|
|
8
|
+
description: manifest.description,
|
|
9
|
+
version: manifest.version,
|
|
10
|
+
author: manifest.author,
|
|
11
|
+
layout: MinimalLayout,
|
|
12
|
+
overrides: {
|
|
13
|
+
"blog:list": MinimalBlogList,
|
|
14
|
+
"blog:home": MinimalBlogList,
|
|
15
|
+
"blog:detail": MinimalBlogDetail,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
export default minimalTemplate;
|
package/dist/layout.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getCurrentSession } from "@vilio/core/server";
|
|
3
|
+
import { getPublicNavigation } from "@vilio/modules/server";
|
|
4
|
+
import Link from "next/link";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
export default async function MinimalLayout({ children, }) {
|
|
7
|
+
const navigation = await getPublicNavigation();
|
|
8
|
+
const { user } = await getCurrentSession();
|
|
9
|
+
return (_jsx("div", { className: "min-h-screen bg-white text-zinc-900 font-mono selection:bg-zinc-900 selection:text-white", children: _jsxs("div", { className: "max-w-2xl mx-auto px-6 py-12 space-y-16", children: [_jsxs("header", { className: "flex flex-col gap-8 border-b border-zinc-100 pb-8", children: [_jsx(Link, { href: "/", className: "text-sm font-black uppercase tracking-tighter hover:opacity-50 transition-opacity", children: "Vilio / Minimal" }), _jsxs("nav", { className: "flex flex-wrap gap-x-6 gap-y-2 text-[10px] uppercase font-bold tracking-widest text-zinc-400", children: [_jsx(Link, { href: "/", className: "hover:text-zinc-900 transition-colors", children: "Index" }), navigation.map((item) => (_jsx(Link, { href: item.url, className: "hover:text-zinc-900 transition-colors", children: item.title }, item.url))), user ? (_jsx(Link, { href: "/vilio", className: "text-zinc-900 underline underline-offset-4", children: "Dashboard" })) : (_jsx(Link, { href: "/signin", className: "hover:text-zinc-900 transition-colors italic lowercase", children: "Login" }))] })] }), _jsx("main", { className: "min-h-[50vh]", children: children }), _jsxs("footer", { className: "pt-16 border-t border-zinc-100 flex justify-between items-center text-[10px] uppercase font-bold tracking-widest text-zinc-300", children: [_jsx("span", { children: "Built with Vilio" }), _jsx("span", { children: new Date().getFullYear() })] })] }) }));
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getComments, getPostBySlug } from "@vilio/blog-module/actions";
|
|
3
|
+
import { getCurrentSession } from "@vilio/core/server";
|
|
4
|
+
import Link from "next/link";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
export default async function MinimalBlogDetail({ params, }) {
|
|
7
|
+
const { slug } = await params;
|
|
8
|
+
const post = await getPostBySlug(slug);
|
|
9
|
+
if (!post || post.status !== "published") {
|
|
10
|
+
return (_jsx("div", { className: "py-20 text-center text-[10px] uppercase font-bold tracking-widest opacity-30", children: "404 / Post not found" }));
|
|
11
|
+
}
|
|
12
|
+
const comments = await getComments(post.id);
|
|
13
|
+
const { user } = await getCurrentSession();
|
|
14
|
+
return (_jsxs("article", { className: "space-y-12 animate-in fade-in slide-in-from-bottom-2 duration-700", children: [_jsxs("header", { className: "space-y-4", children: [_jsxs("div", { className: "flex items-center gap-4 text-[10px] uppercase font-bold tracking-[0.2em] text-zinc-400", children: [_jsx("span", { children: new Date(post.createdAt).toLocaleDateString() }), _jsx("span", { children: "/" }), _jsx("span", { children: post.category?.name || "General" })] }), _jsx("h1", { className: "text-4xl md:text-5xl font-black tracking-tighter leading-tight text-zinc-900", children: post.title }), post.excerpt && (_jsx("p", { className: "text-xl text-zinc-500 font-medium leading-relaxed italic border-l-2 border-zinc-100 pl-6 py-2", children: post.excerpt }))] }), post.coverImage && (_jsx("div", { className: "aspect-video bg-zinc-50 border border-zinc-100 overflow-hidden", children: _jsx("img", { src: post.coverImage, className: "w-full h-full object-cover grayscale", alt: post.title }) })), _jsx("div", { className: "prose prose-zinc max-w-none font-sans text-lg leading-relaxed text-zinc-800 whitespace-pre-wrap", children: post.content }), post.tags?.length > 0 && (_jsx("div", { className: "flex flex-wrap gap-4 pt-8 border-t border-zinc-50", children: post.tags.map((pt) => (_jsxs("span", { className: "text-[10px] font-bold uppercase tracking-widest text-zinc-400", children: ["#", pt.tag.name] }, pt.tag.id))) })), _jsxs("section", { className: "pt-16 space-y-10", children: [_jsxs("h3", { className: "text-xs font-black uppercase tracking-[0.3em] text-zinc-300 border-b border-zinc-50 pb-4", children: ["Comments (", comments.length, ")"] }), _jsxs("div", { className: "space-y-12", children: [comments.map((comment) => (_jsxs("div", { className: "space-y-2", children: [_jsxs("div", { className: "flex items-center gap-3 text-[10px] font-black uppercase tracking-widest", children: [_jsx("span", { className: "text-zinc-900", children: comment.author.name }), _jsx("span", { className: "text-zinc-300", children: "\u2022" }), _jsx("span", { className: "text-zinc-300", children: new Date(comment.createdAt).toLocaleDateString() })] }), _jsx("p", { className: "text-sm text-zinc-600 leading-relaxed font-sans", children: comment.content })] }, comment.id))), comments.length === 0 && (_jsx("p", { className: "text-[10px] uppercase font-bold text-zinc-300 italic", children: "No discussion yet." }))] }), _jsx("div", { className: "pt-8", children: _jsx(Link, { href: "/signin", className: "text-[10px] font-black uppercase tracking-widest border-b-2 border-zinc-900 pb-1 hover:opacity-50 transition-opacity", children: "Join the conversation \u2192" }) })] }), _jsx("footer", { className: "pt-20", children: _jsx(Link, { href: "/blog", className: "text-[10px] font-black uppercase tracking-widest text-zinc-400 hover:text-zinc-900 transition-colors flex items-center gap-2", children: "\u2190 Back to writings" }) })] }));
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getPosts } from "@vilio/blog-module/actions";
|
|
3
|
+
import Link from "next/link";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
export default async function MinimalBlogList() {
|
|
6
|
+
const posts = await getPosts({ status: "published" });
|
|
7
|
+
return (_jsxs("div", { className: "space-y-12", children: [_jsx("h2", { className: "text-xl font-black uppercase tracking-tighter border-l-4 border-zinc-900 pl-4", children: "Writing" }), _jsx("div", { className: "divide-y divide-zinc-50", children: posts.map((post) => (_jsx(Link, { href: `/blog/${post.slug}`, className: "group block py-6 hover:bg-zinc-50/50 -mx-4 px-4 transition-colors", children: _jsxs("div", { className: "flex flex-col gap-1", children: [_jsxs("span", { className: "text-[9px] uppercase font-bold text-zinc-400 tracking-widest", children: [new Date(post.createdAt).toLocaleDateString(), " \u2014", " ", post.category?.name || "General"] }), _jsx("h3", { className: "text-lg font-bold group-hover:underline underline-offset-4 decoration-2", children: post.title }), post.excerpt && (_jsx("p", { className: "text-sm text-zinc-500 mt-2 line-clamp-2 italic font-sans leading-relaxed", children: post.excerpt }))] }) }, post.id))) }), posts.length === 0 && (_jsx("p", { className: "text-sm opacity-30 italic", children: "No posts published yet." }))] }));
|
|
8
|
+
}
|
package/package.json
CHANGED
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vilio/minimal-template",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "A minimalist, typography-focused theme for Vilio",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"types": "./
|
|
7
|
-
"main": "./
|
|
6
|
+
"types": "./dist/index.js",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
8
|
"exports": {
|
|
9
9
|
"./package.json": "./package.json",
|
|
10
|
-
".":
|
|
11
|
-
"import": "./src/index.ts",
|
|
12
|
-
"require": "./dist/index.cjs"
|
|
13
|
-
}
|
|
10
|
+
".": "./dist/index.js"
|
|
14
11
|
},
|
|
15
12
|
"files": [
|
|
16
13
|
"dist",
|
|
17
14
|
"manifest.json"
|
|
18
15
|
],
|
|
19
16
|
"scripts": {
|
|
20
|
-
"build": "
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"switch:prod": "node scripts/switchToDist.js"
|
|
17
|
+
"build": "tsc --noResolve --noCheck",
|
|
18
|
+
"dev": "tsc --watch",
|
|
19
|
+
"clean": "rm -rf ./dist"
|
|
24
20
|
},
|
|
25
21
|
"dependencies": {
|
|
26
22
|
"zod": "^3.24.1",
|
|
@@ -34,8 +30,7 @@
|
|
|
34
30
|
"next": "16.1.6",
|
|
35
31
|
"react": "^19.0.0",
|
|
36
32
|
"react-dom": "^19.0.0",
|
|
37
|
-
"typescript": "5.9.2"
|
|
38
|
-
"unbuild": "^3.3.1"
|
|
33
|
+
"typescript": "5.9.2"
|
|
39
34
|
},
|
|
40
35
|
"peerDependencies": {
|
|
41
36
|
"@vilio/intl": "^0.0.8",
|
package/dist/index.cjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _manifest = _interopRequireDefault(require("../manifest.json"));
|
|
8
|
-
var _layout = _interopRequireDefault(require("./layout.cjs"));
|
|
9
|
-
var _MinimalBlogDetail = _interopRequireDefault(require("./overrides/MinimalBlogDetail.cjs"));
|
|
10
|
-
var _MinimalBlogList = _interopRequireDefault(require("./overrides/MinimalBlogList.cjs"));
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
const minimalTemplate = {
|
|
13
|
-
id: _manifest.default.id,
|
|
14
|
-
name: _manifest.default.name,
|
|
15
|
-
description: _manifest.default.description,
|
|
16
|
-
version: _manifest.default.version,
|
|
17
|
-
author: _manifest.default.author,
|
|
18
|
-
layout: _layout.default,
|
|
19
|
-
overrides: {
|
|
20
|
-
"blog:list": _MinimalBlogList.default,
|
|
21
|
-
"blog:home": _MinimalBlogList.default,
|
|
22
|
-
"blog:detail": _MinimalBlogDetail.default
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
module.exports = minimalTemplate;
|
package/dist/index.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import manifest from "../manifest.json" with { type: "json" };
|
|
2
|
-
import MinimalLayout from "./layout.mjs";
|
|
3
|
-
import MinimalBlogDetail from "./overrides/MinimalBlogDetail.mjs";
|
|
4
|
-
import MinimalBlogList from "./overrides/MinimalBlogList.mjs";
|
|
5
|
-
const minimalTemplate = {
|
|
6
|
-
id: manifest.id,
|
|
7
|
-
name: manifest.name,
|
|
8
|
-
description: manifest.description,
|
|
9
|
-
version: manifest.version,
|
|
10
|
-
author: manifest.author,
|
|
11
|
-
layout: MinimalLayout,
|
|
12
|
-
overrides: {
|
|
13
|
-
"blog:list": MinimalBlogList,
|
|
14
|
-
"blog:home": MinimalBlogList,
|
|
15
|
-
"blog:detail": MinimalBlogDetail
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
export default minimalTemplate;
|
package/dist/layout.cjs
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
module.exports = MinimalLayout;
|
|
7
|
-
var _server = require("@vilio/core/server");
|
|
8
|
-
var _server2 = require("@vilio/modules/server");
|
|
9
|
-
var _link = _interopRequireDefault(require("next/link"));
|
|
10
|
-
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
async function MinimalLayout({
|
|
15
|
-
children
|
|
16
|
-
}) {
|
|
17
|
-
const navigation = await (0, _server2.getPublicNavigation)();
|
|
18
|
-
const {
|
|
19
|
-
user
|
|
20
|
-
} = await (0, _server.getCurrentSession)();
|
|
21
|
-
return /* @__PURE__ */React.createElement("div", {
|
|
22
|
-
className: "min-h-screen bg-white text-zinc-900 font-mono selection:bg-zinc-900 selection:text-white"
|
|
23
|
-
}, /* @__PURE__ */React.createElement("div", {
|
|
24
|
-
className: "max-w-2xl mx-auto px-6 py-12 space-y-16"
|
|
25
|
-
}, /* @__PURE__ */React.createElement("header", {
|
|
26
|
-
className: "flex flex-col gap-8 border-b border-zinc-100 pb-8"
|
|
27
|
-
}, /* @__PURE__ */React.createElement(_link.default, {
|
|
28
|
-
href: "/",
|
|
29
|
-
className: "text-sm font-black uppercase tracking-tighter hover:opacity-50 transition-opacity"
|
|
30
|
-
}, "Vilio / Minimal"), /* @__PURE__ */React.createElement("nav", {
|
|
31
|
-
className: "flex flex-wrap gap-x-6 gap-y-2 text-[10px] uppercase font-bold tracking-widest text-zinc-400"
|
|
32
|
-
}, /* @__PURE__ */React.createElement(_link.default, {
|
|
33
|
-
href: "/",
|
|
34
|
-
className: "hover:text-zinc-900 transition-colors"
|
|
35
|
-
}, "Index"), navigation.map(item => /* @__PURE__ */React.createElement(_link.default, {
|
|
36
|
-
key: item.url,
|
|
37
|
-
href: item.url,
|
|
38
|
-
className: "hover:text-zinc-900 transition-colors"
|
|
39
|
-
}, item.title)), user ? /* @__PURE__ */React.createElement(_link.default, {
|
|
40
|
-
href: "/vilio",
|
|
41
|
-
className: "text-zinc-900 underline underline-offset-4"
|
|
42
|
-
}, "Dashboard") : /* @__PURE__ */React.createElement(_link.default, {
|
|
43
|
-
href: "/signin",
|
|
44
|
-
className: "hover:text-zinc-900 transition-colors italic lowercase"
|
|
45
|
-
}, "Login"))), /* @__PURE__ */React.createElement("main", {
|
|
46
|
-
className: "min-h-[50vh]"
|
|
47
|
-
}, children), /* @__PURE__ */React.createElement("footer", {
|
|
48
|
-
className: "pt-16 border-t border-zinc-100 flex justify-between items-center text-[10px] uppercase font-bold tracking-widest text-zinc-300"
|
|
49
|
-
}, /* @__PURE__ */React.createElement("span", null, "Built with Vilio"), /* @__PURE__ */React.createElement("span", null, (/* @__PURE__ */new Date()).getFullYear()))));
|
|
50
|
-
}
|
package/dist/layout.mjs
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { getCurrentSession } from "@vilio/core/server";
|
|
2
|
-
import { getPublicNavigation } from "@vilio/modules/server";
|
|
3
|
-
import Link from "next/link";
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
export default async function MinimalLayout({
|
|
6
|
-
children
|
|
7
|
-
}) {
|
|
8
|
-
const navigation = await getPublicNavigation();
|
|
9
|
-
const { user } = await getCurrentSession();
|
|
10
|
-
return /* @__PURE__ */ React.createElement("div", { className: "min-h-screen bg-white text-zinc-900 font-mono selection:bg-zinc-900 selection:text-white" }, /* @__PURE__ */ React.createElement("div", { className: "max-w-2xl mx-auto px-6 py-12 space-y-16" }, /* @__PURE__ */ React.createElement("header", { className: "flex flex-col gap-8 border-b border-zinc-100 pb-8" }, /* @__PURE__ */ React.createElement(
|
|
11
|
-
Link,
|
|
12
|
-
{
|
|
13
|
-
href: "/",
|
|
14
|
-
className: "text-sm font-black uppercase tracking-tighter hover:opacity-50 transition-opacity"
|
|
15
|
-
},
|
|
16
|
-
"Vilio / Minimal"
|
|
17
|
-
), /* @__PURE__ */ React.createElement("nav", { className: "flex flex-wrap gap-x-6 gap-y-2 text-[10px] uppercase font-bold tracking-widest text-zinc-400" }, /* @__PURE__ */ React.createElement(Link, { href: "/", className: "hover:text-zinc-900 transition-colors" }, "Index"), navigation.map((item) => /* @__PURE__ */ React.createElement(
|
|
18
|
-
Link,
|
|
19
|
-
{
|
|
20
|
-
key: item.url,
|
|
21
|
-
href: item.url,
|
|
22
|
-
className: "hover:text-zinc-900 transition-colors"
|
|
23
|
-
},
|
|
24
|
-
item.title
|
|
25
|
-
)), user ? /* @__PURE__ */ React.createElement(
|
|
26
|
-
Link,
|
|
27
|
-
{
|
|
28
|
-
href: "/vilio",
|
|
29
|
-
className: "text-zinc-900 underline underline-offset-4"
|
|
30
|
-
},
|
|
31
|
-
"Dashboard"
|
|
32
|
-
) : /* @__PURE__ */ React.createElement(
|
|
33
|
-
Link,
|
|
34
|
-
{
|
|
35
|
-
href: "/signin",
|
|
36
|
-
className: "hover:text-zinc-900 transition-colors italic lowercase"
|
|
37
|
-
},
|
|
38
|
-
"Login"
|
|
39
|
-
))), /* @__PURE__ */ React.createElement("main", { className: "min-h-[50vh]" }, children), /* @__PURE__ */ React.createElement("footer", { className: "pt-16 border-t border-zinc-100 flex justify-between items-center text-[10px] uppercase font-bold tracking-widest text-zinc-300" }, /* @__PURE__ */ React.createElement("span", null, "Built with Vilio"), /* @__PURE__ */ React.createElement("span", null, (/* @__PURE__ */ new Date()).getFullYear()))));
|
|
40
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
module.exports = MinimalBlogDetail;
|
|
7
|
-
var _actions = require("@vilio/blog-module/actions");
|
|
8
|
-
var _server = require("@vilio/core/server");
|
|
9
|
-
var _link = _interopRequireDefault(require("next/link"));
|
|
10
|
-
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
async function MinimalBlogDetail({
|
|
15
|
-
params
|
|
16
|
-
}) {
|
|
17
|
-
const {
|
|
18
|
-
slug
|
|
19
|
-
} = await params;
|
|
20
|
-
const post = await (0, _actions.getPostBySlug)(slug);
|
|
21
|
-
if (!post || post.status !== "published") {
|
|
22
|
-
return /* @__PURE__ */React.createElement("div", {
|
|
23
|
-
className: "py-20 text-center text-[10px] uppercase font-bold tracking-widest opacity-30"
|
|
24
|
-
}, "404 / Post not found");
|
|
25
|
-
}
|
|
26
|
-
const comments = await (0, _actions.getComments)(post.id);
|
|
27
|
-
const {
|
|
28
|
-
user
|
|
29
|
-
} = await (0, _server.getCurrentSession)();
|
|
30
|
-
return /* @__PURE__ */React.createElement("article", {
|
|
31
|
-
className: "space-y-12 animate-in fade-in slide-in-from-bottom-2 duration-700"
|
|
32
|
-
}, /* @__PURE__ */React.createElement("header", {
|
|
33
|
-
className: "space-y-4"
|
|
34
|
-
}, /* @__PURE__ */React.createElement("div", {
|
|
35
|
-
className: "flex items-center gap-4 text-[10px] uppercase font-bold tracking-[0.2em] text-zinc-400"
|
|
36
|
-
}, /* @__PURE__ */React.createElement("span", null, new Date(post.createdAt).toLocaleDateString()), /* @__PURE__ */React.createElement("span", null, "/"), /* @__PURE__ */React.createElement("span", null, post.category?.name || "General")), /* @__PURE__ */React.createElement("h1", {
|
|
37
|
-
className: "text-4xl md:text-5xl font-black tracking-tighter leading-tight text-zinc-900"
|
|
38
|
-
}, post.title), post.excerpt && /* @__PURE__ */React.createElement("p", {
|
|
39
|
-
className: "text-xl text-zinc-500 font-medium leading-relaxed italic border-l-2 border-zinc-100 pl-6 py-2"
|
|
40
|
-
}, post.excerpt)), post.coverImage && /* @__PURE__ */React.createElement("div", {
|
|
41
|
-
className: "aspect-video bg-zinc-50 border border-zinc-100 overflow-hidden"
|
|
42
|
-
}, /* @__PURE__ */React.createElement("img", {
|
|
43
|
-
src: post.coverImage,
|
|
44
|
-
className: "w-full h-full object-cover grayscale",
|
|
45
|
-
alt: post.title
|
|
46
|
-
})), /* @__PURE__ */React.createElement("div", {
|
|
47
|
-
className: "prose prose-zinc max-w-none font-sans text-lg leading-relaxed text-zinc-800 whitespace-pre-wrap"
|
|
48
|
-
}, post.content), post.tags?.length > 0 && /* @__PURE__ */React.createElement("div", {
|
|
49
|
-
className: "flex flex-wrap gap-4 pt-8 border-t border-zinc-50"
|
|
50
|
-
}, post.tags.map(pt => /* @__PURE__ */React.createElement("span", {
|
|
51
|
-
key: pt.tag.id,
|
|
52
|
-
className: "text-[10px] font-bold uppercase tracking-widest text-zinc-400"
|
|
53
|
-
}, "#", pt.tag.name))), /* @__PURE__ */React.createElement("section", {
|
|
54
|
-
className: "pt-16 space-y-10"
|
|
55
|
-
}, /* @__PURE__ */React.createElement("h3", {
|
|
56
|
-
className: "text-xs font-black uppercase tracking-[0.3em] text-zinc-300 border-b border-zinc-50 pb-4"
|
|
57
|
-
}, "Comments (", comments.length, ")"), /* @__PURE__ */React.createElement("div", {
|
|
58
|
-
className: "space-y-12"
|
|
59
|
-
}, comments.map(comment => /* @__PURE__ */React.createElement("div", {
|
|
60
|
-
key: comment.id,
|
|
61
|
-
className: "space-y-2"
|
|
62
|
-
}, /* @__PURE__ */React.createElement("div", {
|
|
63
|
-
className: "flex items-center gap-3 text-[10px] font-black uppercase tracking-widest"
|
|
64
|
-
}, /* @__PURE__ */React.createElement("span", {
|
|
65
|
-
className: "text-zinc-900"
|
|
66
|
-
}, comment.author.name), /* @__PURE__ */React.createElement("span", {
|
|
67
|
-
className: "text-zinc-300"
|
|
68
|
-
}, "\u2022"), /* @__PURE__ */React.createElement("span", {
|
|
69
|
-
className: "text-zinc-300"
|
|
70
|
-
}, new Date(comment.createdAt).toLocaleDateString())), /* @__PURE__ */React.createElement("p", {
|
|
71
|
-
className: "text-sm text-zinc-600 leading-relaxed font-sans"
|
|
72
|
-
}, comment.content))), comments.length === 0 && /* @__PURE__ */React.createElement("p", {
|
|
73
|
-
className: "text-[10px] uppercase font-bold text-zinc-300 italic"
|
|
74
|
-
}, "No discussion yet.")), /* @__PURE__ */React.createElement("div", {
|
|
75
|
-
className: "pt-8"
|
|
76
|
-
}, /* @__PURE__ */React.createElement(_link.default, {
|
|
77
|
-
href: "/signin",
|
|
78
|
-
className: "text-[10px] font-black uppercase tracking-widest border-b-2 border-zinc-900 pb-1 hover:opacity-50 transition-opacity"
|
|
79
|
-
}, "Join the conversation \u2192"))), /* @__PURE__ */React.createElement("footer", {
|
|
80
|
-
className: "pt-20"
|
|
81
|
-
}, /* @__PURE__ */React.createElement(_link.default, {
|
|
82
|
-
href: "/blog",
|
|
83
|
-
className: "text-[10px] font-black uppercase tracking-widest text-zinc-400 hover:text-zinc-900 transition-colors flex items-center gap-2"
|
|
84
|
-
}, "\u2190 Back to writings")));
|
|
85
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { getComments, getPostBySlug } from "@vilio/blog-module/actions";
|
|
2
|
-
import { getCurrentSession } from "@vilio/core/server";
|
|
3
|
-
import Link from "next/link";
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
export default async function MinimalBlogDetail({
|
|
6
|
-
params
|
|
7
|
-
}) {
|
|
8
|
-
const { slug } = await params;
|
|
9
|
-
const post = await getPostBySlug(slug);
|
|
10
|
-
if (!post || post.status !== "published") {
|
|
11
|
-
return /* @__PURE__ */ React.createElement("div", { className: "py-20 text-center text-[10px] uppercase font-bold tracking-widest opacity-30" }, "404 / Post not found");
|
|
12
|
-
}
|
|
13
|
-
const comments = await getComments(post.id);
|
|
14
|
-
const { user } = await getCurrentSession();
|
|
15
|
-
return /* @__PURE__ */ React.createElement("article", { className: "space-y-12 animate-in fade-in slide-in-from-bottom-2 duration-700" }, /* @__PURE__ */ React.createElement("header", { className: "space-y-4" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-4 text-[10px] uppercase font-bold tracking-[0.2em] text-zinc-400" }, /* @__PURE__ */ React.createElement("span", null, new Date(post.createdAt).toLocaleDateString()), /* @__PURE__ */ React.createElement("span", null, "/"), /* @__PURE__ */ React.createElement("span", null, post.category?.name || "General")), /* @__PURE__ */ React.createElement("h1", { className: "text-4xl md:text-5xl font-black tracking-tighter leading-tight text-zinc-900" }, post.title), post.excerpt && /* @__PURE__ */ React.createElement("p", { className: "text-xl text-zinc-500 font-medium leading-relaxed italic border-l-2 border-zinc-100 pl-6 py-2" }, post.excerpt)), post.coverImage && /* @__PURE__ */ React.createElement("div", { className: "aspect-video bg-zinc-50 border border-zinc-100 overflow-hidden" }, /* @__PURE__ */ React.createElement(
|
|
16
|
-
"img",
|
|
17
|
-
{
|
|
18
|
-
src: post.coverImage,
|
|
19
|
-
className: "w-full h-full object-cover grayscale",
|
|
20
|
-
alt: post.title
|
|
21
|
-
}
|
|
22
|
-
)), /* @__PURE__ */ React.createElement("div", { className: "prose prose-zinc max-w-none font-sans text-lg leading-relaxed text-zinc-800 whitespace-pre-wrap" }, post.content), post.tags?.length > 0 && /* @__PURE__ */ React.createElement("div", { className: "flex flex-wrap gap-4 pt-8 border-t border-zinc-50" }, post.tags.map((pt) => /* @__PURE__ */ React.createElement(
|
|
23
|
-
"span",
|
|
24
|
-
{
|
|
25
|
-
key: pt.tag.id,
|
|
26
|
-
className: "text-[10px] font-bold uppercase tracking-widest text-zinc-400"
|
|
27
|
-
},
|
|
28
|
-
"#",
|
|
29
|
-
pt.tag.name
|
|
30
|
-
))), /* @__PURE__ */ React.createElement("section", { className: "pt-16 space-y-10" }, /* @__PURE__ */ React.createElement("h3", { className: "text-xs font-black uppercase tracking-[0.3em] text-zinc-300 border-b border-zinc-50 pb-4" }, "Comments (", comments.length, ")"), /* @__PURE__ */ React.createElement("div", { className: "space-y-12" }, comments.map((comment) => /* @__PURE__ */ React.createElement("div", { key: comment.id, className: "space-y-2" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-3 text-[10px] font-black uppercase tracking-widest" }, /* @__PURE__ */ React.createElement("span", { className: "text-zinc-900" }, comment.author.name), /* @__PURE__ */ React.createElement("span", { className: "text-zinc-300" }, "\u2022"), /* @__PURE__ */ React.createElement("span", { className: "text-zinc-300" }, new Date(comment.createdAt).toLocaleDateString())), /* @__PURE__ */ React.createElement("p", { className: "text-sm text-zinc-600 leading-relaxed font-sans" }, comment.content))), comments.length === 0 && /* @__PURE__ */ React.createElement("p", { className: "text-[10px] uppercase font-bold text-zinc-300 italic" }, "No discussion yet.")), /* @__PURE__ */ React.createElement("div", { className: "pt-8" }, /* @__PURE__ */ React.createElement(
|
|
31
|
-
Link,
|
|
32
|
-
{
|
|
33
|
-
href: "/signin",
|
|
34
|
-
className: "text-[10px] font-black uppercase tracking-widest border-b-2 border-zinc-900 pb-1 hover:opacity-50 transition-opacity"
|
|
35
|
-
},
|
|
36
|
-
"Join the conversation \u2192"
|
|
37
|
-
))), /* @__PURE__ */ React.createElement("footer", { className: "pt-20" }, /* @__PURE__ */ React.createElement(
|
|
38
|
-
Link,
|
|
39
|
-
{
|
|
40
|
-
href: "/blog",
|
|
41
|
-
className: "text-[10px] font-black uppercase tracking-widest text-zinc-400 hover:text-zinc-900 transition-colors flex items-center gap-2"
|
|
42
|
-
},
|
|
43
|
-
"\u2190 Back to writings"
|
|
44
|
-
)));
|
|
45
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
module.exports = MinimalBlogList;
|
|
7
|
-
var _actions = require("@vilio/blog-module/actions");
|
|
8
|
-
var _link = _interopRequireDefault(require("next/link"));
|
|
9
|
-
var React = _interopRequireWildcard(require("react"));
|
|
10
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
async function MinimalBlogList() {
|
|
14
|
-
const posts = await (0, _actions.getPosts)({
|
|
15
|
-
status: "published"
|
|
16
|
-
});
|
|
17
|
-
return /* @__PURE__ */React.createElement("div", {
|
|
18
|
-
className: "space-y-12"
|
|
19
|
-
}, /* @__PURE__ */React.createElement("h2", {
|
|
20
|
-
className: "text-xl font-black uppercase tracking-tighter border-l-4 border-zinc-900 pl-4"
|
|
21
|
-
}, "Writing"), /* @__PURE__ */React.createElement("div", {
|
|
22
|
-
className: "divide-y divide-zinc-50"
|
|
23
|
-
}, posts.map(post => /* @__PURE__ */React.createElement(_link.default, {
|
|
24
|
-
href: `/blog/${post.slug}`,
|
|
25
|
-
key: post.id,
|
|
26
|
-
className: "group block py-6 hover:bg-zinc-50/50 -mx-4 px-4 transition-colors"
|
|
27
|
-
}, /* @__PURE__ */React.createElement("div", {
|
|
28
|
-
className: "flex flex-col gap-1"
|
|
29
|
-
}, /* @__PURE__ */React.createElement("span", {
|
|
30
|
-
className: "text-[9px] uppercase font-bold text-zinc-400 tracking-widest"
|
|
31
|
-
}, new Date(post.createdAt).toLocaleDateString(), " \u2014", " ", post.category?.name || "General"), /* @__PURE__ */React.createElement("h3", {
|
|
32
|
-
className: "text-lg font-bold group-hover:underline underline-offset-4 decoration-2"
|
|
33
|
-
}, post.title), post.excerpt && /* @__PURE__ */React.createElement("p", {
|
|
34
|
-
className: "text-sm text-zinc-500 mt-2 line-clamp-2 italic font-sans leading-relaxed"
|
|
35
|
-
}, post.excerpt))))), posts.length === 0 && /* @__PURE__ */React.createElement("p", {
|
|
36
|
-
className: "text-sm opacity-30 italic"
|
|
37
|
-
}, "No posts published yet."));
|
|
38
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { getPosts } from "@vilio/blog-module/actions";
|
|
2
|
-
import Link from "next/link";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
export default async function MinimalBlogList() {
|
|
5
|
-
const posts = await getPosts({ status: "published" });
|
|
6
|
-
return /* @__PURE__ */ React.createElement("div", { className: "space-y-12" }, /* @__PURE__ */ React.createElement("h2", { className: "text-xl font-black uppercase tracking-tighter border-l-4 border-zinc-900 pl-4" }, "Writing"), /* @__PURE__ */ React.createElement("div", { className: "divide-y divide-zinc-50" }, posts.map((post) => /* @__PURE__ */ React.createElement(
|
|
7
|
-
Link,
|
|
8
|
-
{
|
|
9
|
-
href: `/blog/${post.slug}`,
|
|
10
|
-
key: post.id,
|
|
11
|
-
className: "group block py-6 hover:bg-zinc-50/50 -mx-4 px-4 transition-colors"
|
|
12
|
-
},
|
|
13
|
-
/* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-1" }, /* @__PURE__ */ React.createElement("span", { className: "text-[9px] uppercase font-bold text-zinc-400 tracking-widest" }, new Date(post.createdAt).toLocaleDateString(), " \u2014", " ", post.category?.name || "General"), /* @__PURE__ */ React.createElement("h3", { className: "text-lg font-bold group-hover:underline underline-offset-4 decoration-2" }, post.title), post.excerpt && /* @__PURE__ */ React.createElement("p", { className: "text-sm text-zinc-500 mt-2 line-clamp-2 italic font-sans leading-relaxed" }, post.excerpt))
|
|
14
|
-
))), posts.length === 0 && /* @__PURE__ */ React.createElement("p", { className: "text-sm opacity-30 italic" }, "No posts published yet."));
|
|
15
|
-
}
|