@y1feng200156/sairin-theme-minimal 1.1.2

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.
@@ -0,0 +1 @@
1
+ export declare function Footer(): import("react/jsx-runtime").JSX.Element;
package/lib/Footer.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Footer = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ function Footer() {
6
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "text-sm" }, { children: ["Powered by ", (0, jsx_runtime_1.jsx)("a", Object.assign({ className: "underline", target: "_blank", href: "https://github.com/djyde/sairin" }, { children: "Sairin" }))] })));
7
+ }
8
+ exports.Footer = Footer;
package/lib/Head.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export default function Head(props: {
2
+ sairinConfig: any;
3
+ }): import("react/jsx-runtime").JSX.Element;
package/lib/Head.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ function Head(props) {
5
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("link", { rel: "preconnect", href: "https://fonts.googleapis.com" }), (0, jsx_runtime_1.jsx)("link", { rel: "preconnect", href: "https://fonts.gstatic.com", crossOrigin: "" }), (0, jsx_runtime_1.jsx)("link", { href: "https://fonts.googleapis.com/css2?family=IBM+Plex+Serif:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap", rel: "stylesheet" }), (0, jsx_runtime_1.jsx)("link", { rel: "stylesheet", href: "https://cdn.jsdelivr.net/npm/katex@0.16.27/dist/katex.min.css", integrity: "sha384-vFEKS4hHSxIVqmYSltpM4iY89uq6qO3eKYQ105Yny4HOt5w4r3eqbYx7JwO31q/9", crossOrigin: "anonymous" }), props.sairinConfig.themeConfig.umami && ((0, jsx_runtime_1.jsx)("script", { async: true, defer: true, "data-website-id": props.sairinConfig.themeConfig.umami.id, src: props.sairinConfig.themeConfig.umami.src }))] }));
6
+ }
7
+ exports.default = Head;
package/lib/Home.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import { HomePageThemeProps } from "@y1feng200156/sairin-core";
2
+ export default function Home(props: HomePageThemeProps): import("react/jsx-runtime").JSX.Element;
package/lib/Home.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const head_1 = __importDefault(require("next/head"));
8
+ const link_1 = __importDefault(require("next/link"));
9
+ const dayjs_1 = __importDefault(require("dayjs"));
10
+ const Footer_1 = require("./Footer");
11
+ function Home(props) {
12
+ var _a;
13
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(head_1.default, { children: (0, jsx_runtime_1.jsx)("title", { children: props.themeConfig.title }) }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "container mx-auto max-w-2xl mt-24 px-4 sm:px-0" }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "text-3xl font-bold mb-4" }, { children: props.themeConfig.title })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "mt-2 mb-8" }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex gap-2" }, { children: (_a = props.themeConfig.links) === null || _a === void 0 ? void 0 : _a.map((link, index) => {
14
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("a", Object.assign({ className: "underline", target: "_blank", href: link.url }, { children: link.title }), link.url), index !== props.themeConfig.links.length - 1 && "•"] }));
15
+ }) })) })), (0, jsx_runtime_1.jsx)("div", { children: props.posts.map((post) => {
16
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "text-xl my-8" }, { children: [(0, jsx_runtime_1.jsx)(link_1.default, Object.assign({ href: `/${post.attributes.path}` }, { children: (0, jsx_runtime_1.jsx)("a", Object.assign({ className: "hover:underline" }, { children: post.title })) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "text-sm" }, { children: (0, dayjs_1.default)(post.createdAt).format("DD/MM/YYYY") }))] }), post.id));
17
+ }) }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "my-12" }, { children: (0, jsx_runtime_1.jsx)(Footer_1.Footer, {}) }))] }))] }));
18
+ }
19
+ exports.default = Home;
@@ -0,0 +1,4 @@
1
+ import { PostPageThemeProps } from "@y1feng200156/sairin-core";
2
+ export declare function OpenGraph(props: {
3
+ post: PostPageThemeProps["post"];
4
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OpenGraph = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ function OpenGraph(props) {
6
+ if (!props.post) {
7
+ return null;
8
+ }
9
+ const ogImage = `
10
+ https://og-image.vercel.app/${props.post.title}.png?theme=light&md=1&fontSize=100px&images=https%3A%2F%2Fassets.vercel.com%2Fimage%2Fupload%2Ffront%2Fassets%2Fdesign%2Fvercel-triangle-black.svg
11
+ `;
12
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("meta", { property: "og:type", content: "artical" }), (0, jsx_runtime_1.jsx)("meta", { property: "og:title", content: props.post.title }), (0, jsx_runtime_1.jsx)("meta", { property: "og:image", content: ogImage }), (0, jsx_runtime_1.jsx)("meta", { property: "article:published_time", content: props.post.createdAt }), (0, jsx_runtime_1.jsx)("meta", { property: "article:author", content: props.post.author.login }), (0, jsx_runtime_1.jsx)("meta", { name: "twitter:card", content: props.post.title }), (0, jsx_runtime_1.jsx)("meta", { name: "twitter:title", content: props.post.title }), (0, jsx_runtime_1.jsx)("meta", { name: "twitter:image", content: ogImage })] }));
13
+ }
14
+ exports.OpenGraph = OpenGraph;
package/lib/Post.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import { PostPageThemeProps } from "@y1feng200156/sairin-core";
2
+ export default function Post(props: PostPageThemeProps): import("react/jsx-runtime").JSX.Element | null;
package/lib/Post.js ADDED
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const dayjs_1 = __importDefault(require("dayjs"));
8
+ const head_1 = __importDefault(require("next/head"));
9
+ const link_1 = __importDefault(require("next/link"));
10
+ const Footer_1 = require("./Footer");
11
+ const OpenGraph_1 = require("./OpenGraph");
12
+ function Post(props) {
13
+ if (!props.post) {
14
+ return null;
15
+ }
16
+ return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)(head_1.default, { children: [(0, jsx_runtime_1.jsxs)("title", { children: [props.post.title, " - ", props.themeConfig.title] }), (0, jsx_runtime_1.jsx)(OpenGraph_1.OpenGraph, { post: props.post })] }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "container mx-auto mt-24 max-w-2xl px-4 sm:px-0" }, { children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex my-8 font-bold" }, { children: (0, jsx_runtime_1.jsx)(link_1.default, Object.assign({ href: "/" }, { children: props.themeConfig.title })) })) }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "mb-8" }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "text-3xl font-medium" }, { children: props.post.title })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex mt-4 items-center gap-2" }, { children: [(0, jsx_runtime_1.jsx)("img", { className: "w-8 h-8 rounded-full", src: props.post.author.avatarUrl }), (0, jsx_runtime_1.jsx)("a", Object.assign({ target: "_blank", href: props.post.author.url }, { children: props.post.author.login })), (0, jsx_runtime_1.jsx)("a", Object.assign({ className: "underline text-sm", target: "_blank", href: props.post.url }, { children: "View on GitHub" }))] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "my-8" }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex gap-4 flex-wrap" }, { children: props.post.reactionGroups
17
+ .filter((group) => group.reactors.totalCount !== 0)
18
+ .map((reactionGroup) => {
19
+ var _a;
20
+ return ((0, jsx_runtime_1.jsx)("a", Object.assign({ href: (_a = props.post) === null || _a === void 0 ? void 0 : _a.url, target: "_blank" }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex gap-2 bg-blue-50 border border-blue-100 px-4 py-1 rounded-full items-center" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-md" }, { children: {
21
+ THUMBS_UP: "👍",
22
+ THUMBS_DOWN: "👎",
23
+ LAUGH: "😄",
24
+ HOORAY: "🎉",
25
+ CONFUSED: "😕",
26
+ HEART: "❤️",
27
+ ROCKET: "🚀",
28
+ EYES: "👀",
29
+ }[reactionGroup.content] })), (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-sm font-sans" }, { children: reactionGroup.reactors.totalCount }))] })) })));
30
+ }) })) }))] })), (0, jsx_runtime_1.jsx)("div", { className: "post-body", dangerouslySetInnerHTML: { __html: props.post.html } }), (0, jsx_runtime_1.jsx)("hr", { className: "my-12" }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "font-sans" }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "mb-12" }, { children: (0, jsx_runtime_1.jsx)("a", Object.assign({ target: "_blank", href: props.post.url, className: "font-medium border border-gray-700 hover:bg-gray-700 hover:text-gray-100 transition-all text-gray-700 text-sm rounded px-4 py-2" }, { children: "Add comment" })) })), props.post.comments.nodes.map((comment) => {
31
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "mb-8" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex items-center gap-2" }, { children: [(0, jsx_runtime_1.jsx)("img", { className: "w-8 h-8 rounded-full", src: comment.author.avatarUrl, alt: "" }), (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "font-medium" }, { children: comment.author.login }))] })), (0, jsx_runtime_1.jsx)("div", { dangerouslySetInnerHTML: { __html: comment.html }, className: "mt-2 mb-2 text-gray-800 post-body font-sans" }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "mt-1 flex text-sm text-gray-500 items-center gap-2" }, { children: [(0, jsx_runtime_1.jsx)("a", Object.assign({ target: "_blank", href: comment.url, className: "hover:underline" }, { children: "Reply" })), (0, jsx_runtime_1.jsx)("span", { children: "\u2022" }), (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "" }, { children: (0, dayjs_1.default)(comment.createdAt).format("YYYY-MM-DD") }))] }))] })));
32
+ })] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "my-12" }, { children: (0, jsx_runtime_1.jsx)(Footer_1.Footer, {}) }))] }))] }));
33
+ }
34
+ exports.default = Post;
package/lib/index.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import Home from './Home';
2
+ import Post from './Post';
3
+ import Head from './Head';
4
+ declare const _default: {
5
+ Home: typeof Home;
6
+ Post: typeof Post;
7
+ Head: typeof Head;
8
+ };
9
+ export default _default;
package/lib/index.js ADDED
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Home_1 = __importDefault(require("./Home"));
7
+ const Post_1 = __importDefault(require("./Post"));
8
+ const Head_1 = __importDefault(require("./Head"));
9
+ exports.default = {
10
+ Home: Home_1.default,
11
+ Post: Post_1.default,
12
+ Head: Head_1.default
13
+ };
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@y1feng200156/sairin-theme-minimal",
3
+ "version": "1.1.2",
4
+ "main": "lib/index.js",
5
+ "scripts": {
6
+ "dev": "concurrently npm:dev-theme npm:dev-style",
7
+ "dev-theme": "tsc --watch",
8
+ "dev-style": "tailwind -i ./src/style.css -o ./style.css --watch",
9
+ "build-theme": "tsc",
10
+ "build-style": "tailwind -i ./src/style.css -o ./style.css",
11
+ "build": "concurrently npm:build-theme npm:build-style",
12
+ "prepublish": "npm run build"
13
+ },
14
+ "devDependencies": {
15
+ "@y1feng200156/sairin-core": "workspace:*",
16
+ "autoprefixer": "^10.4.2",
17
+ "concurrently": "^7.0.0",
18
+ "next": "^12.1.0",
19
+ "postcss": "^8.4.6",
20
+ "tailwindcss": "^3.0.23",
21
+ "typescript": "^4.5.5",
22
+ "@types/react": "^17.0.39"
23
+ },
24
+ "peerDependencies": {
25
+ "next": "^12.1.0"
26
+ },
27
+ "dependencies": {
28
+ "dayjs": "^1.10.7"
29
+ }
30
+ }
package/src/Footer.tsx ADDED
@@ -0,0 +1,7 @@
1
+ export function Footer () {
2
+ return (
3
+ <div className="text-sm">
4
+ Powered by <a className="underline" target="_blank" href="https://github.com/djyde/sairin">Sairin</a>
5
+ </div>
6
+ )
7
+ }
package/src/Head.tsx ADDED
@@ -0,0 +1,27 @@
1
+ export default function Head(props: { sairinConfig: any }) {
2
+ return (
3
+ <>
4
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
5
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="" />
6
+ <link
7
+ href="https://fonts.googleapis.com/css2?family=IBM+Plex+Serif:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap"
8
+ rel="stylesheet"
9
+ />
10
+ <link
11
+ rel="stylesheet"
12
+ href="https://cdn.jsdelivr.net/npm/katex@0.16.27/dist/katex.min.css"
13
+ integrity="sha384-vFEKS4hHSxIVqmYSltpM4iY89uq6qO3eKYQ105Yny4HOt5w4r3eqbYx7JwO31q/9"
14
+ crossOrigin="anonymous"
15
+ />
16
+
17
+ {props.sairinConfig.themeConfig.umami && (
18
+ <script
19
+ async
20
+ defer
21
+ data-website-id={props.sairinConfig.themeConfig.umami.id}
22
+ src={props.sairinConfig.themeConfig.umami.src}
23
+ ></script>
24
+ )}
25
+ </>
26
+ );
27
+ }
package/src/Home.tsx ADDED
@@ -0,0 +1,59 @@
1
+ import Head from "next/head";
2
+ import Link from "next/link";
3
+ import dayjs from "dayjs";
4
+ import { Footer } from "./Footer";
5
+
6
+ import { HomePageThemeProps } from "@y1feng200156/sairin-core";
7
+
8
+ export default function Home(props: HomePageThemeProps) {
9
+ return (
10
+ <>
11
+ <Head>
12
+ <title>{props.themeConfig.title}</title>
13
+ </Head>
14
+ <div className="container mx-auto max-w-2xl mt-24 px-4 sm:px-0">
15
+ <div className="text-3xl font-bold mb-4">{props.themeConfig.title}</div>
16
+
17
+ <div className="mt-2 mb-8">
18
+ <div className="flex gap-2">
19
+ {props.themeConfig.links?.map((link, index) => {
20
+ return (
21
+ <>
22
+ <a
23
+ className="underline"
24
+ target="_blank"
25
+ href={link.url}
26
+ key={link.url}
27
+ >
28
+ {link.title}
29
+ </a>
30
+ {index !== props.themeConfig.links.length - 1 && "•"}
31
+ </>
32
+ );
33
+ })}
34
+ </div>
35
+ </div>
36
+
37
+ <div>
38
+ {props.posts.map((post) => {
39
+ return (
40
+ <div key={post.id} className="text-xl my-8">
41
+ <Link href={`/${post.attributes.path}`}>
42
+ <a className="hover:underline">{post.title}</a>
43
+ </Link>
44
+
45
+ <div className="text-sm">
46
+ {dayjs(post.createdAt).format("DD/MM/YYYY")}
47
+ </div>
48
+ </div>
49
+ );
50
+ })}
51
+ </div>
52
+
53
+ <div className="my-12">
54
+ <Footer />
55
+ </div>
56
+ </div>
57
+ </>
58
+ );
59
+ }
@@ -0,0 +1,26 @@
1
+ import { PostPageThemeProps } from "@y1feng200156/sairin-core";
2
+
3
+ export function OpenGraph(props: { post: PostPageThemeProps["post"] }) {
4
+ if (!props.post) {
5
+ return null;
6
+ }
7
+
8
+ const ogImage = `
9
+ https://og-image.vercel.app/${props.post.title}.png?theme=light&md=1&fontSize=100px&images=https%3A%2F%2Fassets.vercel.com%2Fimage%2Fupload%2Ffront%2Fassets%2Fdesign%2Fvercel-triangle-black.svg
10
+ `;
11
+ return (
12
+ <>
13
+ <meta property="og:type" content="artical" />
14
+ {/* <meta property="og:description" content={props.post.body.substring(0, 140)} /> */}
15
+ <meta property="og:title" content={props.post.title} />
16
+ <meta property="og:image" content={ogImage} />
17
+
18
+ <meta property="article:published_time" content={props.post.createdAt} />
19
+ <meta property="article:author" content={props.post.author.login} />
20
+
21
+ <meta name="twitter:card" content={props.post.title} />
22
+ <meta name="twitter:title" content={props.post.title} />
23
+ <meta name="twitter:image" content={ogImage} />
24
+ </>
25
+ );
26
+ }
package/src/Post.tsx ADDED
@@ -0,0 +1,146 @@
1
+ import { PostPageThemeProps } from "@y1feng200156/sairin-core";
2
+ import dayjs from "dayjs";
3
+ import Head from "next/head";
4
+ import Link from "next/link";
5
+ import { Footer } from "./Footer";
6
+ import { OpenGraph } from "./OpenGraph";
7
+
8
+ export default function Post(props: PostPageThemeProps) {
9
+ if (!props.post) {
10
+ return null;
11
+ }
12
+
13
+ return (
14
+ <div>
15
+ <Head>
16
+ <title>
17
+ {props.post.title} - {props.themeConfig.title}
18
+ </title>
19
+ <OpenGraph post={props.post} />
20
+ </Head>
21
+
22
+ <div className="container mx-auto mt-24 max-w-2xl px-4 sm:px-0">
23
+ <div>
24
+ <div className="flex my-8 font-bold">
25
+ <Link href="/">{props.themeConfig.title}</Link>
26
+ </div>
27
+ </div>
28
+
29
+ <div className="mb-8">
30
+ <div className="text-3xl font-medium">{props.post.title}</div>
31
+
32
+ <div className="flex mt-4 items-center gap-2">
33
+ <img
34
+ className="w-8 h-8 rounded-full"
35
+ src={props.post.author.avatarUrl}
36
+ ></img>
37
+
38
+ <a target="_blank" href={props.post.author.url}>
39
+ {props.post.author.login}
40
+ </a>
41
+
42
+ <a
43
+ className="underline text-sm"
44
+ target="_blank"
45
+ href={props.post.url}
46
+ >
47
+ View on GitHub
48
+ </a>
49
+ </div>
50
+
51
+ <div className="my-8">
52
+ <div className="flex gap-4 flex-wrap">
53
+ {props.post.reactionGroups
54
+ .filter((group) => group.reactors.totalCount !== 0)
55
+ .map((reactionGroup) => {
56
+ return (
57
+ <a href={props.post?.url} target="_blank">
58
+ <div className="flex gap-2 bg-blue-50 border border-blue-100 px-4 py-1 rounded-full items-center">
59
+ <span className="text-md">
60
+ {
61
+ {
62
+ THUMBS_UP: "👍",
63
+ THUMBS_DOWN: "👎",
64
+ LAUGH: "😄",
65
+ HOORAY: "🎉",
66
+ CONFUSED: "😕",
67
+ HEART: "❤️",
68
+ ROCKET: "🚀",
69
+ EYES: "👀",
70
+ }[reactionGroup.content]
71
+ }
72
+ </span>
73
+ <span className="text-sm font-sans">
74
+ {reactionGroup.reactors.totalCount}
75
+ </span>
76
+ </div>
77
+ </a>
78
+ );
79
+ })}
80
+ </div>
81
+ </div>
82
+ </div>
83
+
84
+ <div
85
+ className="post-body"
86
+ dangerouslySetInnerHTML={{ __html: props.post.html }}
87
+ ></div>
88
+
89
+ <hr className="my-12" />
90
+
91
+ <div className="font-sans">
92
+ {/* <h1 className='text-md mb-8'>🗣 Comments</h1> */}
93
+
94
+ <div className="mb-12">
95
+ <a
96
+ target={"_blank"}
97
+ href={props.post.url}
98
+ className="font-medium border border-gray-700 hover:bg-gray-700 hover:text-gray-100 transition-all text-gray-700 text-sm rounded px-4 py-2"
99
+ >
100
+ Add comment
101
+ </a>
102
+ </div>
103
+
104
+ {props.post.comments.nodes.map((comment) => {
105
+ return (
106
+ <div className="mb-8">
107
+ <div className="flex items-center gap-2">
108
+ <img
109
+ className="w-8 h-8 rounded-full"
110
+ src={comment.author.avatarUrl}
111
+ alt=""
112
+ />
113
+
114
+ <span className="font-medium">{comment.author.login}</span>
115
+ </div>
116
+
117
+ <div
118
+ dangerouslySetInnerHTML={{ __html: (comment as any).html }}
119
+ className="mt-2 mb-2 text-gray-800 post-body font-sans"
120
+ ></div>
121
+
122
+ <div className="mt-1 flex text-sm text-gray-500 items-center gap-2">
123
+ <a
124
+ target={"_blank"}
125
+ href={comment.url}
126
+ className="hover:underline"
127
+ >
128
+ Reply
129
+ </a>
130
+ <span>•</span>
131
+ <span className="">
132
+ {dayjs(comment.createdAt).format("YYYY-MM-DD")}
133
+ </span>
134
+ </div>
135
+ </div>
136
+ );
137
+ })}
138
+ </div>
139
+
140
+ <div className="my-12">
141
+ <Footer />
142
+ </div>
143
+ </div>
144
+ </div>
145
+ );
146
+ }
package/src/index.ts ADDED
@@ -0,0 +1,9 @@
1
+ import Home from './Home'
2
+ import Post from './Post'
3
+ import Head from './Head'
4
+
5
+ export default {
6
+ Home,
7
+ Post,
8
+ Head
9
+ }
package/src/style.css ADDED
@@ -0,0 +1,216 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ /* prism begin*/
6
+
7
+
8
+ code[class*="language-"],
9
+ pre[class*="language-"] {
10
+ font-family: Consolas, Menlo, Monaco, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", "Courier New", Courier, monospace;
11
+ font-size: 14px;
12
+ line-height: 1.375;
13
+ direction: ltr;
14
+ text-align: left;
15
+ white-space: pre;
16
+ word-spacing: normal;
17
+ word-break: normal;
18
+
19
+ -moz-tab-size: 4;
20
+ -o-tab-size: 4;
21
+ tab-size: 4;
22
+
23
+ -webkit-hyphens: none;
24
+ -moz-hyphens: none;
25
+ -ms-hyphens: none;
26
+ hyphens: none;
27
+ background: #faf8f5;
28
+ color: #728fcb;
29
+ }
30
+
31
+ pre > code[class*="language-"] {
32
+ font-size: 1em;
33
+ }
34
+ /*
35
+ pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
36
+ code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
37
+ text-shadow: none;
38
+ background: #faf8f5;
39
+ }
40
+
41
+ pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
42
+ code[class*="language-"]::selection, code[class*="language-"] ::selection {
43
+ text-shadow: none;
44
+ background: #faf8f5;
45
+ } */
46
+
47
+ /* Code blocks */
48
+ pre[class*="language-"] {
49
+ padding: 1em;
50
+ margin: .5em 0;
51
+ overflow: auto;
52
+ }
53
+
54
+ /* Inline code */
55
+ :not(pre) > code[class*="language-"] {
56
+ padding: .1em;
57
+ border-radius: .3em;
58
+ }
59
+
60
+ .token.comment,
61
+ .token.prolog,
62
+ .token.doctype,
63
+ .token.cdata {
64
+ color: #b6ad9a;
65
+ }
66
+
67
+ .token.punctuation {
68
+ color: #b6ad9a;
69
+ }
70
+
71
+ .token.namespace {
72
+ opacity: .7;
73
+ }
74
+
75
+ .token.tag,
76
+ .token.operator,
77
+ .token.number {
78
+ color: #063289;
79
+ }
80
+
81
+ .token.property,
82
+ .token.function {
83
+ color: #b29762;
84
+ }
85
+
86
+ .token.tag-id,
87
+ .token.selector,
88
+ .token.atrule-id {
89
+ color: #2d2006;
90
+ }
91
+
92
+ code.language-javascript,
93
+ .token.attr-name {
94
+ color: #896724;
95
+ }
96
+
97
+ code.language-css,
98
+ code.language-scss,
99
+ .token.boolean,
100
+ .token.string,
101
+ .token.entity,
102
+ .token.url,
103
+ .language-css .token.string,
104
+ .language-scss .token.string,
105
+ .style .token.string,
106
+ .token.attr-value,
107
+ .token.keyword,
108
+ .token.control,
109
+ .token.directive,
110
+ .token.unit,
111
+ .token.statement,
112
+ .token.regex,
113
+ .token.atrule {
114
+ color: #728fcb;
115
+ }
116
+
117
+ .token.placeholder,
118
+ .token.variable {
119
+ color: #93abdc;
120
+ }
121
+
122
+ .token.deleted {
123
+ text-decoration: line-through;
124
+ }
125
+
126
+ .token.inserted {
127
+ border-bottom: 1px dotted #2d2006;
128
+ text-decoration: none;
129
+ }
130
+
131
+ .token.italic {
132
+ font-style: italic;
133
+ }
134
+
135
+ .token.important,
136
+ .token.bold {
137
+ font-weight: bold;
138
+ }
139
+
140
+ .token.important {
141
+ color: #896724;
142
+ }
143
+
144
+ .token.entity {
145
+ cursor: help;
146
+ }
147
+
148
+ pre > code.highlight {
149
+ outline: .4em solid #896724;
150
+ outline-offset: .4em;
151
+ }
152
+
153
+ /* overrides color-values for the Line Numbers plugin
154
+ * http://prismjs.com/plugins/line-numbers/
155
+ */
156
+ .line-numbers.line-numbers .line-numbers-rows {
157
+ border-right-color: #ece8de;
158
+ }
159
+
160
+ .line-numbers .line-numbers-rows > span:before {
161
+ color: #cdc4b1;
162
+ }
163
+
164
+ /* overrides color-values for the Line Highlight plugin
165
+ * http://prismjs.com/plugins/line-highlight/
166
+ */
167
+ .line-highlight.line-highlight {
168
+ background: rgba(45, 32, 6, 0.2);
169
+ background: -webkit-linear-gradient(left, rgba(45, 32, 6, 0.2) 70%, rgba(45, 32, 6, 0));
170
+ background: linear-gradient(to right, rgba(45, 32, 6, 0.2) 70%, rgba(45, 32, 6, 0));
171
+ }
172
+ /* prism end */
173
+
174
+ body {
175
+ font-family: 'IBM Plex Serif', serif;
176
+ }
177
+
178
+ .post-body p, pre {
179
+ @apply mb-4 leading-loose;
180
+ }
181
+
182
+ .post-body p > code {
183
+ @apply bg-gray-100 text-gray-900 text-sm p-1 rounded;
184
+ }
185
+
186
+ .post-body a {
187
+ @apply underline;
188
+ }
189
+
190
+ .post-body h1, h2, h3, h4, h5, h6 {
191
+ @apply mt-12 mb-6 font-medium;
192
+ }
193
+
194
+ .post-body h2 {
195
+ @apply text-3xl;
196
+ }
197
+
198
+ .post-body h3 {
199
+ @apply text-2xl;
200
+ }
201
+
202
+ .post-body h4 {
203
+ @apply text-xl;
204
+ }
205
+
206
+ .post-body a img {
207
+ display: inline-block;
208
+ }
209
+
210
+ .post-body img {
211
+ @apply max-w-full inline-block my-8 ;
212
+ }
213
+
214
+ .post-body blockquote {
215
+ @apply border-l-8 border-gray-300 pl-4 my-12;
216
+ }