diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index ce178d7..bbc96bc 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -3,8 +3,7 @@ name: Bug report about: Create a report to help us improve title: "[BUG] " labels: bug -assignees: '' - +assignees: "" --- **Describe the bug** diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 4a439c2..a22144f 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,9 +2,8 @@ name: Feature request about: Suggest an idea for this project title: "[Feature Request]" -labels: '' -assignees: '' - +labels: "" +assignees: "" --- **Is your feature request related to a problem? Please describe.** diff --git a/.github/ISSUE_TEMPLATE/question-and-answer.md b/.github/ISSUE_TEMPLATE/question-and-answer.md index 10cd99e..0670e0e 100644 --- a/.github/ISSUE_TEMPLATE/question-and-answer.md +++ b/.github/ISSUE_TEMPLATE/question-and-answer.md @@ -3,8 +3,7 @@ name: Question And Answer about: Ask questions that are unclear or unclear about this project. title: "[Q & A]" labels: question -assignees: '' - +assignees: "" --- Describe your problems here. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 5cdb187..4453da1 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community. Examples of behavior that contributes to a positive environment for our community include: -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience -* Focusing on what is best not just for us as individuals, but for the +- Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: -* The use of sexualized language or imagery, and sexual attention or +- The use of sexualized language or imagery, and sexual attention or advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a +- Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban. ### 4. Permanent Ban **Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an +standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. **Consequence**: A permanent ban from any sort of public interaction within diff --git a/components/readerpage/ShareButtons.tsx b/components/readerpage/ShareButtons.tsx index a8276e6..e0e46d7 100644 --- a/components/readerpage/ShareButtons.tsx +++ b/components/readerpage/ShareButtons.tsx @@ -11,26 +11,26 @@ export const ShareButtons = (props: { title: string; quote?: string | null; }) => { - const url = `https://${Config.SiteDomain}/blog/${props.postId}`; + const postURL = `https://${Config.SiteDomain}/blog/${props.postId}`; const copyShareText = `${props.title} ${props.subtitle ? `- ${props.subtitle}` : ""} - ${ Config.Nickname - }'s Blog ${url}`; + }'s Blog ${postURL}`; const { toast } = useToast(); return (
{props.allowShare != false ? ( <>
{"SHARE :"}
- + - + - + - + { return ( -
+
{"TABLE OF CONTENTS"}

    diff --git a/components/utils/Footer.tsx b/components/utils/Footer.tsx index 847830e..8b66c7c 100644 --- a/components/utils/Footer.tsx +++ b/components/utils/Footer.tsx @@ -1,5 +1,5 @@ import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog"; -import { RSSFeedLink } from "@/consts/consts"; +import { CopyrightAnnouncement, RSSFeedURL } from "@/consts/consts"; import { Config } from "@/data/config"; import Link from "next/link"; import { useState } from "react"; @@ -37,9 +37,7 @@ export const Footer = () => { )}
-
{`COPYRIGHT © ${ - Config.YearStart - }-${new Date().getFullYear()} ${Config.AuthorName} ALL RIGHTS RESERVED`}
+
{CopyrightAnnouncement}
@@ -57,12 +55,12 @@ export const Footer = () => {
- + { setIsCopied(true); }} - text={RSSFeedLink} + text={RSSFeedURL} >
); }; diff --git a/components/utils/TagBadge.tsx b/components/utils/TagBadge.tsx new file mode 100644 index 0000000..6ab800d --- /dev/null +++ b/components/utils/TagBadge.tsx @@ -0,0 +1,11 @@ +import Link from "next/link"; + +export const TagBadge = (props: { name: string; size: "sm" | "md"; count?: number }) => { + return ( + +
+ {`${props.name}${props.count ? ` (${props.count})` : ""}`} +
+ + ); +}; diff --git a/consts/consts.ts b/consts/consts.ts index b816c16..dcb611e 100644 --- a/consts/consts.ts +++ b/consts/consts.ts @@ -6,4 +6,9 @@ export const LatestPostCountInHomePage = 5; export const PostCountPerPagination = 5; export const PostsRootDirectory = path.join(process.cwd(), "./data/posts"); -export const RSSFeedLink = `https://${Config.SiteDomain}/rss.xml`; +export const RSSFeedURL = `https://${Config.SiteDomain}/rss.xml`; +export const WebsiteURL = `https://${Config.SiteDomain}/`; + +export const CopyrightAnnouncement = `COPYRIGHT © ${Config.YearStart}-${new Date().getFullYear()} ${ + Config.AuthorName +} ALL RIGHTS RESERVED`; diff --git a/lib/rss.tsx b/lib/rss.tsx index e5fc739..1de4175 100644 --- a/lib/rss.tsx +++ b/lib/rss.tsx @@ -1,4 +1,4 @@ -import { LatestPostCountInHomePage } from "@/consts/consts"; +import { CopyrightAnnouncement, LatestPostCountInHomePage, WebsiteURL } from "@/consts/consts"; import { Config } from "@/data/config"; import { Feed } from "feed"; import fs from "fs"; @@ -15,6 +15,8 @@ import remarkMath from "remark-math"; import remarkPrism from "remark-prism"; import { getPostFileContent, sortedPosts } from "./post-process"; +const NoticeForRSSReaders = `\n---\n**NOTE:** Different RSS reader may have deficient even no support for svg formulations rendering. If it happens, please read the origin page to have better experience.`; + /** * Generate the RSS Feed File in `./public` so it could be visited by https://domain/rss.xml */ @@ -23,23 +25,21 @@ export const generateRSSFeed = async () => { title: Config.SiteTitle, description: Config.Sentence, id: Config.SiteDomain, - link: `https://${Config.SiteDomain}/`, + link: WebsiteURL, image: Config.PageCovers.websiteCoverURL, favicon: `https://${Config.SiteDomain}/favcion.ico`, - copyright: `COPYRIGHT © ${Config.YearStart}-${new Date().getFullYear()} ${Config.AuthorName} ALL RIGHTS RESERVED`, + copyright: CopyrightAnnouncement, generator: "Node.js Feed", author: { name: Config.AuthorName, email: Config.SocialLinks.email, - link: `https://${Config.SiteDomain}/`, + link: WebsiteURL, }, }); for (let i = 0; i < LatestPostCountInHomePage; i++) { const post = sortedPosts.allPostList[i]; - const postContent = `${getPostFileContent( - post.id, - )}\n---\n**NOTE:** Different RSS reader may have deficient even no support for svg formulations rendering. If it happens, please read the origin page to have better experience.`; + const postContent = `${getPostFileContent(post.id)}${NoticeForRSSReaders}}`; const dateNumber = post.frontMatter.time.split("-").map((num) => parseInt(num)); const mdxSource = await serialize(postContent ?? "", { parseFrontmatter: true, diff --git a/pages/404.tsx b/pages/404.tsx index 46409a8..bf08723 100644 --- a/pages/404.tsx +++ b/pages/404.tsx @@ -5,7 +5,8 @@ import { fontSypxzs } from "@/styles/font"; import { TfiFaceSad } from "react-icons/tfi"; export default function NotFoundPage() { - const goBack = () => { + const handleGoBack = () => { + if (window == null) return; window.history.back(); }; return ( @@ -19,7 +20,7 @@ export default function NotFoundPage() { {"This page does not exist for it might be removed or closed."}

-
diff --git a/pages/about.tsx b/pages/about.tsx index 8f79125..878c843 100644 --- a/pages/about.tsx +++ b/pages/about.tsx @@ -48,17 +48,17 @@ export default function AboutPage() { )} -
  • 🖥️ Programming stack: XXXX
  • -
  • 🤝 I am looking to XXXXX
  • +
  • 🖥️ Programming stack: TypeScript, JavaScript, C++, C, Rust, Go and so on.
  • +
  • 🤝 I am looking for friends who are fund of XXXX
  • {Config.SocialLinks.twitter && (
  • {"📫 How to reach me on Twitter: "} - + {Config.SocialLinks.twitter}
  • )} -
  • Language : 汉语普通话(First Language) / English / 한국어 / 日本語
  • +
  • Language : 汉语 / English / 한국어 / 日本語
  • Gender Identity : Male / Female / MTF / FTM / And Others
  • From : Your Country, State / Province
  • diff --git a/pages/blog/[id].tsx b/pages/blog/[id].tsx index 2c637a4..c352c24 100644 --- a/pages/blog/[id].tsx +++ b/pages/blog/[id].tsx @@ -9,6 +9,7 @@ import { Toaster } from "@/components/ui/toaster"; import { Footer } from "@/components/utils/Footer"; import { NavBar } from "@/components/utils/NavBar"; import { SEO } from "@/components/utils/SEO"; +import { TagBadge } from "@/components/utils/TagBadge"; import { Config } from "@/data/config"; import { normalizeDate } from "@/lib/date"; import { getPostFileContent, sortedPosts } from "@/lib/post-process"; @@ -78,13 +79,7 @@ const ReaderPage = (props: ReaderPageProps) => {
    {"TAGS : "}
    {props.frontMatter.tags.map((tagName) => ( - - {tagName} - + ))}
    )} diff --git a/pages/friends.tsx b/pages/friends.tsx index 04974bd..2b2e7df 100644 --- a/pages/friends.tsx +++ b/pages/friends.tsx @@ -16,7 +16,7 @@ export default function FriendsPage() {

    {"FRIENDS"}


    -
    +
    {FriendsList.map((item) => ( {item.title} @@ -24,7 +24,7 @@ export default function FriendsPage() { ))}

    -
    +
    {"Welcome to exchange our friend links and every high-quality blog websites are welcomed. "} diff --git a/pages/posts/[[...slug]].tsx b/pages/posts/[[...slug]].tsx index 75cc56e..1a83564 100644 --- a/pages/posts/[[...slug]].tsx +++ b/pages/posts/[[...slug]].tsx @@ -100,9 +100,8 @@ export const getStaticProps: GetStaticProps = async (context) => const params = (context.params?.slug as string[]) ?? []; const pageNumber = params[0] ? parseInt(params[0]) : 1; - let postList: TPostListItem[] = []; - postList = paginateArray(sortedPosts.allPostList, PostCountPerPagination, pageNumber); + let postList: TPostListItem[] = paginateArray(sortedPosts.allPostList, PostCountPerPagination, pageNumber); const pageAmount = Math.ceil(sortedPosts.allPostList.length / PostCountPerPagination); diff --git a/pages/tags/index.tsx b/pages/tags/index.tsx index 69e91e1..ad50219 100644 --- a/pages/tags/index.tsx +++ b/pages/tags/index.tsx @@ -2,12 +2,12 @@ import { ContentContainer, Page } from "@/components/layouts/layouts"; import { Footer } from "@/components/utils/Footer"; import { NavBar } from "@/components/utils/NavBar"; import { SEO } from "@/components/utils/SEO"; +import { TagBadge } from "@/components/utils/TagBadge"; import { Config } from "@/data/config"; import { sortedPosts } from "@/lib/post-process"; import { fontFzxbs, fontSypxzs } from "@/styles/font"; import { nanoid } from "nanoid"; import { GetStaticProps } from "next"; -import Link from "next/link"; import { AiOutlineTags } from "react-icons/ai"; type TagsIndexPageProps = { @@ -30,9 +30,7 @@ export default function TagsIndexPage(props: TagsIndexPageProps) {
    {props.tagList.map((item) => ( - - {`${item.name} (${item.count})`} - + ))}
    diff --git a/styles/scrollbar.css b/styles/scrollbar.css index 5ce186f..28b368f 100644 --- a/styles/scrollbar.css +++ b/styles/scrollbar.css @@ -1,4 +1,3 @@ -/* 滚动槽 */ .flat-scrollbar::-webkit-scrollbar { width: 6px; height: 6px; @@ -8,14 +7,12 @@ background: rgba(0, 0, 0, 0.06); -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.08); } -/* 滚动条滑块 */ .flat-scrollbar::-webkit-scrollbar-thumb { border-radius: 3px; background: gray; -webkit-box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2); } -/* 滚动槽 */ .flat-scrollbar-thin::-webkit-scrollbar { width: 3px; height: 3px; @@ -25,7 +22,6 @@ background: rgba(0, 0, 0, 0.06); -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.08); } -/* 滚动条滑块 */ .flat-scrollbar-thin::-webkit-scrollbar-thumb { border-radius: 3px; background: gray; diff --git a/styles/ui.css b/styles/ui.css index 88b612c..4469a6b 100644 --- a/styles/ui.css +++ b/styles/ui.css @@ -1,35 +1,12 @@ -.text-selection { +.selection-style { @apply selection:bg-black selection:text-white dark:selection:bg-white dark:selection:text-black; } -.list-title { - @apply text-3xl - font-bold - text-sky-600 - dark:text-sky-500; -} - -.nav-link { - @apply border-b-sky-600 - font-bold - hover:text-sky-600 - dark:hover:border-b-sky-500 - dark:hover:text-sky-500; -} - .tag-link { - @apply border-2 - border-black - px-2 - hover:border-gray-600 - hover:text-gray-600 - dark:border-white - dark:text-white - dark:hover:border-gray-200 - dark:hover:text-gray-200; + @apply border-2 border-black px-2 hover:border-gray-600 hover:text-gray-600 dark:border-white dark:text-white dark:hover:border-gray-200 dark:hover:text-gray-200; } .link-button { @@ -45,5 +22,5 @@ } * { - @apply text-selection; + @apply selection-style; }