From 2a9af0c1e1377e229f6587cd89fcb98ff8601a65 Mon Sep 17 00:00:00 2001 From: Nooc Date: Sun, 18 Aug 2024 21:57:24 +0800 Subject: [PATCH] Add post advertising --- app/[lang]/posts/[...slug]/page.tsx | 110 ++++++++++++++++------------ dictionaries/en.ts | 6 ++ dictionaries/zh.ts | 6 ++ 3 files changed, 75 insertions(+), 47 deletions(-) diff --git a/app/[lang]/posts/[...slug]/page.tsx b/app/[lang]/posts/[...slug]/page.tsx index a97b448..a0f5ff5 100644 --- a/app/[lang]/posts/[...slug]/page.tsx +++ b/app/[lang]/posts/[...slug]/page.tsx @@ -6,6 +6,7 @@ import Link from "next/link"; import { getDictionary, languageLabels } from "@/dictionaries"; import { SiX } from "@icons-pack/react-simple-icons"; import { Metadata } from "next"; +import Image from "next/image"; import classNames from "classnames"; export const runtime = "edge"; @@ -72,57 +73,72 @@ export default async function PostPage({ return (
-
-

{post.title}

-
-
- - {displayDate(post.date, params.lang)} -
- - {otherLanguages.length ? ( +
+
+

{post.title}

+
- - {otherLanguages.map((post) => ( - - {languageLabels[post.lang]} - - ))} + + {displayDate(post.date, params.lang)}
- ) : undefined} -
-

{post.description}

-
- {/*
+ + {otherLanguages.length ? ( +
+ + {otherLanguages.map((post) => ( + + {languageLabels[post.lang]} + + ))} +
+ ) : undefined} +
+

{post.description}

+
+ {/*
*/} -
-
-
- {dictionary.labels.shareTo} - - - -
-
+
+
+
+ {dictionary.labels.shareTo} + + + +
+
+ + + {dictionary.postAdvertising.title} +
+
{dictionary.postAdvertising.title}
+
{dictionary.postAdvertising.description}
+
+
+ +
    diff --git a/dictionaries/en.ts b/dictionaries/en.ts index d265b6d..cc8f345 100644 --- a/dictionaries/en.ts +++ b/dictionaries/en.ts @@ -208,6 +208,12 @@ A fan of Serverless. icon: EnvelopeIcon, }, ], + postAdvertising: { + title: "Support me", + description: "Spark Memos is a concise note-taking app for capturing ideas, inspirations, or for later reading and book notes.", + icon: SparkMemosLogo, + link: "https://sparkmemos.com", + }, }; export default dictionary; diff --git a/dictionaries/zh.ts b/dictionaries/zh.ts index d60b2f8..fa41dbe 100644 --- a/dictionaries/zh.ts +++ b/dictionaries/zh.ts @@ -203,6 +203,12 @@ Serverless 爱好者。 icon: EnvelopeIcon, }, ], + postAdvertising: { + title: "支持我", + description: "「星火记」是一个简洁的短笔记应用,可以用来记录灵感、想法,或者是用于稍后阅读、读书笔记等。", + icon: SparkMemosLogo, + link: "https://sparkmemos.com", + }, }; export default dictionary;