From be1825fbf79ae6b0767228e9a0ad7fd3169669b8 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sat, 26 Aug 2023 02:24:05 +0100 Subject: [PATCH] feat: update descriptions --- src/components/dashboard/PagesManager.tsx | 105 +++++++++++++++++++--- src/lib/constants.ts | 2 +- src/lib/i18n/locales/zh/dashboard.json | 15 +++- src/lib/slug-reserved-words.ts | 1 + 4 files changed, 106 insertions(+), 17 deletions(-) diff --git a/src/components/dashboard/PagesManager.tsx b/src/components/dashboard/PagesManager.tsx index c473dcc1..44ca7f5c 100644 --- a/src/components/dashboard/PagesManager.tsx +++ b/src/components/dashboard/PagesManager.tsx @@ -16,6 +16,7 @@ import { useQueryClient } from "@tanstack/react-query" import PostCover from "~/components/home/PostCover" import { Image } from "~/components/ui/Image" import { useDate } from "~/hooks/useDate" +import { getSiteLink } from "~/lib/helpers" import { Trans, useTranslation } from "~/lib/i18n/client" import { getPageVisibility } from "~/lib/page-helpers" import { readFiles } from "~/lib/read-files" @@ -145,16 +146,26 @@ export const PagesManager = ({ type }: { type: NoteType }) => { switch (type) { case "post": description = ( -

- - Posts are entries listed in reverse chronological order on your - site. Think of them as articles or updates that you share to offer - up new content to your readers.{" "} - - Post vs. Page - - -

+ <> +

+ + Posts are entries listed in reverse chronological order on your + site. Think of them as articles or updates that you share to offer + up new content to your readers.{" "} + + Post vs. Page + + +

+

+ + Visitors can view the posts you have posted at homepage. + +

+ ) break case "page": @@ -175,12 +186,12 @@ export const PagesManager = ({ type }: { type: NoteType }) => {

- After you create a page, you can{" "} + Visitors can only access your page through its link, you can{" "} - add it to your site's navigation menu + add it to navigation menu {" "} so your visitors can find it. @@ -188,7 +199,7 @@ export const PagesManager = ({ type }: { type: NoteType }) => { ) break - case "portfolio": // TODO + case "portfolio": description = ( <>

@@ -199,8 +210,74 @@ export const PagesManager = ({ type }: { type: NoteType }) => { portfolio directly links to external URLs.

+

+ + Visitors can view the portfolios you have posted at homepage and{" "} + + /portfolios + + , you can{" "} + + add it to navigation menu + {" "} + so your visitors can find it. + +

) + break + case "short": + description = ( + <> +

+ + Shorts is a dedicated section for displaying pictures and short + texts. The content primarily consists of pictures, with the + accompanying text limited to 1000 characters or less. They will + not be displayed on the homepage, but on a separate page{" "} + + /shorts + + . + +

+

+ + Visitors can view the shots you have posted at{" "} + + /shorts + + , you can{" "} + + add it to navigation menu + {" "} + so your visitors can find it. + +

+ + ) + break } let currentLength = 0 @@ -239,7 +316,7 @@ export const PagesManager = ({ type }: { type: NoteType }) => { )} -
+
{description}
diff --git a/src/lib/constants.ts b/src/lib/constants.ts index db99da11..99f06a3e 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -18,4 +18,4 @@ export const COLOR_SCHEME_LIGHT = "light" export const DEFAULT_COLOR_SCHEME: ColorScheme = "light" export const DARK_MODE_STORAGE_KEY = "darkMode" -export const RESERVED_TAGS = ["page", "post", "portfolio", "comment"] +export const RESERVED_TAGS = ["page", "post", "portfolio", "comment", "short"] diff --git a/src/lib/i18n/locales/zh/dashboard.json b/src/lib/i18n/locales/zh/dashboard.json index 4afa7828..a36889e2 100644 --- a/src/lib/i18n/locales/zh/dashboard.json +++ b/src/lib/i18n/locales/zh/dashboard.json @@ -4,6 +4,7 @@ "Posts": "文章", "Pages": "页面", "Portfolios": "作品集", + "Shorts": "图文", "Notifications": "通知", "Unread notifications": "未读通知", "Settings": "设置", @@ -23,6 +24,7 @@ "All Posts": "所有文章", "All Pages": "所有页面", "All Portfolios": "所有作品集", + "All Shorts": "所有图文", "Published": "已发布", "published": "已发布", "Draft": "草稿", @@ -34,10 +36,15 @@ "posts description": "文章是按时间倒序在你的网站上列出的条目。可以将它们看作是更新,以提供新内容给读者。<2>文章与页面。", "pages description": "页面是静态的,不受日期影响。它们更像是你网站上的永久元素,比如“关于我们”、“联系我们”等。<2>文章与页面。", "portfolios description": "作品集是 xLog 之外的作品,比如你的 YouTube 视频、GitHub 项目,它们将像文章一样显示在主页的列表中。不同之处在于作品集直接跳转到外部网址。", - "pages add": "创建页面后,你可以将其<2>添加到你网站的导航菜单中,以便访问者可以找到它。", + "shots description": "图文是一个专门用于展示图片和简短文本的部分。内容主要由图片组成,附带的文本限制在1000个字符以内。", + "posts add": "访问者可以在首页查看你发布的文章。", + "shots add": "访问者可以在 <2>/shorts 查看你发布的图文,你可以将其<5>添加到导航菜单中,以便访问者可以找到它。", + "pages add": "访问者只能通过链接访问你的页面,你可以将其<2>添加到导航菜单中,以便访问者可以找到它。", + "portfolios add": "访问者可以在首页和 <2>/portfolios 查看你发布的作品,你可以将其<5>添加到导航菜单中,以便访问者可以找到它。", "New Post": "新建文章", "New Page": "新建页面", "New Portfolio": "新建作品", + "New Short": "新建图文", "Import": "导入", "Import markdown file with front matter supported": "导入 Markdown 文件(支持 Front Matter)", "View Site": "查看站点", @@ -75,6 +82,7 @@ "This post will be accessible from this time. Leave blank to use the current time.": "此文章将从此时间开始可访问。留空则使用当前时间。", "This page will be accessible from this time. Leave blank to use the current time.": "此页面将从此时间开始可访问。留空则使用当前时间。", "This portfolio will be accessible from this time. Leave blank to use the current time.": "此作品将从此时间开始可访问。留空则使用当前时间。", + "This short will be accessible from this time. Leave blank to use the current time.": "此图文将从此时间开始可访问。留空则使用当前时间。", "The post is currently not public as its publication date has been scheduled for a future time.": "此文章当前没有公开,因为它的发布日期已被定为将来的某个时间。", "Slug": "短链接", "This post will be accessible at": "此文章将可通过以下链接访问", @@ -221,5 +229,8 @@ "External Url": "外部链接", "Autofill": "自动填充", "Title": "标题", - "Edit portfolio": "编辑作品" + "Edit portfolio": "编辑作品", + "Edit short": "编辑图文", + "Images": "图片", + "Content": "内容" } diff --git a/src/lib/slug-reserved-words.ts b/src/lib/slug-reserved-words.ts index 85513987..c71dec23 100644 --- a/src/lib/slug-reserved-words.ts +++ b/src/lib/slug-reserved-words.ts @@ -14,6 +14,7 @@ const slugReservedWords = [ "atom.xml", "search", "portfolios", + "shorts", ] export const checkSlugReservedWords = (word: string) => {